Skip to content

Commit

Permalink
ci: automatically remove ok-to-test and set it when queuing a PR
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
nixpanic authored and humblec committed Nov 10, 2022
1 parent 628263e commit 2518c39
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,26 @@ queue_rules:
- "status-success=ci/centos/jjb-validate"

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
conditions:
- base~=^(devel)|(release-.+)$
actions:
dismiss_reviews:
approved: true
changes_requested: false
label:
remove:
- ok-to-test

- name: ask to resolve conflict
conditions:
- conflict
Expand All @@ -60,6 +73,10 @@ pull_request_rules:
message: "This pull request now has conflicts with the target branch.
Could you please resolve conflicts and force push the corrected
changes? 🙏"
label:
remove:
- ok-to-test

- name: update dependencies by dependabot (skip commitlint)
conditions:
- author=dependabot[bot]
Expand Down Expand Up @@ -91,13 +108,19 @@ pull_request_rules:
queue:
name: default
delete_head_branch: {}
label:
remove:
- ok-to-test

- name: dismiss review of merged pull request
conditions:
- base~=^(devel)|(release-.+)$
- merged
actions:
dismiss_reviews: {}
label:
remove:
- ok-to-test

- name: automatic merge
conditions:
Expand Down Expand Up @@ -130,6 +153,9 @@ pull_request_rules:
queue:
name: default
delete_head_branch: {}
label:
remove:
- ok-to-test

- name: automatic merge PR having ready-to-merge label
conditions:
Expand Down Expand Up @@ -161,6 +187,10 @@ pull_request_rules:
queue:
name: default
delete_head_branch: {}
label:
remove:
- ok-to-test

- name: backport patches to release-v3.6 branch
conditions:
- base=devel
Expand All @@ -169,6 +199,7 @@ pull_request_rules:
backport:
branches:
- release-v3.6

- name: backport patches to release-v3.7 branch
conditions:
- base=devel
Expand All @@ -177,13 +208,15 @@ pull_request_rules:
backport:
branches:
- release-v3.7

- name: remove outdated approvals on ci/centos
conditions:
- base=ci/centos
actions:
dismiss_reviews:
approved: true
changes_requested: false

- name: automatic merge on ci/centos
conditions:
- label!=DNM
Expand All @@ -199,6 +232,7 @@ pull_request_rules:
queue:
name: default
delete_head_branch: {}

- name: automatic merge PR having ready-to-merge label on ci/centos
conditions:
- label!=DNM
Expand All @@ -213,6 +247,10 @@ pull_request_rules:
queue:
name: default
delete_head_branch: {}
label:
remove:
- ok-to-test

##
## Automatically set/remove labels
##
Expand Down

0 comments on commit 2518c39

Please sign in to comment.