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

Unable to set extensions for Git SCM Source via DSL

    XMLWordPrintable

Details

    Description

      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.

      Attachments

        Issue Links

          Activity

            sag47 Sam Gleske added a comment -

            Sure, I can put my frustration in check.  My intent wasn't to be hostile nor to imply it was done on purpose (it would be odd to assume that it's on purpose).

            sag47 Sam Gleske added a comment - Sure, I can put my frustration in check.  My intent wasn't to be hostile nor to imply it was done on purpose (it would be odd to assume that it's on purpose).
            sag47 Sam Gleske added a comment -

            Added git-plugin since the git-plugin should define "@Symbol" for its classes to help with the DSL generation to be unique.

            sag47 Sam Gleske added a comment - Added git-plugin since the git-plugin should define "@Symbol" for its classes to help with the DSL generation to be unique.
            sag47 Sam Gleske added a comment - https://github.com/jenkinsci/git-plugin/pull/595

            sag47, thanks for bringing this forward!

            stephenking Steffen Gebert added a comment - sag47 , thanks for bringing this forward!
            sag47 Sam Gleske added a comment -

            You're welcome.

            sag47 Sam Gleske added a comment - You're welcome.

            People

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

              Dates

                Created:
                Updated:
                Resolved: