Skip to content

Support job priority

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Problem to solve

Sometimes there can be so many jobs that there is a long queue and there needs to be the ability to prioritize certain pipelines' jobs so that they can skip the queue and run before other pipelines' jobs.

Users want to be able to identify the priority of jobs.

Intended users

User experience goal

Trying to solve the problem is long Runner queues, having the ability to prioritize certain jobs over others is important to some users.

Proposal

What if we introduce a new yaml keyword priority and allow for an integer. A sample config would be

job1: 
  script: echo 'hello world'
  priority: 1

job2:
  script: echo 'job2'
  priority: 2

Then when we query for pending builds in the register job service we could order the builds by priority. Where lower numbers are higher priority and all jobs start with a certain default priority if not specified.

That would only work for specific (project) runners, group runners.

With regards to where to store the priority. Once the ci_pending_builds migration of the queue is completed it will be denormalized in ci_pending_builds so it could be initially stored in the build metadata table.

Acceptance criteria would be to initially support:

  1. Private runners
  2. Project-level

Permissions and Security

I suspect to avoid abusing this power, it should be restricted to Owners, Maintainers and Admins.

Documentation

This will require new documentation.

Available Tier

  • Free
Edited by 🤖 GitLab Bot 🤖