Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 5 commits into from
Jul 10, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 49 additions & 16 deletions .github/mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,34 +29,67 @@ queue_rules:
conditions:
- base=main

# These rules are checked in order, the first one to be satisfied applies
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:
# This queue handles a PR if:
# - it targets main
# - is not in draft
# - does not include the do-not-merge label
# - is labeled with Critical priority
# This queue handles a PR if it:
# has multiple approving reviewers
- "#approved-reviews-by>=2"
# is labeled with Critical priority
- '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:
queue:
name: urgent
method: squash

- name: move to urgent 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 Critical priority
- 'label~=^P-Critical'
# and satisfies the standard merge conditions:
- base=main
- -draft
- label!=do-not-merge
actions:
queue:
name: urgent
method: squash

- name: move to batched queue when CI passes with 1 review and not WIP targeting main
- 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 targets main
# - is not in draft
# - does not include the do-not-merge label
# - is labeled with any other priority except Critical, or does not have a priority label,
# including automated dependabot PRs.
#
# We don't need to check priority labels here, because the rules are evaluated in order:
# https://docs.mergify.com/configuration/#pull-request-rules
# 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
- -draft
- label!=do-not-merge
Expand Down
30 changes: 12 additions & 18 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,16 @@ autolabeler:
- '/secur/i'
title:
- '/secur/i'
- label: 'C-removed'
branch:
- '/remov/i'
title:
- '/remov/i'
- label: 'C-deprecated'
branch:
- '/deprecat/i'
title:
- '/deprecat/i'
- label: 'C-feature'
branch:
- '/add/i'
- '/feat/i'
title:
- '/add/i'
- '/feat/i'
- label: 'C-enhancement'
branch:
- '/chang/i'
title:
- '/chang/i'
- label: 'C-bug'
branch:
- '/fix/i'
Expand All @@ -46,16 +34,24 @@ autolabeler:
- '/clean/i'
- '/chore/i'
- '/clippy/i'
- '/test/i'
title:
- '/clean/i'
- '/chore/i'
- '/clippy/i'
- '/test/i'
- '/(ci)/i'
- '/(cd)/i'
- '/job/i'
- '/patch/i'
- '/actions/i'
files:
# Regular changes that don't need to go in the CHANGELOG
- 'CHANGELOG.md'
- 'zebra-consensus/src/checkpoint/*-checkpoints.txt'
# Developer-only changes
- '.gitignore'
- '.dockerignore'
# Test-only changes
- 'zebra-test'
- '.cargo/config.toml'
Expand All @@ -80,8 +76,7 @@ categories:
labels:
- 'C-security'
# Other labels that are usually security issues
- 'I-bad-code'
- 'I-bad-data'
- 'I-invalid-data'
- 'I-consensus'
- 'I-crash'
- 'I-destructive'
Expand All @@ -90,11 +85,10 @@ categories:
- 'I-privacy'
- 'I-remote-node-overload'
- 'I-unbounded-growth'
- 'I-unsound'
- 'I-memory-safety'
- title: 'Removed'
labels:
- 'C-removal'
- 'C-breaking'
- title: 'Deprecated'
labels:
- 'C-deprecation'
Expand Down Expand Up @@ -164,9 +158,9 @@ template: |
### 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
teor2345 marked this conversation as resolved.
Show resolved Hide resolved
- *TODO*: Add a short description of the user impact of each breaking change, and any actions users need to take

$CHANGES

### Contributors
Expand Down