slash-commands: direct-merge fallback for code-owner review#16
Merged
Conversation
…e-owner check When branch protection enables require_code_owner_review, the GitHub App's APPROVE review does not satisfy it (Apps cannot be team members). Auto-merge also does not inherit the App's ruleset-bypass privileges, so the PR sits in BLOCKED/REVIEW_REQUIRED forever with auto-merge enabled but never firing. Detect this by reading reviewDecision back from the enablePullRequestAutoMerge mutation. If it is still REVIEW_REQUIRED after we submitted an approval, attempt a direct merge instead — a direct merge does use the App's bypass. Both direct-merge paths (this new one and the existing clean-status fallback) now go through a shared mergeDirect helper that catches failures and emits an actionable warning pointing at the ruleset bypass-list setup. :house: Remote-Dev: homespace
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.
Summary
When branch protection enables Require review from Code Owners, the
GitHub App's APPROVE review does not satisfy it — Apps cannot be members
of org teams, so they cannot be code owners via a team entry. Auto-merge
also does not inherit the App's ruleset-bypass privileges, so the PR
sits in
BLOCKED/REVIEW_REQUIREDforever with auto-merge enabled butnever firing.
reviewDecisionback from theenablePullRequestAutoMergemutation. If still
REVIEW_REQUIREDafter we submitted an approval,attempt a direct merge — a direct merge does use the App's bypass.
mergeDirecthelper for both this path and theexisting clean-status fallback. Catches failures and emits an
actionable warning pointing at the ruleset bypass-list setup.
section with the exact Settings navigation path.
Test plan
@den/lgtm-codeowner-bypass/lgtm forceon a PR where branch protection hasrequire_code_owner_reviewand the App is in the ruleset bypasslist → merges directly instead of stalling on auto-merge
/lgtmon a PR without code-owner requirement → auto-mergeenabled, no behavior change