As a development team with github organization account and with limited CI servers bandwidth we would like to have commits on production branches to be built before the intermediate commits to personal development branches.
      In addition some repositories are more critical then the others, so builds for that repositories need to be prioritized.

      In Jenkins 1.x I could manage this with Priority Sorter Plugin in combination with Views and Jobs properties.
      I could not find a way to do it for the organization folder with pipeline as code.

      For example for Git Flow I need branches that match 'hotfix/.' have more priority than 'master' branch which is above 'release/.' branches which is above Dev branch and above all the other branches.
      One more job type in Jenkins 2.0 is Pull Request. There might be Pull request to hot fix branches/to master/to release/to feature development branches, while there is no way to determine this. It makes sense to prioritize it by PR title.

          [JENKINS-33588] Branches and Repositories prioritization

          The plugin primarily work on a Job. I guess that different repos are build by different Jobs so that should not be a problem for you.

          Making prioritization in branch would (probably) require some new extension to the plugin - or as a work around you could have different Jobs for different branches and that would solve the issue.

          Magnus Sandberg added a comment - The plugin primarily work on a Job. I guess that different repos are build by different Jobs so that should not be a problem for you. Making prioritization in branch would (probably) require some new extension to the plugin - or as a work around you could have different Jobs for different branches and that would solve the issue.

          I expected that for repos prioritization I could use Jobs included in Folder strategy, but in my installation of Jenkins 2.0 with several repos:
          if I go to Job Priorities > JobGroup > Jobs included in Folder, Apply to Jobs in Folder list is empty.

          Yet I see no other strict way to priorities repos jobs...

          Alexander Vorobiev added a comment - I expected that for repos prioritization I could use Jobs included in Folder strategy, but in my installation of Jenkins 2.0 with several repos: if I go to Job Priorities > JobGroup > Jobs included in Folder, Apply to Jobs in Folder list is empty. Yet I see no other strict way to priorities repos jobs...

          On the Priority Sorter Configuration you will not get the current list of Jobs - but the sorter will apply the priority to any Job it find in the specified Folder.

          Magnus Sandberg added a comment - On the Priority Sorter Configuration you will not get the current list of Jobs - but the sorter will apply the priority to any Job it find in the specified Folder.

          Agree, but I assume that 'Apply to Jobs in Folder' should list available folders. The problem is that list of folder is empty, so I cannot specify a folder.
          I did not expect jobs there, sorry for ambiguous explanation.

          Alexander Vorobiev added a comment - Agree, but I assume that 'Apply to Jobs in Folder' should list available folders. The problem is that list of folder is empty, so I cannot specify a folder. I did not expect jobs there, sorry for ambiguous explanation.

          The Folder list should not be empty if you have Folders in your setup.

          When it comes to new ways to prioritize jobs it is as easy as adding a new implementation of the correct extension point (https://github.com/jenkinsci/priority-sorter-plugin/blob/master/src/main/java/jenkins/advancedqueue/priority/PriorityStrategy.java).

          I have no time to work on additions to the plugin right now but I'd be happy to review any pull request.

          Magnus Sandberg added a comment - The Folder list should not be empty if you have Folders in your setup. When it comes to new ways to prioritize jobs it is as easy as adding a new implementation of the correct extension point ( https://github.com/jenkinsci/priority-sorter-plugin/blob/master/src/main/java/jenkins/advancedqueue/priority/PriorityStrategy.java ). I have no time to work on additions to the plugin right now but I'd be happy to review any pull request.

          Winarto Zhao added a comment -

          emsa23, Could you give me example how I can prioritize release branch over master branch over feature branch on single repo? All of them are within a single repository and single folder.

          Winarto Zhao added a comment - emsa23 , Could you give me example how I can prioritize release branch over master branch over feature branch on single repo? All of them are within a single repository and single folder.

          Benjamin Kihm added a comment -

          In our organisation we have many multi-pipeline jobs and each of them have a master and some release branches which we want to queueing faster than development branches.

          The existing workaround to create for each master/release branch a different job will blow up our jenkins with many additional workspaces/views for the jobs.

          Is there a plan to add this feature on branch level soon?

          Thanks for future replies.

          Benjamin Kihm added a comment - In our organisation we have many multi-pipeline jobs and each of them have a master and some release branches which we want to queueing faster than development branches. The existing workaround to create for each master/release branch a different job will blow up our jenkins with many additional workspaces/views for the jobs. Is there a plan to add this feature on branch level soon? Thanks for future replies.

          Benjamin Kihm added a comment - - edited

          I think I managed a possible solution with the existing plugin. I created three new views which contain all master/release/all Jobs by a regular expression. With this three groups I managed to prioritize release > master > all jobs  by group priority. Seems to work for us.

           

          vorobievalex: I think you can also create another Jenkins view with only hotfix in it and give it a higher prio than release branches.

          Benjamin Kihm added a comment - - edited I think I managed a possible solution with the existing plugin. I created three new views which contain all master/release/all Jobs by a regular expression. With this three groups I managed to prioritize release > master > all jobs  by group priority. Seems to work for us.   vorobievalex : I think you can also create another Jenkins view with only hotfix in it and give it a higher prio than release branches.

            Unassigned Unassigned
            vorobievalex Alexander Vorobiev
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: