Hello,
I am configuring the Gitlab Push Trigger using the automatically generated DSL, the DSL seems to generate the configuration XML file , but the webhook from Gitlab does not fire the job. It fails with an HTTP 500 error
When i open the job configuration to edit, make no changes, and save it again through the UI..retry the hook ..it works...
Here is my DSL
gitLabPushTrigger {
triggerOnPush(true)
triggerOnMergeRequest(false)
triggerOpenMergeRequestOnPush('never')
triggerOnNoteRequest(false)
noteRegex('')
skipWorkInProgressMergeRequest(true)
ciSkip(false)
setBuildDescription(true)
addNoteOnMergeRequest(false)
addCiMessage(false)
addVoteOnMergeRequest(false)
acceptMergeRequestOnSuccess(false)
branchFilterType('NameBasedFilter')
includeBranchesSpec(repoBranchName)
excludeBranchesSpec('')
targetBranchRegex('')
mergeRequestLabelFilterConfig {
include('')
exclude('')
}
secretToken(HashGenerator.generate(jobName))
}
I began to compare the XML snippets (of the trigger section), generated by Job DSL and after having saved it through the UI
Original (Generated by Job DSL)
<riggers class="vector"><com.dabsquared.gitlabjenkins.GitLabPushTrigger plugin="gitlab...@1.4.3"><triggerOnPush>true
</triggerOnPush> <triggerOnMergeRequest>false
</triggerOnMergeRequest> <triggerOpenMergeRequestOnPush>never
</triggerOpenMergeRequestOnPush> <triggerOnNoteRequest>false
</triggerOnNoteRequest> <skipWorkInProgressMergeRequest>true
</skipWorkInProgressMergeRequest> <setBuildDescription>true
</setBuildDescription> <branchFilterType>NameBasedFilter
</branchFilterType> <includeBranchesSpec>develop
</includeBranchesSpec> <mergeRequestLabelFilterConfig></mergeRequestLabelFilterConfig> <secretToken>nbIHZdJ2ayIOmzhXuckPwf3hWxymjSAvuKuAJXc4igemwx07RxxLj/Vdp6XQorqG
</secretToken> </com.dabsquared.gitlabjenkins.GitLabPushTrigger> </triggers>
Configuration XML (After i have saved the Job through the UI with no changes)
<triggers><com.dabsquared.gitlabjenkins.GitLabPushTrigger plugin="gitlab...@1.4.3"><triggerOnPush>true
</triggerOnPush> <triggerOnMergeRequest>false
</triggerOnMergeRequest> <triggerOpenMergeRequestOnPush>never
</triggerOpenMergeRequestOnPush> <triggerOnNoteRequest>false
</triggerOnNoteRequest> <skipWorkInProgressMergeRequest>true
</skipWorkInProgressMergeRequest> <setBuildDescription>true
</setBuildDescription> <branchFilterType>NameBasedFilter
</branchFilterType> <includeBranchesSpec>develop
</includeBranchesSpec> <mergeRequestLabelFilterConfig></mergeRequestLabelFilterConfig> <secretToken>nbIHZdJ2ayIOmzhXuckPwf3hWxymjSAvuKuAJXc4igemwx07RxxLj/Vdp6XQorqG
</secretToken> </com.dabsquared.gitlabjenkins.GitLabPushTrigger> </triggers>
The latter configuration works, the former doesn't . I do see that in the delta of the XML's, the "vector" class is removed by Jenkins on Save.
Not sure which if that is making a difference, but i am wondering if anyone has seen a similar problem before where generated DSL doesn't work but saving the configuration through UI without making changes begins to make it work.
Job DSL Version: 1.53
Jenkins Version: 2.0
Any pointers to proceed will be highly appreciated
Regards,
Rahul