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

Unable to set extensions for Git SCM Source via DSL

      In the past I used `gitSCMSource` to specify my git configuration with extensions in my Job DSL.
       
      Template I used:

      multibranchPipelineJob('${JOB_NAME}') {
          displayName('${JOB_NAME}')
          description('${JOB_DESCRIPTION}')
          orphanedItemStrategy {
              discardOldItems {
                  numToKeep(7)
              }
          }
          branchSources {
              branchSource {
                  source {
                      gitSCMSource {
                          id('')
                          remoteName('origin')
                          rawRefSpecs('')
                          ignoreOnPushNotifications(false)
                          remote('${JOB_GIT_URL}')
                          credentialsId('${GIT_CREDENTIALS_ID}')
                          includes('*')
                          excludes('')
                          extensions {
                              wipeWorkspace()
                              preBuildMerge {
                                  options {
                                      mergeRemote('origin')
                                      mergeTarget('${GIT_BRANCH}')
                                      mergeStrategy('default')
                                      fastForwardMode('FF')
                                  }
                              }
                          }
                      }
                  }
              }
          }
      }

      Now after updating to latest Jenkins/Plugins this no longer works. I looked at using the `git` source instead of `gitSCMSource` but it does not provide a way to set the extensions.

      In the new git-plugin 3.4.0 extensions are deprecated and are now traits. Not sure if this has anything to do with the issue.

          [JENKINS-45688] Unable to set extensions for Git SCM Source via DSL

          Art V created issue -
          Art V made changes -
          Attachment New: Screen Shot 2017-07-21 at 09.36.26.png [ 38988 ]
          Attachment New: Screen Shot 2017-07-21 at 09.36.06.png [ 38989 ]
          Steffen Gebert made changes -
          Link New: This issue is related to JENKINS-46202 [ JENKINS-46202 ]
          Mark Waite made changes -
          Assignee Original: Mark Waite [ markewaite ]
          Stephen Connolly made changes -
          Link New: This issue duplicates JENKINS-45504 [ JENKINS-45504 ]
          Stephen Connolly made changes -
          Resolution New: Duplicate [ 3 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]
          Daniel Spilker made changes -
          Status Original: Resolved [ 5 ] New: Closed [ 6 ]
          Sam Gleske made changes -
          Labels Original: job-dsl plugin New: git-plugin job-dsl plugin

            Unassigned Unassigned
            arty13 Art V
            Votes:
            1 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: