-
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
Build only for merge requests, not for regular pushes #49
Comments
I haven't been able to reproduce the issue with duplicate builds on push. I have test with
In my config I have selected to only build the "master" branch in the "Filter branches" option. I don't know why you don't get a list of branches in the filter branch config option. Have you tried to look at Jenkins log file to see if it give you any hints regarding the missing branches? |
It works as supposed out of the box, just disable the build on push. |
I also have this problem. I would not like to disable build on push because i want to build all branches, but if a branch is on a merge request, do not duplicate the build (just build the MR event instead). |
I have a similar problem - even when I uncheck the "Build when changes are pushed to gitlab" it is still building on every push... I tried checking it and the uncheck the "Build on Merge Request Events" and the "Build on Push Events" But it still trigger a build. |
Duplicate of #210 |
Is the behavior described here still expected/intended? When MR trigger and push trigger are both enabled, a push to an open MR should trigger two builds (one merged, one not merged)? This "duplication" of the builds doesn't bother me, but they both seem to update the MR pipeline status in GitLab, so there is a race condition when the builds are run in parallel. If one fails and the other succeeds, the result is confusing. |
@starthal yes I think it is expected. IIRC they are technically two different commits so the plugin doesn't have any way to discern that they are or could be the same effective state of the repo. |
@omehegan Thanks. Is there a way to prevent the non-merged build from updating the MR status in GitLab? Or to give different "build names" to the merged and non-merged builds so GitLab treats them as separate "pipelines"? By "build name" I mean this field: |
@starthal if it was a Pipeline job, you could use some logic to look at the gitlabActionType env var and only update status for one or the other type. |
[FIXED JENKINS-24592] Support HTTP proxies
We have two jobs on our servers:
master
, so we always see if the main branch passes the build and have a nice history of code metricsCurrently, the merge-request job also builds the branches on normal pushes, so on every push to
master
, two builds are scheduled. We'd like the merge-request job to only build when pushing to a branch with an open merge request, i.e. iff the build comment will be of the form "GitLab Merge Request #xx : source-branch => master ".Is this possible? If I disable "Build on Push Events", subsequent pushes to open merge requests are not built. The "Filter branches" box also looks promising, we could simply exclude master, but the list is empty for me, even after a few builds.
The text was updated successfully, but these errors were encountered: