ci: automatically remove ok-to-test and set it when queuing a PR

The `ok-to-test` label currently needs to be removed and re-added when a
PR is rebased for re-queuing.

It should be possible to automate this, by removing the `ok-to-test`
label when a PR gets queued. It can automatically be added again when
the PR has embarked the merge train.

Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
Niels de Vos 2022-11-09 14:29:20 +01:00 committed by Humble Devassy Chirammal
parent 628263e9b1
commit 2518c39956

View File

@ -43,6 +43,15 @@ queue_rules:
- "status-success=ci/centos/jjb-validate" - "status-success=ci/centos/jjb-validate"
pull_request_rules: pull_request_rules:
- name: start CI jobs for queued PR
conditions:
- base~=^(devel)|(release-.+)$
- "check-pending=Queue: Embarked in merge train"
actions:
label:
add:
- ok-to-test
- name: remove outdated approvals - name: remove outdated approvals
conditions: conditions:
- base~=^(devel)|(release-.+)$ - base~=^(devel)|(release-.+)$
@ -50,6 +59,10 @@ pull_request_rules:
dismiss_reviews: dismiss_reviews:
approved: true approved: true
changes_requested: false changes_requested: false
label:
remove:
- ok-to-test
- name: ask to resolve conflict - name: ask to resolve conflict
conditions: conditions:
- conflict - conflict
@ -60,6 +73,10 @@ pull_request_rules:
message: "This pull request now has conflicts with the target branch. message: "This pull request now has conflicts with the target branch.
Could you please resolve conflicts and force push the corrected Could you please resolve conflicts and force push the corrected
changes? 🙏" changes? 🙏"
label:
remove:
- ok-to-test
- name: update dependencies by dependabot (skip commitlint) - name: update dependencies by dependabot (skip commitlint)
conditions: conditions:
- author=dependabot[bot] - author=dependabot[bot]
@ -91,6 +108,9 @@ pull_request_rules:
queue: queue:
name: default name: default
delete_head_branch: {} delete_head_branch: {}
label:
remove:
- ok-to-test
- name: dismiss review of merged pull request - name: dismiss review of merged pull request
conditions: conditions:
@ -98,6 +118,9 @@ pull_request_rules:
- merged - merged
actions: actions:
dismiss_reviews: {} dismiss_reviews: {}
label:
remove:
- ok-to-test
- name: automatic merge - name: automatic merge
conditions: conditions:
@ -130,6 +153,9 @@ pull_request_rules:
queue: queue:
name: default name: default
delete_head_branch: {} delete_head_branch: {}
label:
remove:
- ok-to-test
- name: automatic merge PR having ready-to-merge label - name: automatic merge PR having ready-to-merge label
conditions: conditions:
@ -161,6 +187,10 @@ pull_request_rules:
queue: queue:
name: default name: default
delete_head_branch: {} delete_head_branch: {}
label:
remove:
- ok-to-test
- name: backport patches to release-v3.6 branch - name: backport patches to release-v3.6 branch
conditions: conditions:
- base=devel - base=devel
@ -169,6 +199,7 @@ pull_request_rules:
backport: backport:
branches: branches:
- release-v3.6 - release-v3.6
- name: backport patches to release-v3.7 branch - name: backport patches to release-v3.7 branch
conditions: conditions:
- base=devel - base=devel
@ -177,6 +208,7 @@ pull_request_rules:
backport: backport:
branches: branches:
- release-v3.7 - release-v3.7
- name: remove outdated approvals on ci/centos - name: remove outdated approvals on ci/centos
conditions: conditions:
- base=ci/centos - base=ci/centos
@ -184,6 +216,7 @@ pull_request_rules:
dismiss_reviews: dismiss_reviews:
approved: true approved: true
changes_requested: false changes_requested: false
- name: automatic merge on ci/centos - name: automatic merge on ci/centos
conditions: conditions:
- label!=DNM - label!=DNM
@ -199,6 +232,7 @@ pull_request_rules:
queue: queue:
name: default name: default
delete_head_branch: {} delete_head_branch: {}
- name: automatic merge PR having ready-to-merge label on ci/centos - name: automatic merge PR having ready-to-merge label on ci/centos
conditions: conditions:
- label!=DNM - label!=DNM
@ -213,6 +247,10 @@ pull_request_rules:
queue: queue:
name: default name: default
delete_head_branch: {} delete_head_branch: {}
label:
remove:
- ok-to-test
## ##
## Automatically set/remove labels ## Automatically set/remove labels
## ##