Option to skip pull requests during branch & pullrequests discovery#9
Option to skip pull requests during branch & pullrequests discovery#9szhem wants to merge 1 commit intojenkinsci:masterfrom
Conversation
|
I'd like to implement something similar to this: jenkinsci/github-branch-source-plugin#60 which would cover the use case pointed in this PR. |
|
Created JENKINS-36283 for it. |
|
Any chance for this to land in a release? Double builds caused by PRs are a blocker here. Or if you had instructions for building an hpi that includes this PR, that could be awesome, too. |
|
One workaround I've used is to add this regex for automatic branch triggering |
|
I though a little regarding this PR, and it seems that it would be better to properly name discovered PR-s and exclude them by means of excludes field. Currently it's hardly possible to exclude PR-s because they are registered with the branch name that we don't usually want to exclude, but the name of the job still remains not very informative, like PR-XX. What do you think regarding
In that case we will be able to exclude PR-s from discovering and building (second point) and if we don't like to do it, the name of the PR would be a little bit more informative. If there will be a chance that these improvements can be included into some release I can create two separate PR-s for these features. What do you think? |
|
Right now I don't have a use case for building PRs, as opposed to straight branches, but if I did, a more informative job name for PRs would be handy. |
No. It is possible to modify the code to apply the exclusion to job names (PR-XX) instead of forked branch names (which is a bug actually). At any rate, as I said before in this PR, I want to have something similar to jenkinsci/github-branch-source-plugin#60. |
|
+1, also desperately in need for an option to disable the automatic PR builds. @amuniz I suspect that #25 is exactly what you mean when you say "something similar to jenkinsci/github-branch-source-plugin#60"? |
|
@wbagdon I couldn't get your workaround with The issue seems to be that you can't exlude |
|
Honestly, I found absolutely no way to build only one of them.
So it will always build twice?! Or am I missing something? |
|
@tknerr I'm using verison 1.5 of the plugin so my branches appear as such under the repo folder I specify the regex in the Bitbucket branch folder like this |
|
@wbagdon is this ("Automatic branch project triggering") a configuration option of bitbucket-branch-source-plugin in version 1.5? I'm using Jenkins 2.19.1 LTS + bitbucket-branch-source-plugin v1.8 and it looks like this: Still the |
|
I can confirm (and have mentioned it earlier), than PRs are registered under branch names, so cannot be excluded by means of regexps by now. |
|
@tknerr this is a configuration item of "Bitbucket Team/Project" jobs |
|
@wbagdon weird, I don't see that last item. The last one have is "Pipeline Libraries". This is Jenkins 2.19.1 LTS... |
|
@tknerr make sure you have |
|
@amuniz I have I'm using JobDSL to set up a Btw: one thing I'm missing compared to the |
|
P.S. created JENKINS-39982 for the latter |
|
For BitBucket team project, you may want to refer to PR: #27 |
|
Superseded by #53 |
…bPropertyImpl.DescriptorImpl.newInstance JobPropertyDescriptor.newInstance can return null

Currently bitbucket source plugin when using with multibranch pipeline can create jobs for pull requests and target branches. In that case the same revision will be built twice - for the first time for the source branch of pull request, and for the second time - for the pull request itself.
This pullrequest adds an option to skip pull request discovery.