Repository navigation
ci/review-policy: allow to use from other repos - #5573
Merged
Merged
Conversation
Make the review-policy workflow reusable (via workflow_call), so other opencontainers repositories with the same merge rules (such as opencontainers/cgroups, see opencontainers/cgroups#91) can call it instead of carrying a copy. The calling repository gets the same logic, which is fine, since: - CHANGELOG.md and vendor/ exceptions are no-ops where there's no such file/directory; - the merge_group trigger is the caller's, and it's harmless when unused. The only difference was CODEOWNERS, which cgroups treats as a governance file. Add it here, too, as it does define who reviews what. Document how to use it from another repository. Signed-off-by: Kir Kolyshkin <[email protected]>
Merged
via the queue into
opencontainers:main
with commit Oct 23, 2026
c9232a3
96 of 97 checks passed
Member
|
Wondering if we could use a |
kolyshkin
added a commit
to kolyshkin/oc-cgroups
that referenced
this pull request
Oct 23, 2026
Add a check enforcing the pull request merge rules from MAINTAINERS_GUIDE.md, to be used as a required status check (in addition to the GitHub's required number of approvals, which can not depend on who the author is, and also counts approvals from anyone having write access, not just from current maintainers). The check is a pull_request_review workflow with a read-only token, which evaluates the current state of the pull request using the GitHub API. No other triggers are used, since branch protection requires the latest run for each event type to pass, so a failed run triggered by, say, a push would keep blocking the merge after a review fixes it. As a result, the check needs a review (a comment-only one is fine) to be run after a push, and it needs to be re-run manually once a review period is over. Note that since the workflow runs from the pull request, a pull request can change it. This is the price for not using privileged triggers (pull_request_target or workflow_run) and write permissions. To mitigate, the workflow is a governance file (so changing it requires two LGTMs), and GitHub's own required approval stays as a backstop. The check itself is the runc one (see opencontainers/runc#5512), used as a reusable workflow (made so in opencontainers/runc#5573), pinned to a commit. Dependabot is told not to bump it, since a bump may change the rules, so it should be a deliberate (and governance) change. Signed-off-by: Kir Kolyshkin <[email protected]>
kolyshkin
added a commit
to kolyshkin/oc-cgroups
that referenced
this pull request
Nov 3, 2026
Add a check enforcing the pull request merge rules from MAINTAINERS_GUIDE.md, to be used as a required status check (in addition to the GitHub's required number of approvals, which can not depend on who the author is, and also counts approvals from anyone having write access, not just from current maintainers). The check is a pull_request_review workflow with a read-only token, which evaluates the current state of the pull request using the GitHub API. No other triggers are used, since branch protection requires the latest run for each event type to pass, so a failed run triggered by, say, a push would keep blocking the merge after a review fixes it. As a result, the check needs a review (a comment-only one is fine) to be run after a push, and it needs to be re-run manually once a review period is over. Note that since the workflow runs from the pull request, a pull request can change it. This is the price for not using privileged triggers (pull_request_target or workflow_run) and write permissions. To mitigate, the workflow is a governance file (so changing it requires two LGTMs), and GitHub's own required approval stays as a backstop. The check itself is the runc one (see opencontainers/runc#5512), used as a reusable workflow (made so in opencontainers/runc#5573), pinned to a commit. Dependabot is told not to bump it, since a bump may change the rules, so it should be a deliberate (and governance) change. Signed-off-by: Kir Kolyshkin <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make the
review-policyworkflow reusable (viaworkflow_call), so otheropencontainers repositories having the same merge rules can call it instead of
carrying a copy. The first user would be opencontainers/cgroups#91 (where this
was suggested).
A caller would look like this (pinned to a commit SHA, so the rules in the
calling repo can only change via its own governance change):
The logic is unchanged, except
CODEOWNERSis now also a governance file(cgroups has one; runc does not, so this is a no-op here). The other
runc-specific bits (
CHANGELOG.md,vendor/,merge_group) are harmlessfor repos which don't have them.
Note this is a governance change, so it needs two LGTMs.