Skip to content

ci: require approval and verify checks via a ruleset - #1413

Merged
potiuk merged 4 commits into
apache:mainfrom
potiuk:allowlist-approval-required
Oct 19, 2026
Merged

potiuk merged 4 commits into
apache:mainfrom
potiuk:allowlist-approval-required

Conversation

@potiuk

@potiuk potiuk commented Oct 19, 2026 •

Copy link
Copy Markdown
Member
  • Require approval and verify on main through a Required checks ruleset in .asf.yaml. Until now both were advisory, so an allow-list PR could merge unapproved, as action-allowlist-review: bump j178/prek-action from 3.0.1 to 3.0.2 in /.github/actions/for-dependabot-triggered-reviews #1409 did.
  • Bypass is only possible through the ruleset: repository admins always (update.yml pushes its sync commit directly as asfgit, an admin), and anyone with write access on pull requests only, as a deliberate "bypass rules" merge, never a push.
  • Both verify workflows now start on every PR (a required check that never starts blocks a PR forever). A first step reads the PR's file list and, for a PR touching none of the three allow-list files, passes with no checkout or build. The decision is inside the job, so a failed lookup fails verify rather than skipping it; names are compared as JSON strings and a list at the API cap is verified.

Unverified, for Infra to confirm: the ruleset bypasses the built-in write role (id 4). Whether that also covers the custom committers org role, which most committers here hold, is unknown; listing that role needs its id, which needs org-admin access.

Test plan: uv run pytest scripts/; the verify scope step run under bash -e -o pipefail against an allow-list PR, an unrelated PR, a 20,000-file list, a truncated list, a 3000-file list, a rename and a newline-containing name; .asf.yaml parsed; prek run clean.

🤖 Generated with Claude Code

Make 'approval' a required status check on main, so an allow-list PR
cannot merge unapproved (apache#1409 did, as the check was advisory). A
maintainer can waive it with the allowlist-approval-override label, for
their own allow-list PRs; it counts only if whoever last added it has
write access.

Generated-by: Claude Opus 5
Both verify workflows now start on every PR so the check can be
required; a first step decides from the PR's file list and skips the
rest when the allow list is untouched, failing closed.

Generated-by: Claude Opus 5
Both verify jobs watch all three allow-list paths, so the one that runs
for a PR's author covers each; file names are matched as JSON strings
and counted as entries, and a list at the API cap is verified.

Generated-by: Claude Opus 5
Only a ruleset can say who may bypass a required check: admins always
(asfgit's direct sync pushes), write access on pull requests only. That
replaces the allowlist-approval-override label, so the approval script
is back to main's version.

Generated-by: Claude Opus 5
@potiuk potiuk changed the title ci: require approval and verify checks, with a maintainer override ci: require approval and verify checks via a ruleset Oct 19, 2026
@potiuk
potiuk merged commit 5bfad9b into apache:main Oct 19, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant