Repository navigation
docs: ADR 0071 — Auto-merge #2791
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
996296d
docs: add ADR 0062 for auto-merge
ralphbean 5921a16
docs: revise ADR 0062 — env-var toggle over separate agent
ralphbean 50f5e87
docs: renumber ADR 0062 → 0071 to avoid collision
ralphbean 0a7bd32
docs: address review feedback on ADR 0071
ralphbean 3a3507a
docs: note why this ADR lives here despite agent repo move
ralphbean File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| --- | ||
| title: "62. Auto-merge" | ||
| status: Accepted | ||
| relates_to: | ||
| - agent-architecture | ||
| - security-threat-model | ||
| topics: | ||
| - github-apps | ||
| - least-privilege | ||
| - auto-merge | ||
| --- | ||
|
|
||
| # 62. Auto-merge | ||
|
|
||
| Date: 2026-06-30 | ||
|
|
||
| ## Status | ||
|
|
||
| Accepted | ||
|
|
||
| ## Context | ||
|
|
||
| Our review bot (`fullsend-ai-review`) can approve PRs, but GitHub only counts | ||
| an approval toward branch protection when the reviewer has write access | ||
| (`contents: write`) to the repository. The review app intentionally has | ||
| `contents: read` — giving it write access would violate the least-privilege | ||
| boundary established in [ADR 7](0007-per-role-github-apps.md). | ||
|
|
||
| We also need the bot's approval to satisfy CODEOWNERS for dependency files | ||
| (`go.mod`, `go.sum`). GitHub App bots cannot be listed as CODEOWNERS entries — | ||
| they are not "users" in GitHub's model. | ||
|
|
||
| ## Options | ||
|
|
||
| ### A. Add `contents: write` to the review app | ||
|
|
||
| Collapses the permission boundary between review and implementation roles. | ||
| Every repo that installs the review app would grant it write access it doesn't | ||
| otherwise need. | ||
|
|
||
| ### B. Create a separate `fullsend-ai-merge` app | ||
|
|
||
| A new app with `contents: write` and `pull_requests: write`. Repos opt in to | ||
| auto-merge by installing this app instead of (or alongside) the review app. | ||
| The trust escalation is explicit and visible in GitHub's UI. | ||
|
|
||
| ### C. Exempt dependency files via blank-owner CODEOWNERS entries | ||
|
|
||
| Use [blank-owner entries](https://github.com/orgs/community/discussions/23064) | ||
| to remove the CODEOWNERS requirement for specific files. This is orthogonal to | ||
| the app permission question — it addresses the CODEOWNERS gate, not the | ||
| approval-counts gate. | ||
|
|
||
| ## Decision | ||
|
|
||
| Use options B and C together: | ||
|
|
||
| 1. **Create a `fullsend-ai-merge` app** with `contents: write` and | ||
| `pull_requests: write`. Its approvals count toward branch protection. Repos | ||
| that want bot-driven auto-merge install this app; repos that only want | ||
| informational reviews keep `fullsend-ai-review`. | ||
|
|
||
| 2. **Use blank-owner CODEOWNERS entries** for files that bots should be able to | ||
| approve (starting with `go.mod` and `go.sum`). This removes the CODEOWNERS | ||
| gate for those files without affecting other paths. | ||
|
qodo-code-review[bot] marked this conversation as resolved.
Resolved
|
||
|
|
||
| ## Consequences | ||
|
|
||
| - The review app stays read-only — no permission creep. | ||
| - Auto-merge is an explicit opt-in per repo, visible in the GitHub App installation list. | ||
| - Blank-owner CODEOWNERS entries remove code-owner review for the listed files; CI status checks remain the primary safety gate for those paths. | ||
| - Adding a new app increases the number of apps to manage and enroll per org. | ||
| - The merge app's `contents: write` permission is a higher-value target if compromised — the same mitigations from [ADR 7](0007-per-role-github-apps.md) apply (repo-scoped install, PEM in config repo secrets). | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.