Skip to content

Use bypass_mode "exempt" — admins get the green Merge-when-ready button - #88

Merged
Aswinmcw merged 1 commit into
mainfrom
codeowner-exempt-mode
Aug 25, 2026
Merged

Use bypass_mode "exempt" — admins get the green Merge-when-ready button#88
Aswinmcw merged 1 commit into
mainfrom
codeowner-exempt-mode

Conversation

@Aswinmcw

Copy link
Copy Markdown
Member

The bypass list has three modes, not two. I only ever enumerated always and pull_request, concluded the behaviour was impossible, and wrote that conclusion into the code comments. exempt is the one that does it.

The distinction

mode what it does result
always / pull_request actor may override the rule at merge time "merge without waiting for requirements" — merges directly, skips the queue. Green button never appears.
exempt rule is not applicable to the actor PR reads CLEAN for them → normal green "Merge when ready", through the queue like anyone else

Queue entry is gated on the pull request satisfying the rules. An override is not satisfaction, which is why the first two modes can only ever produce a force-merge.

Verified on live PRs

Same repo, same PR, one variable changed:

always        -> BLOCKED
pull_request  -> BLOCKED
exempt        -> CLEAN

With exempt: zero approvals, require_code_owner_review still enabled on the ruleset, merge_queue still enforced by org-baseline (empty bypass list), viewerCanMergeAsAdmin: false — so this is definitively not the force-merge path. Green button confirmed in the UI.

Changes

  • codeowner_payload()bypass_mode: "exempt"
  • OrganizationAdmin removed from org-codeowner-review — an always actor there would re-offer the force-merge path and defeat the point. Break-glass stays on org-baseline, which owns the queue, unchanged.
  • Comments in the script and workflow header asserting this was impossible are corrected, with the mode distinction spelled out so nobody "simplifies" exempt back to always.

norm() includes bypass_mode in the compare key, so the mode change registers as drift and every repo gets rewritten on the next enforce run.

Note

shiptrack is currently the test bed and has org-baseline's bypass stripped for isolation. The enforce run after this merges will restore its break-glass and bring it in line with the other 20.

🤖 Generated with Claude Code

The bypass list has three modes, not two, and they are not degrees of the
same behaviour:

  always / pull_request  the actor may OVERRIDE the rule at merge time.
      GitHub offers "merge without waiting for requirements (bypass
      rules)", which merges directly and SKIPS THE MERGE QUEUE. The green
      "Merge when ready" never appears, because queue entry is gated on
      the pull request satisfying the rules and an override is not
      satisfaction.
  exempt                 the rule is treated as NOT APPLICABLE to the
      actor. The PR simply reads CLEAN for them, so the normal green
      button appears and the PR goes through the queue like any other.

Verified on live PRs, same repo and same PR, one variable changed:
  always        -> BLOCKED
  pull_request  -> BLOCKED
  exempt        -> CLEAN, zero approvals, require_code_owner_review still
                   enabled, merge_queue still enforced via org-baseline
                   (which has no bypass), green button confirmed in the UI.

OrganizationAdmin is deliberately removed from org-codeowner-review: an
"always" actor there would re-offer the force-merge path. Break-glass
stays on org-baseline, which owns the queue, and is unchanged.

Comments asserting this was impossible are corrected. They were written
from an incomplete enumeration of the bypass modes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Aswinmcw
Aswinmcw requested review from a team and Aswin-coder as code owners August 25, 2026 04:27

@Aswincloud-Bot Aswincloud-Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Auto-approved: @Aswinmcw is a member of @Aswincloud/admins.

@Aswinmcw
Aswinmcw added this pull request to the merge queue Aug 25, 2026
Merged via the queue into main with commit 6007ca8 Aug 25, 2026
2 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.

3 participants