CI: run marge-bot pipelines as priority:high

The workflows.rules is copied from mesa/mesa.

When marge is running the CI, we can assign it to a higher priority
queue, allowing non marge jobs to be run after.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1205>
This commit is contained in:
Benjamin Tissoires 2025-05-22 18:03:38 +02:00
parent 87e13ebb8b
commit c4b8cb6423
2 changed files with 88 additions and 10 deletions

View file

@ -56,9 +56,24 @@ include:
workflow: workflow:
rules: rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event" # do not duplicate pipelines on merge pipelines
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_PIPELINE_SOURCE == "push"
when: never when: never
# merge pipeline
- if: &is-merge-attempt $GITLAB_USER_LOGIN == "marge-bot" && $CI_PIPELINE_SOURCE == "merge_request_event"
variables:
FDO_RUNNER_JOB_PRIORITY_TAG_X86_64: priority:high
FDO_RUNNER_JOB_PRIORITY_TAG_X86_64_KVM: priority:high-kvm
FDO_RUNNER_JOB_PRIORITY_TAG_AARCH64: priority:high-aarch64
# post-merge pipeline
- if: &is-post-merge $GITLAB_USER_LOGIN == "marge-bot" && $CI_PIPELINE_SOURCE == "push"
variables:
FDO_RUNNER_JOB_PRIORITY_TAG_X86_64: priority:high
FDO_RUNNER_JOB_PRIORITY_TAG_X86_64_KVM: priority:high-kvm
FDO_RUNNER_JOB_PRIORITY_TAG_AARCH64: priority:high-aarch64
# Pre-merge pipeline
- if: &is-pre-merge $CI_PIPELINE_SOURCE == "merge_request_event"
# Push to a branch on a fork
- if: $CI_COMMIT_BRANCH - if: $CI_COMMIT_BRANCH
stages: stages:
@ -113,6 +128,11 @@ variables:
UDEV_NOT_AVAILABLE: 1 UDEV_NOT_AVAILABLE: 1
GIT_DEPTH: 1 GIT_DEPTH: 1
# Default priority for non-merge pipelines
FDO_RUNNER_JOB_PRIORITY_TAG_X86_64: "" # Empty tags are ignored by gitlab
FDO_RUNNER_JOB_PRIORITY_TAG_X86_64_KVM: kvm
FDO_RUNNER_JOB_PRIORITY_TAG_AARCH64: aarch64
.policy: .policy:
retry: retry:
max: 2 max: 2
@ -134,6 +154,10 @@ variables:
reports: reports:
junit: $MESON_BUILDDIR/*junit*.xml junit: $MESON_BUILDDIR/*junit*.xml
.fdo-runner-tags:
tags:
- $FDO_RUNNER_JOB_PRIORITY_TAG_X86_64
################################################################# #################################################################
# # # #
@ -142,6 +166,8 @@ variables:
################################################################# #################################################################
fail-if-fork-is-not-public: fail-if-fork-is-not-public:
extends:
- .fdo-runner-tags
stage: sanity check stage: sanity check
script: script:
- | - |
@ -162,6 +188,7 @@ fail-if-fork-is-not-public:
check-ci-script: check-ci-script:
extends: extends:
- .fdo.ci-fairy - .fdo.ci-fairy
- .fdo-runner-tags
stage: sanity check stage: sanity check
script: script:
- ci-fairy generate-template --verify && exit 0 || true - ci-fairy generate-template --verify && exit 0 || true
@ -178,6 +205,7 @@ check-ci-script:
check-commit: check-commit:
extends: extends:
- .fdo.ci-fairy - .fdo.ci-fairy
- .fdo-runner-tags
stage: sanity check stage: sanity check
script: script:
- ci-fairy -vv check-commits --junit-xml=results.xml && exit 0 || true - ci-fairy -vv check-commits --junit-xml=results.xml && exit 0 || true
@ -202,6 +230,7 @@ check-commit:
check-whitespace: check-whitespace:
extends: extends:
- .fdo.ci-fairy - .fdo.ci-fairy
- .fdo-runner-tags
stage: sanity check stage: sanity check
script: script:
- .gitlab-ci/whitespace-check.py $(git ls-files) - .gitlab-ci/whitespace-check.py $(git ls-files)
@ -213,6 +242,7 @@ check-whitespace:
pre-commit-hooks: pre-commit-hooks:
extends: extends:
- .fdo.ci-fairy - .fdo.ci-fairy
- .fdo-runner-tags
stage: sanity check stage: sanity check
script: script:
- python3 -m venv venv - python3 -m venv venv
@ -231,6 +261,7 @@ fedora:41@container-prep:
extends: extends:
- .fdo.container-build@fedora - .fdo.container-build@fedora
- .policy - .policy
- .fdo-runner-tags
stage: prep stage: prep
variables: variables:
GIT_STRATEGY: none GIT_STRATEGY: none
@ -242,6 +273,7 @@ fedora:42@container-prep:
extends: extends:
- .fdo.container-build@fedora - .fdo.container-build@fedora
- .policy - .policy
- .fdo-runner-tags
stage: prep stage: prep
variables: variables:
GIT_STRATEGY: none GIT_STRATEGY: none
@ -253,6 +285,7 @@ debian:stable@container-prep:
extends: extends:
- .fdo.container-build@debian - .fdo.container-build@debian
- .policy - .policy
- .fdo-runner-tags
stage: prep stage: prep
variables: variables:
GIT_STRATEGY: none GIT_STRATEGY: none
@ -264,6 +297,7 @@ ubuntu:25.04@container-prep:
extends: extends:
- .fdo.container-build@ubuntu - .fdo.container-build@ubuntu
- .policy - .policy
- .fdo-runner-tags
stage: prep stage: prep
variables: variables:
GIT_STRATEGY: none GIT_STRATEGY: none
@ -275,6 +309,7 @@ arch:rolling@container-prep:
extends: extends:
- .fdo.container-build@arch - .fdo.container-build@arch
- .policy - .policy
- .fdo-runner-tags
stage: prep stage: prep
variables: variables:
GIT_STRATEGY: none GIT_STRATEGY: none
@ -286,6 +321,7 @@ alpine:latest@container-prep:
extends: extends:
- .fdo.container-build@alpine - .fdo.container-build@alpine
- .policy - .policy
- .fdo-runner-tags
stage: prep stage: prep
variables: variables:
GIT_STRATEGY: none GIT_STRATEGY: none
@ -297,8 +333,9 @@ freebsd:14.2@container-prep:
extends: extends:
- .fdo.qemu-build@freebsd - .fdo.qemu-build@freebsd
- .policy - .policy
- .fdo-runner-tags
tags: tags:
- kvm - $FDO_RUNNER_JOB_PRIORITY_TAG_X86_64_KVM
stage: prep stage: prep
variables: variables:
GIT_STRATEGY: none GIT_STRATEGY: none
@ -324,6 +361,7 @@ freebsd:14.2@container-prep:
extends: extends:
- .policy - .policy
- .fdo.ci-fairy - .fdo.ci-fairy
- .fdo-runner-tags
stage: container_clean stage: container_clean
script: script:
# Go to your Profile, Settings, Access Tokens # Go to your Profile, Settings, Access Tokens
@ -419,6 +457,7 @@ freebsd:14.2@container-clean:
extends: extends:
- .policy - .policy
- .default_artifacts - .default_artifacts
- .fdo-runner-tags
stage: build stage: build
script: script:
- .gitlab-ci/meson-build.sh - .gitlab-ci/meson-build.sh
@ -430,7 +469,7 @@ freebsd:14.2@container-clean:
- .policy - .policy
- .default_artifacts - .default_artifacts
tags: tags:
- kvm - $FDO_RUNNER_JOB_PRIORITY_TAG_X86_64_KVM
variables: variables:
MESON_BUILDDIR: build_dir MESON_BUILDDIR: build_dir
VNG_KERNEL: https://gitlab.freedesktop.org/api/v4/projects/libevdev%2Fhid-tools/packages/generic/kernel-x86_64/v6.14/bzImage VNG_KERNEL: https://gitlab.freedesktop.org/api/v4/projects/libevdev%2Fhid-tools/packages/generic/kernel-x86_64/v6.14/bzImage
@ -470,7 +509,7 @@ freebsd:14.2@container-clean:
extends: extends:
- .policy - .policy
tags: tags:
- kvm - $FDO_RUNNER_JOB_PRIORITY_TAG_X86_64_KVM
variables: variables:
MESON_BUILDDIR: build_dir MESON_BUILDDIR: build_dir
script: script:
@ -1063,6 +1102,7 @@ coverity:
extends: extends:
- .fdo.distribution-image@debian - .fdo.distribution-image@debian
- .policy - .policy
- .fdo-runner-tags
stage: build stage: build
variables: variables:
FDO_DISTRIBUTION_VERSION: 'stable' FDO_DISTRIBUTION_VERSION: 'stable'
@ -1204,6 +1244,7 @@ check-merge-request:
extends: extends:
- .fdo.ci-fairy - .fdo.ci-fairy
- .policy - .policy
- .fdo-runner-tags
stage: deploy stage: deploy
script: script:
- ci-fairy check-merge-request --require-allow-collaboration --junit-xml=results.xml - ci-fairy check-merge-request --require-allow-collaboration --junit-xml=results.xml
@ -1220,6 +1261,7 @@ build rpm:
extends: extends:
- .fdo.distribution-image@fedora - .fdo.distribution-image@fedora
- .policy - .policy
- .fdo-runner-tags
stage: deploy stage: deploy
variables: variables:
FDO_DISTRIBUTION_VERSION: '42' FDO_DISTRIBUTION_VERSION: '42'

View file

@ -50,9 +50,24 @@ include:
workflow: workflow:
rules: rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event" # do not duplicate pipelines on merge pipelines
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_PIPELINE_SOURCE == "push"
when: never when: never
# merge pipeline
- if: &is-merge-attempt $GITLAB_USER_LOGIN == "marge-bot" && $CI_PIPELINE_SOURCE == "merge_request_event"
variables:
FDO_RUNNER_JOB_PRIORITY_TAG_X86_64: priority:high
FDO_RUNNER_JOB_PRIORITY_TAG_X86_64_KVM: priority:high-kvm
FDO_RUNNER_JOB_PRIORITY_TAG_AARCH64: priority:high-aarch64
# post-merge pipeline
- if: &is-post-merge $GITLAB_USER_LOGIN == "marge-bot" && $CI_PIPELINE_SOURCE == "push"
variables:
FDO_RUNNER_JOB_PRIORITY_TAG_X86_64: priority:high
FDO_RUNNER_JOB_PRIORITY_TAG_X86_64_KVM: priority:high-kvm
FDO_RUNNER_JOB_PRIORITY_TAG_AARCH64: priority:high-aarch64
# Pre-merge pipeline
- if: &is-pre-merge $CI_PIPELINE_SOURCE == "merge_request_event"
# Push to a branch on a fork
- if: $CI_COMMIT_BRANCH - if: $CI_COMMIT_BRANCH
stages: stages:
@ -101,6 +116,11 @@ variables:
UDEV_NOT_AVAILABLE: 1 UDEV_NOT_AVAILABLE: 1
GIT_DEPTH: 1 GIT_DEPTH: 1
# Default priority for non-merge pipelines
FDO_RUNNER_JOB_PRIORITY_TAG_X86_64: "" # Empty tags are ignored by gitlab
FDO_RUNNER_JOB_PRIORITY_TAG_X86_64_KVM: kvm
FDO_RUNNER_JOB_PRIORITY_TAG_AARCH64: aarch64
.policy: .policy:
retry: retry:
max: 2 max: 2
@ -122,6 +142,10 @@ variables:
reports: reports:
junit: $MESON_BUILDDIR/*junit*.xml junit: $MESON_BUILDDIR/*junit*.xml
.fdo-runner-tags:
tags:
- $FDO_RUNNER_JOB_PRIORITY_TAG_X86_64
################################################################# #################################################################
# # # #
@ -130,6 +154,8 @@ variables:
################################################################# #################################################################
fail-if-fork-is-not-public: fail-if-fork-is-not-public:
extends:
- .fdo-runner-tags
stage: sanity check stage: sanity check
script: script:
- | - |
@ -150,6 +176,7 @@ fail-if-fork-is-not-public:
check-ci-script: check-ci-script:
extends: extends:
- .fdo.ci-fairy - .fdo.ci-fairy
- .fdo-runner-tags
stage: sanity check stage: sanity check
script: script:
- ci-fairy generate-template --verify && exit 0 || true - ci-fairy generate-template --verify && exit 0 || true
@ -166,6 +193,7 @@ check-ci-script:
check-commit: check-commit:
extends: extends:
- .fdo.ci-fairy - .fdo.ci-fairy
- .fdo-runner-tags
stage: sanity check stage: sanity check
script: script:
- ci-fairy -vv check-commits --junit-xml=results.xml && exit 0 || true - ci-fairy -vv check-commits --junit-xml=results.xml && exit 0 || true
@ -190,6 +218,7 @@ check-commit:
check-whitespace: check-whitespace:
extends: extends:
- .fdo.ci-fairy - .fdo.ci-fairy
- .fdo-runner-tags
stage: sanity check stage: sanity check
script: script:
- .gitlab-ci/whitespace-check.py $(git ls-files) - .gitlab-ci/whitespace-check.py $(git ls-files)
@ -201,6 +230,7 @@ check-whitespace:
pre-commit-hooks: pre-commit-hooks:
extends: extends:
- .fdo.ci-fairy - .fdo.ci-fairy
- .fdo-runner-tags
stage: sanity check stage: sanity check
script: script:
- python3 -m venv venv - python3 -m venv venv
@ -225,9 +255,10 @@ pre-commit-hooks:
- .fdo.container-build@{{distro.name}} - .fdo.container-build@{{distro.name}}
{% endif %} {% endif %}
- .policy - .policy
- .fdo-runner-tags
{% if distro.qemu_based %} {% if distro.qemu_based %}
tags: tags:
- kvm - $FDO_RUNNER_JOB_PRIORITY_TAG_X86_64_KVM
{% endif %} {% endif %}
stage: prep stage: prep
variables: variables:
@ -256,6 +287,7 @@ pre-commit-hooks:
extends: extends:
- .policy - .policy
- .fdo.ci-fairy - .fdo.ci-fairy
- .fdo-runner-tags
stage: container_clean stage: container_clean
script: script:
# Go to your Profile, Settings, Access Tokens # Go to your Profile, Settings, Access Tokens
@ -295,6 +327,7 @@ pre-commit-hooks:
extends: extends:
- .policy - .policy
- .default_artifacts - .default_artifacts
- .fdo-runner-tags
stage: build stage: build
script: script:
- .gitlab-ci/meson-build.sh - .gitlab-ci/meson-build.sh
@ -306,7 +339,7 @@ pre-commit-hooks:
- .policy - .policy
- .default_artifacts - .default_artifacts
tags: tags:
- kvm - $FDO_RUNNER_JOB_PRIORITY_TAG_X86_64_KVM
variables: variables:
MESON_BUILDDIR: build_dir MESON_BUILDDIR: build_dir
VNG_KERNEL: {{ vng.kernel }} VNG_KERNEL: {{ vng.kernel }}
@ -346,7 +379,7 @@ pre-commit-hooks:
extends: extends:
- .policy - .policy
tags: tags:
- kvm - $FDO_RUNNER_JOB_PRIORITY_TAG_X86_64_KVM
variables: variables:
MESON_BUILDDIR: build_dir MESON_BUILDDIR: build_dir
script: script:
@ -606,6 +639,7 @@ coverity:
extends: extends:
- .fdo.distribution-image@debian - .fdo.distribution-image@debian
- .policy - .policy
- .fdo-runner-tags
stage: build stage: build
variables: variables:
FDO_DISTRIBUTION_VERSION: 'stable' FDO_DISTRIBUTION_VERSION: 'stable'
@ -702,6 +736,7 @@ check-merge-request:
extends: extends:
- .fdo.ci-fairy - .fdo.ci-fairy
- .policy - .policy
- .fdo-runner-tags
stage: deploy stage: deploy
script: script:
- ci-fairy check-merge-request --require-allow-collaboration --junit-xml=results.xml - ci-fairy check-merge-request --require-allow-collaboration --junit-xml=results.xml
@ -720,6 +755,7 @@ build rpm:
extends: extends:
- .fdo.distribution-image@fedora - .fdo.distribution-image@fedora
- .policy - .policy
- .fdo-runner-tags
stage: deploy stage: deploy
variables: variables:
FDO_DISTRIBUTION_VERSION: '{{version}}' FDO_DISTRIBUTION_VERSION: '{{version}}'