Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-31532

snippet generator produces invalid output with latest git 2.5.0-beta2 plugins + submodule option.

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • structs-plugin
    • jenkins using the docker hub 'jenkins' image 1.625.1
      Workflow 1.11-beta4 and 1.10.1

      I ran into this exploring JENKINS-20941

      Steps to reproduce:
      1) Install latest git plugin and git client plugin from experimental repo
      2) In a workflow job from the snippet generator, choose 'General SCM'. Choose 'Git' as the type, then in the dropdown for additional behaviors, add 'Advanced Submodule Behaviors', then click 'Generate Groovy'. The generator outputs this which is syntatically incorrect:

      checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [<object of type hudson.plugins.git.extensions.impl.SubmoduleOption>], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '23a7815f-3fbd-462c-ba41-23668de4868d', url: 'git@git.example.com:foo/bar.git']]])

      Expected is something more like:

      checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'src'], [$class: 'SubmoduleOption', disableSubmodules: false, recursiveSubmodules: true, trackingSubmodules: false, parentCredentials: true]], submoduleCfg: [], userRemoteConfigs: [[ url: 'git@git.example.com:foo/bar.git']]])

      (The parentCredentials doesn't seem to work anyway yet, but it at least pareses as valid that way.)

          [JENKINS-31532] snippet generator produces invalid output with latest git 2.5.0-beta2 plugins + submodule option.

          b2jrock created issue -

          Jesse Glick added a comment -

          Do not see anything offhand in sources which would cause this. Will have to reproduce to diagnose.

          Jesse Glick added a comment - Do not see anything offhand in sources which would cause this. Will have to reproduce to diagnose.
          b2jrock made changes -
          Description Original: I ran into this exploring JENKINS-20941

          Steps to reproduce:
          1) Install latest git plugin and git client plugin from experimental repo
          2) In a workflow job from the snippet generator, choose 'General SCM'. Choose 'Git' as the type, then in the dropdown for additional behaviors, add 'Advanced Submodule Behaviors', then click 'Generate Groovy'. The generator outputs this which is syntatically incorrect:
          --
          checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [<object of type hudson.plugins.git.extensions.impl.SubmoduleOption>], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '23a7815f-3fbd-462c-ba41-23668de4868d', url: 'git@git.example.com:foo/bar.git']]])
          --
          Expected is something more like:
          --
          checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'src'], [$class: 'SubmoduleOption', disableSubmodules: false, recursiveSubmodules: true, trackingSubmodules: false, parentCredentials: true]], submoduleCfg: [], userRemoteConfigs: [[ url: 'git@git.example.com:foo/bar.git']]])
          --
          (he parentCredentials doesn't seem to work anyway yet, but it at least pareses as valid that way.
          New: I ran into this exploring JENKINS-20941

          Steps to reproduce:
          1) Install latest git plugin and git client plugin from experimental repo
          2) In a workflow job from the snippet generator, choose 'General SCM'. Choose 'Git' as the type, then in the dropdown for additional behaviors, add 'Advanced Submodule Behaviors', then click 'Generate Groovy'. The generator outputs this which is syntatically incorrect:
          --
          checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [<object of type hudson.plugins.git.extensions.impl.SubmoduleOption>], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '23a7815f-3fbd-462c-ba41-23668de4868d', url: 'git@git.example.com:foo/bar.git']]])
          --
          Expected is something more like:
          --
          checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'src'], [$class: 'SubmoduleOption', disableSubmodules: false, recursiveSubmodules: true, trackingSubmodules: false, parentCredentials: true]], submoduleCfg: [], userRemoteConfigs: [[ url: 'git@git.example.com:foo/bar.git']]])
          --
          (The parentCredentials doesn't seem to work anyway yet, but it at least pareses as valid that way.)
          Jesse Glick made changes -
          Epic Link New: JENKINS-35393 [ 171186 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 166950 ] New: JNJira + In-Review [ 182523 ]
          Andrew Bayer made changes -
          Component/s New: pipeline-general [ 21692 ]
          Andrew Bayer made changes -
          Component/s Original: workflow-plugin [ 18820 ]
          Jesse Glick made changes -
          Component/s New: structs-plugin [ 21442 ]
          Component/s Original: pipeline [ 21692 ]
          Jesse Glick made changes -
          Labels New: pipeline

            jglick Jesse Glick
            b2jrock b2jrock
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: