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

Branch Discovery Strategy: "Only branches that also filed as PRs" excludes "master" as well

      Branch Discovery Strategy: "Only branches that also filed as PRs" excludes "master" as well.

      This looks expected in first look but this behaviour makes this option mostly unusable practically.

       

      As a user, I always expect to see main branch ("master") discovered.

       

      Is there any workaround to this in current implementations? I want to only discover branches filed as PRs + main branch ("master").

          [JENKINS-66102] Branch Discovery Strategy: "Only branches that also filed as PRs" excludes "master" as well

          Perhaps you can get the result you want, by adding another GitHub branch source in the same multibranch project. Make both branch sources use the same repository. In the second branch source, add the "Discover branches" and "Filter by name (with wildcards)" properties and make the latter include only "master". This would be somewhat cumbersome to maintain though, because you'd have to duplicate all other properties of the branch source as well.

          If one could let the GitHub Branch Source plugin discover all branches, but then use the Basic Branch Build Strategies Plugin to select only "master" and branches filed as PRs, then the properties would not need to be duplicated. Unfortunately, Basic Branch Build Strategies Plugin does not implement a "Branches that are also filed as PRs" strategy.

          Kalle Niemitalo added a comment - Perhaps you can get the result you want, by adding another GitHub branch source in the same multibranch project. Make both branch sources use the same repository. In the second branch source, add the "Discover branches" and "Filter by name (with wildcards)" properties and make the latter include only "master". This would be somewhat cumbersome to maintain though, because you'd have to duplicate all other properties of the branch source as well. If one could let the GitHub Branch Source plugin discover all branches, but then use the Basic Branch Build Strategies Plugin to select only "master" and branches filed as PRs, then the properties would not need to be duplicated. Unfortunately, Basic Branch Build Strategies Plugin does not implement a "Branches that are also filed as PRs" strategy.

          kumar gaurav added a comment -

           

          It works with two branch-source-plugin configuration however I see this warning.. So this is not going to be supported in future:

          This organization folder has a legacy configuration and does not have a single repository source. The ability to have an organization folders with multiple repository sources may be removed in a future release of the Branch API plugin.
          
          

          kumar gaurav added a comment -   It works with two branch-source-plugin configuration however I see this warning.. So this is not going to be supported in future: This organization folder has a legacy configuration and does not have a single repository source. The ability to have an organization folders with multiple repository sources may be removed in a future release of the Branch API plugin.

            Unassigned Unassigned
            gaurav517 kumar gaurav
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: