Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-36890

PR's do not meet the criteria when Include Branches is set

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      When a multibranch pipeline is created with Bitbucket, if the Include Branches Filter is changed from the default * to a different value, PR's are not being built.

      My understanding is that PR's should be built regardless of the branch filters specified.

      Steps to reproduce:

      1. Create a new Multibranch Pipeline
      2. Choose Bibucket as the Source and specify the repo info as well as an Include Branches
        1. For example I specified: "master* PR*" to build the master + PR branches but nothing else
      3. Create a PR in the Bitbucket run the Branch Indexing
      4. Jenkins will not pick up the PR
      5. Modify the Include Branches back to the default of just a star * and Run Branch Indexing
      6. Jenkins will correctly pick up the PR
      7. If you modify it back to "master* PR*" Jenkins will again remove the PR job because it does not meet the criteria

        Attachments

          Issue Links

            Activity

            Hide
            mcrooney mcrooney added a comment -

            We are also seeing this. There doesn't appear to be any help text for those include/exclude fields so I'm not sure how this is supposed to work. We'd also like something like "master PR*". Antonio Muñiz, should this be working or are we specifying this pattern incorrectly?

            Show
            mcrooney mcrooney added a comment - We are also seeing this. There doesn't appear to be any help text for those include/exclude fields so I'm not sure how this is supposed to work. We'd also like something like "master PR*". Antonio Muñiz , should this be working or are we specifying this pattern incorrectly?
            Hide
            jamesdumay James Dumay added a comment -

            Stephen Connolly 99% sure this would be fixed with traits?

            Show
            jamesdumay James Dumay added a comment - Stephen Connolly 99% sure this would be fixed with traits?
            Hide
            stephenconnolly Stephen Connolly added a comment -

            My understanding is that PR's should be built regardless of the branch filters specified.

            Well that is an incorrect understanding. Branch filters refer only to the SCMHead.getName(). So pull requests will have names like PR-xxx (or PR-xxx-merge and PR-xxx-head)

            Now if this is a bug in WildcardSCMHeadFilterTrait.java#L111-L128 that means it doesn't correctly parse something like master* PR* as matching both master* and PR* then we should fix that, but otherwise I am inclined to suggest Wont Fix

            WDYT? James Dumay

            Show
            stephenconnolly Stephen Connolly added a comment - My understanding is that PR's should be built  regardless  of the branch filters specified. Well that is an incorrect understanding. Branch filters refer only to the SCMHead.getName() . So pull requests will have names like PR-xxx  (or PR-xxx-merge  and PR-xxx-head ) Now if this is a bug in WildcardSCMHeadFilterTrait.java#L111-L128  that means it doesn't correctly parse something like master* PR*  as matching both master*  and PR* then we should fix that, but otherwise I am inclined to suggest Wont Fix WDYT? James Dumay
            Hide
            stephenconnolly Stephen Connolly added a comment -

            Fixed in 2.2.0+

            Show
            stephenconnolly Stephen Connolly added a comment - Fixed in 2.2.0+
            Hide
            stephenconnolly Stephen Connolly added a comment -

            To clarify, the fix is that include/exclude now works on the SCMHead.getName() which is predictable.

            Previously, PRs were being filtered based on the name of the PR's origin branch which is effectively useless as a filter and renders the ability to filter completely meaningless

            Show
            stephenconnolly Stephen Connolly added a comment - To clarify, the fix is that include/exclude now works on the SCMHead.getName() which is predictable. Previously, PRs were being filtered based on the name of the PR's origin branch which is effectively useless as a filter and renders the ability to filter completely meaningless

              People

              • Assignee:
                cloudbees CloudBees Inc.
                Reporter:
                issc29 Isaac Cohen
              • Votes:
                3 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: