📝 docs: document the main branch protection and the PR-only path to main#398
Merged
Conversation
`main` is now protected: pull requests required, seven status checks required, `enforce_admins` on. The release process documented here was written around a local `dev` → `main` merge (step 4), which is exactly the push that is now rejected, so the doc had to move with the setting. Add a `## Branch protection` section between Merge strategy and Releases, since it constrains both. It leads with the part that actually bites: there is no admin override, so the maintainer is subject to it like anyone else. It also records why three of the rules look wrong at a glance: - 0 required approvals, not 1. GitHub forbids approving your own PR and this is a single-maintainer repo, so requiring one approval would be a permanent lockout. The checks are the gate; the PR is only the rail that runs them. - Linear history off, or squash/rebase merges become mandatory and the "never squash" merge strategy dies with it. - `gwm doctor (advisory)`, CodeRabbit and GitGuardian left out of the required set: a required check that stops reporting blocks the branch forever, so only checks we own and that always run are listed. Releases are mechanically unaffected (both workflows trigger on tags, and protection guards branch refs, not tags), but hotfixes lose their direct path to `main` too, which step 0 assumed they had. The house rule goes first in CLAUDE.md because it gates every release, and names the two cuts (v1.0.2, v1.1.1) done the way that no longer works. No CHANGELOG entry: contributor-facing docs, nothing a gwm user consumes. closes #397
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Description
mainis now protected: pull requests required, seven status checks required,enforce_adminson. The release process documented inCONTRIBUTING.mdwas written around a localdev→mainmerge (step 4), which is exactly the push that is now rejected, so the doc had to move with the setting.Closes #397
Type of change
Changes
CONTRIBUTING.md: new## Branch protectionsection, placed between Merge strategy and Releases because it constrains both. Lists the active rules and records why three of them look wrong at a glance.CONTRIBUTING.md: stable release step 4 now goes through adev→mainPR; step 5 tags the merge commit and notes that tags are not covered by the protection.CONTRIBUTING.md: table of contents entry.CLAUDE.md: house rule, placed first in the list since it gates every release, naming the two cuts (v1.0.2, v1.1.1) done the way that no longer works.Tests
cargo testpasses locally: 1972 passed, 0 failedcargo fmt --checkpasses: exit 0cargo clippy --all-targets -- -D warningspasses: exit 0tests/No test, and this is the argued exception. The protection lives in GitHub server state, not in this repo, so there is no public surface to assert against. This is the comments/docs exception in
CLAUDE.md. Codifying the protection as a committed ruleset JSON just to have something to test would be over-engineering for a single branch, and the JSON could drift from the real setting anyway, which is the exact failure this PR is cleaning up after (a comment asserting an invariant nothing enforces, same shape as #393). The suite was run anyway and is green.Checklist
<type>/#<issue>-<description>Verified## [Unreleased]examples/gwm.toml.exampleupdated if config schema changedNo CHANGELOG entry on purpose: contributor-facing docs, nothing a gwm user consumes. Same call as #395 (the signed-commits doc), which shipped without one.
Notes for reviewers
The applied configuration, for the record:
What was checked before applying it, since a wrong setting here is the kind that only surfaces when you cannot ship:
ci.ymlruns onpull_request: branches: [main, dev], so the seven required checks do report on adev→mainPR. Requiring a check that never reports would block the branch permanently.git pushsites inrelease.ymltarget the Homebrew tap and the Scoop bucket, notmain, so no release automation breaks.required_signaturesis left off, per the decision recorded in [Task]: document the signed-commits preference in CONTRIBUTING #394: it has real consequences for drive-by contributors and deserves its own call. The### Signing (preferred)line saying nothing in CI or branch protection enforces signing therefore stays accurate.The three rules worth arguing about are covered in the new section, but in short: 0 approvals because a solo repo cannot self-approve and 1 would be a permanent lockout; linear history off so merge commits stay legal; advisory and third-party checks excluded so they cannot wedge the branch.
This PR is itself the first thing to go through the new rail, though against
dev, which is unprotected.Linked issues / docs
mainbranch protection and adapt the release process #397required_signaturesdecision left open)