change(merge): Require 2 reviews for PRs with an extra-reviews label (#7158)

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
teor 2023-07-11 09:34:15 +10:00 committed by GitHub
parent da07b11f1b
commit d3cc91e594
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 77 additions and 39 deletions

71
.github/mergify.yml vendored
View File

@ -29,34 +29,67 @@ queue_rules:
conditions: conditions:
- base=main - base=main
# These rules are checked in order, the first one to be satisfied applies
pull_request_rules: pull_request_rules:
- name: move to urgent queue when CI passes with 1 review and not WIP targeting main - name: move to urgent queue when CI passes with multiple reviews
conditions: conditions:
# This queue handles a PR if: # This queue handles a PR if it:
# - it targets main # has multiple approving reviewers
# - is not in draft - "#approved-reviews-by>=2"
# - does not include the do-not-merge label # is labeled with Critical priority
# - is labeled with Critical priority
- base=main
- -draft
- label!=do-not-merge
- 'label~=^P-Critical' - 'label~=^P-Critical'
# and satisfies the standard merge conditions:
# targets main
- base=main
# is not in draft
- -draft
# does not include the do-not-merge label
- label!=do-not-merge
actions: actions:
queue: queue:
name: urgent name: urgent
method: squash method: squash
- name: move to batched queue when CI passes with 1 review and not WIP targeting main - name: move to urgent queue when CI passes with 1 review
conditions: conditions:
# This queue handles a PR if: # This queue handles a PR if it:
# - it targets main # has at least one approving reviewer (branch protection rule)
# - is not in draft # does not need extra reviews
# - does not include the do-not-merge label - 'label!=extra-reviews'
# - is labeled with any other priority except Critical, or does not have a priority label, # is labeled with Critical priority
# including automated dependabot PRs. - 'label~=^P-Critical'
# # and satisfies the standard merge conditions:
# We don't need to check priority labels here, because the rules are evaluated in order: - base=main
# https://docs.mergify.com/configuration/#pull-request-rules - -draft
- label!=do-not-merge
actions:
queue:
name: urgent
method: squash
- name: move to batched queue when CI passes with multiple reviews
conditions:
# This queue handles a PR if it:
# has multiple approving reviewers
- "#approved-reviews-by>=2"
# is labeled with any other priority (rules are checked in order)
# and satisfies the standard merge conditions:
- base=main
- -draft
- label!=do-not-merge
actions:
queue:
name: batched
method: squash
- name: move to batched queue when CI passes with 1 review
conditions:
# This queue handles a PR if it:
# has at least one approving reviewer (branch protection rule)
# does not need extra reviews
- 'label!=extra-reviews'
# is labeled with any other priority (rules are checked in order)
# and satisfies the standard merge conditions:
- base=main - base=main
- -draft - -draft
- label!=do-not-merge - label!=do-not-merge

View File

@ -11,34 +11,33 @@ autolabeler:
- '/secur/i' - '/secur/i'
title: title:
- '/secur/i' - '/secur/i'
- label: 'C-removed' - '/crash/i'
branch: - '/destr/i'
- '/remov/i' - '/unsafe/i'
title:
- '/remov/i'
- label: 'C-deprecated' - label: 'C-deprecated'
branch: branch:
- '/deprecat/i' - '/deprecat/i'
title: title:
- '/deprecat/i' - '/deprecat/i'
- label: 'extra-reviews'
branch:
- '/remov/i'
- '/deprecat/i'
title:
- '/remov/i'
- '/deprecat/i'
- '/crash/i'
- '/destr/i'
- '/unsafe/i'
- label: 'C-feature' - label: 'C-feature'
branch: branch:
- '/add/i'
- '/feat/i' - '/feat/i'
title: title:
- '/add/i'
- '/feat/i' - '/feat/i'
- label: 'C-enhancement'
branch:
- '/chang/i'
title:
- '/chang/i'
- label: 'C-bug' - label: 'C-bug'
branch: branch:
- '/fix/i'
- '/bug/i' - '/bug/i'
title: title:
- '/fix/i'
- '/bug/i' - '/bug/i'
# Changes that are almost always trivial for users # Changes that are almost always trivial for users
- label: 'C-trivial' - label: 'C-trivial'
@ -46,16 +45,24 @@ autolabeler:
- '/clean/i' - '/clean/i'
- '/chore/i' - '/chore/i'
- '/clippy/i' - '/clippy/i'
- '/test/i'
title: title:
- '/clean/i' - '/clean/i'
- '/chore/i' - '/chore/i'
- '/clippy/i' - '/clippy/i'
- '/test/i'
- '/(ci)/i'
- '/(cd)/i'
- '/job/i'
- '/patch/i'
- '/actions/i'
files: files:
# Regular changes that don't need to go in the CHANGELOG # Regular changes that don't need to go in the CHANGELOG
- 'CHANGELOG.md' - 'CHANGELOG.md'
- 'zebra-consensus/src/checkpoint/*-checkpoints.txt' - 'zebra-consensus/src/checkpoint/*-checkpoints.txt'
# Developer-only changes # Developer-only changes
- '.gitignore' - '.gitignore'
- '.dockerignore'
# Test-only changes # Test-only changes
- 'zebra-test' - 'zebra-test'
- '.cargo/config.toml' - '.cargo/config.toml'
@ -80,8 +87,7 @@ categories:
labels: labels:
- 'C-security' - 'C-security'
# Other labels that are usually security issues # Other labels that are usually security issues
- 'I-bad-code' - 'I-invalid-data'
- 'I-bad-data'
- 'I-consensus' - 'I-consensus'
- 'I-crash' - 'I-crash'
- 'I-destructive' - 'I-destructive'
@ -90,11 +96,10 @@ categories:
- 'I-privacy' - 'I-privacy'
- 'I-remote-node-overload' - 'I-remote-node-overload'
- 'I-unbounded-growth' - 'I-unbounded-growth'
- 'I-unsound' - 'I-memory-safety'
- title: 'Removed' - title: 'Removed'
labels: labels:
- 'C-removal' - 'C-removal'
- 'C-breaking'
- title: 'Deprecated' - title: 'Deprecated'
labels: labels:
- 'C-deprecation' - 'C-deprecation'
@ -164,7 +169,7 @@ template: |
### Breaking Changes ### Breaking Changes
This release has the following breaking changes: This release has the following breaking changes:
- *TODO*: Check the `Removed` section for any breaking changes - *TODO*: Check the `Removed` and `Deprecated` sections for any breaking changes
- *TODO*: Add a short description of the user impact of each breaking change, and any actions users need to take - *TODO*: Add a short description of the user impact of each breaking change, and any actions users need to take
$CHANGES $CHANGES