Skip to content
Merged
Changes from 1 commit
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
52 changes: 52 additions & 0 deletions .github/mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,58 @@ pull_request_rules:
comment:
message: This pull request has merge conflicts. Could you please resolve them
@{{author}}? 🙏
label:
add:
- waiting-on-author
remove:
- ready-for-review

- name: Ask to resolve CI failures
conditions:
- or:
- check-failure=test-suite-success
- check-skipped=test-suite-success
- check-failure=local-testnet-success
- check-skipped=local-testnet-success
actions:
comment:
message: Some required checks have failed. Could you please take a look @{{author}}? 🙏
label:
add:
- waiting-on-author
remove:
- ready-for-review

- name: Update labels when PR is unblocked
conditions:
- label=waiting-on-author
- -conflict
- check-success=test-suite-success
- check-success=local-testnet-success
- "#changes-requested-reviews-by = 0"
Copy link
Member

Choose a reason for hiding this comment

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

I think this won't fire very often. If someone requests changes, their request for changes hangs around until they dismiss it or re-review.

We can give it a go, but I think what we really need is a way of checking whether all review comments have been addressed. Maybe #review-threads-unresolved = 0?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch.

I had a look at a few open PRs and looks like neither of these would be sufficient

Copy link
Member Author

Choose a reason for hiding this comment

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

For PRs by external contributors, this rule will never fire automatically because the CI workflow require approval - but it would be useful to automatically update the labels once the a maintainer approve the job and the CI job passes.

For PRs by maintainers, I think it would be easy enough for the author just update the labels.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've updated the rules to match for

  • no failing CI jobs instead of passing CI (because it requires approval)
  • "#review-requested > 0" instead of the above, so it only fires automatically if a review is requested. This is a workaround for the above two issues, it's not ideal but i think easier than 1. dimissing the review, 2. having to create a thread to avoid waiting-on-author from getting removed.

actions:
label:
remove:
- waiting-on-author
add:
- ready-for-review
comment:
message: >
All required checks have passed and there are no merge conflicts.
This pull request may now be ready for another review.

- name: Close stale pull request after 30 days of inactivity
conditions:
- label=waiting-on-author
- updated-at<=30 days ago
actions:
close:
message: >
Hi @{{author}}, this pull request has been closed automatically due to 30 days of inactivity.
If you’d like to continue working on it, feel free to reopen at any time.
label:
add:
- stale

- name: Approve trivial maintainer PRs
conditions:
Expand Down
Loading