-
Bug
-
Resolution: Duplicate
-
Minor
-
Jenkins: 2.60.2
workflow-multibranch-plugin: 1.16
git-plugin: 3.4.1
job-dsl-plugin: 1.64
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.
- duplicates
-
JENKINS-45504 Add @Symbol annotations to traits
-
- Closed
-
- is related to
-
JENKINS-46202 Cannot discover all GitHub repos and their branches with Job DSL anymore
-
- Closed
-
[JENKINS-45688] Unable to set extensions for Git SCM Source via DSL
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 ] |
Link |
New:
This issue is related to |
Assignee | Original: Mark Waite [ markewaite ] |
I suspect the fact that it worked before was not an intended use of the GitSCMSource API. stephenc will have more insights on the expectation of the use of the extensions from GitSCMSource.
Does the technique in the official documentation work? It seems to be setting extensions using a git node in the DSL, without using GitSCMSource.
Does the technique described in "use unsupported plugins with job DSL" still work? That technique does not seem to require GitSCMSource.
A similar technique is described in "How to use Jenkins JobDSL to set 'Check out to specific local branch' in Git Plugin" , in "sparse checkout with jenkins dsl plugin" and in "use Jenkins DSL to specify a git executable in github SCM".
I'm prone to close this as "Won't fix", but will wait for verification from stephenconnolly