-
Notifications
You must be signed in to change notification settings - Fork 619
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
Labeling an open MR triggers a build #871
Comments
@R00GER are you still having this issue as well? |
I have same problem. |
@omehegan not anymore |
I have a repo in Gitlab and several Jenkins jobs called by hooks on Push Events, Tag Push Events and MR Events. In Jenkins jobs gitlab-plugin settings of build cause are "Open MR" and "Rebuild on push to source branch". |
Something that might be of help investigating this issue: the gitlab repository that triggers the job is actually not the one being built by Jenkins. Maybe that's why only some people are experiencing this issue. |
I am also seeing this issue when removing "WIP:" from an MR. In all the "re-fires," the git commit hash is the same as the job that succeeded, and thus prompted me to remove the "WIP:" label |
|
Update: I experienced these issues too, but after checking the comment by @1100101:
I had a test pipeline configured, and this was the cause. With a "real" set up, everything works as expected. Also, see my PR about forcing builds with added labels: #903 |
We also experience this issue, when only the mergerequest description changes or the mergerequest is labeled/assigned to a milestone a new build is triggered. |
@fschloesser: And you're actually building the same branch that triggers the build? By checking out that branch with the SCM/Git plugin? |
@anton-johansson yes, though we do the additional behaviour "merge before build" |
@anton-johansson We are also building the branch that triggers the build. |
Another data point: new builds are getting triggered when the "assigned" is changed on an MR, or even the title of the MR is changed. |
Also seeing this when adding or modifying approvers on a PR (in additional to assigning or changing the title) in 1.5.11. |
I'm also seeing this issue: In response to questions:
Yes, branches to build is specified as |
We have the same issue but I think this is because we have a merge before build strategy in our job. |
We have the same issue, and also our MRs are triggered on Assignee field changing, on Description or Summary fields changing. |
In ATLAS collaboration (CERN) we have similar issues. We need a job triggered when git push to source branch of opened MR occurs, or when MR is opened. Therefore in GitLab webhook options we set the Trigger on "Merge request event" and in Jenkins (v. 2.176.1) freestyle job for gitlab plugin (v. 1.5.12) we enabled triggers: "Opened Merge Request Events", "Rebuild open Merge Requests on push to source branch". When a job is triggered on push to source branch then there is a period of ~5 - 10 minutes - during the period when the plugin runs git commands - when any MR event (such as changing description, label) triggers a duplicate job. These duplicate jobs are triggered quite frequently because it is not a rare case when developers change description, labels, comments in few minutes after the push to repository and they create a lot of confusion, such as corrupted pipeline status in GitLab. |
You can avoid that by setting Jenkins job "Do not allow concurrent builds" and to reduce number of reruns "Cancel pending merge request builds on update". |
Issue
When making minor changes to an open merge request that should not affect the result of the Jenkins run, a rebuild is triggered still.
This includes adding/removing a label, setting/removing a milestone, as well as editing the description (or title) of the MR.
Note: This issue is closely related to issue #696, which was closed as a duplicate to #633, which did not fix the issues described here (or in #696).
Context
Logs & Traces
Here's a log extract from Jenkins.
The relevant part is the
changes
section. In this case, I only changed the Milestone assignment for the MR:Here is
changes
section after a new label has been added to an MR:Problem description
In Gitlab, a webhook is configured to be triggered on
Merge Request
andComment
.Expected:
Jenkins starts a new build job when new commits to the MR branch occur, or when someone triggers the Jenkins manually via a special comment in Gitlab.
Actual:
Jenkins triggers a job when changes are made to the MR that are not relevant to the Jenkins build:
label changes, milestone changes, changes to the description of the MR, changes to the number of approvers (Gitlab EE).
The text was updated successfully, but these errors were encountered: