-
Notifications
You must be signed in to change notification settings - Fork 618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GitLab trigger will not allow the same commit to be built twice. #958
Comments
Hello did you try |
No. However, this would be of no use to me. |
Hi. I see similar behavior (Jenkins 2.186, Gitlab Plugin 1.5.13, GitLab CE 12.2.5, Groovy-pipeline, Merge method: Merge commit): $class: 'GitLabPushTrigger',
branchFilterType: 'All',
triggerOnPush: false,
triggerOnMergeRequest: true,
triggerOnAcceptedMergeRequest: true,
triggerOpenMergeRequestOnPush: "both",
triggerOnNoteRequest: true,
noteRegex: "Jenkins please retry a build" in the jenkins log when I've merged (i.e. accepted) Merge Request: FINE com.dabsquared.gitlabjenkins.webhook.build.PushBuildAction
FINE com.dabsquared.gitlabjenkins.webhook.build.MergeRequestBuildAction
// "action" : "merge"
INFO com.dabsquared.gitlabjenkins.trigger.handler.merge.MergeRequestHookTriggerHandlerImpl isLastCommitNotYetBuild
// Last commit in Merge Request has already been built in build #320 IMHO, the problem may be in isLastCommitNotYetBuild, how to disable it? Perhaps the similar issues: if(env?.gitlabActionType == "PUSH" && env.gitlabBranch != "master") {
currentBuild.result = 'NOT_BUILT'
return
} or you can filter all source branches and keep only $class: 'GitLabPushTrigger',
branchFilterType: 'NameBasedFilter', // NameBasedFilter, All or RegexBasedFilter
includeBranchesSpec: "master",
excludeBranchesSpec: "",
triggerOnPush: true,
triggerOnMergeRequest: true, |
This parameter allows overriding the check isLastCommitNotYetBuild in MergeRequestHookTriggerHandlerImpl. This commit fixes issue jenkinsci#636 and jenkinsci#734, probably also jenkinsci#958.
Hi team, is the Merge Request #951 fix the issue and we can close this now? |
Issue
Context
Logs & Traces
None available (job does not trigger)
Problem description
I have a job set up to build merge requests. It should build under the following circumstances:
The primary issue is that merged MRs are not causing a build to trigger, unless a secondary job is created purely for that purpose. The GitLab hook is fired and Jenkins responds with a 200 response, but no build occurs.
Further digging and googling suggests that this is due to the GitLab trigger not allowing a job to be triggered twice for the same commit (which is effectively the case when an opened MR is built and then the MR is merged). This is supported by the fact that re-sending the webhook for either the opening of the merge request or the merging of it gives similar results - a 200 response from Jenkins, but no job triggered.
The text was updated successfully, but these errors were encountered: