Skip to content
Open
Changes from all 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
47 changes: 21 additions & 26 deletions .mergify.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,25 @@
pull_request_rules:
merge_protections:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 merge_protections product must be enabled before merging

The PR description itself warns: "The following required products are not enabled for this repository: merge_protections. If you merge this PR without enabling them first, some of your rules will stop working."

Merging this before enabling merge_protections in the Mergify dashboard will leave the repository with no active approval enforcement — both the Lookout UI and Armada maintainer approval protections will silently stop working. The old pull_request_rules + post_check rules are being removed, and the new merge_protections block is inert until the feature is activated.

Recommended order of operations:

  1. Enable the merge_protections product in the Mergify dashboard for this repository.
  2. Merge this PR.
  3. Verify the two protection rules appear as active checks on a subsequent PR.

# Migrated from post_check rule 'Require approval from frontend or Armada maintainers for Lookout UI changes'. Dropped options with no equivalent: title
- name: Require approval from frontend or Armada maintainers for Lookout UI changes
conditions:
if:
- "#approved-reviews-by>=1"
Comment on lines +4 to 5
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 if condition gates protection on existing approval

Both protection rules use if: "#approved-reviews-by>=1", which means the protection is only evaluated after at least one approval already exists. A PR with zero approvals will have neither protection apply, and could potentially be merged without any checks firing.

This behaviour is preserved from the original pull_request_rules conditions, so it is not a regression introduced by this migration. However, it's worth a conscious decision: if the intent is to always block until the approval criteria are met (regardless of whether any approval exists yet), the if field can be omitted entirely so the protection is always evaluated.

  - name: Require approval from frontend or Armada maintainers for Lookout UI changes
    # no `if:` → always enforced
    success_conditions:
      ...

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

actions:
post_check:
success_conditions:
- or:
- "-files~=^internal/lookoutui/"
- "#approved-reviews-by>=2"
- and:
- "#approved-reviews-by>=1"
- "author~=^(d80tb7|dave[-]gantenbein|dejanzele|eleanorpratt|geaere|JamesMurkin|mauriceyap|masipauskas|MustafaI|zuqq|richscott|robertdavidsmith|samclark|suprjinx|EnricoMi|nikola-jokic|dslear|d2burkhalter|ianhockett|Sigele|williamvega|tgucks|YHines004|j8169)$"
title: Two approvals required, or one if author is a frontend or Armada maintainer.

success_conditions:
- or:
- "-files~=^internal/lookoutui/"
- "#approved-reviews-by>=2"
- and:
- "#approved-reviews-by>=1"
- "author~=^(d80tb7|dave[-]gantenbein|dejanzele|eleanorpratt|geaere|JamesMurkin|mauriceyap|masipauskas|MustafaI|zuqq|richscott|robertdavidsmith|samclark|suprjinx|EnricoMi|nikola-jokic|dslear|d2burkhalter|ianhockett|Sigele|williamvega|tgucks|YHines004|j8169)$"
# Migrated from post_check rule 'Require approval from Armada maintainers'. Dropped options with no equivalent: title
- name: Require approval from Armada maintainers
conditions:
if:
- "#approved-reviews-by>=1"
actions:
post_check:
success_conditions:
- or:
- and:
- "files~=^internal/lookoutui/"
- "-files~=^(?!internal/lookoutui/).*$"
- "#approved-reviews-by>=2"
- and:
- "#approved-reviews-by>=1"
- "author~=^(d80tb7|dave[-]gantenbein|dejanzele|eleanorpratt|geaere|JamesMurkin|mauriceyap|masipauskas|MustafaI|zuqq|richscott|robertdavidsmith|samclark|suprjinx|EnricoMi|nikola-jokic|j8169)$"
title: Two approvals required, or one if author is a maintainer.
success_conditions:
- or:
- and:
- "files~=^internal/lookoutui/"
- "-files~=^(?!internal/lookoutui/).*$"
- "#approved-reviews-by>=2"
- and:
- "#approved-reviews-by>=1"
- "author~=^(d80tb7|dave[-]gantenbein|dejanzele|eleanorpratt|geaere|JamesMurkin|mauriceyap|masipauskas|MustafaI|zuqq|richscott|robertdavidsmith|samclark|suprjinx|EnricoMi|nikola-jokic|j8169)$"
Loading