docs(branching): codify trunk-based Option A workflow#44
Conversation
…CONTRIBUTING.md Match the docs to the repo settings applied 2026-05-29 (auto-delete-on-merge, squash-only, protected main). Replaces the stale finalize/<release> + tag-only language with the trunk-based + squash-to-main + auto-delete contract.
There was a problem hiding this comment.
Code Review
This pull request updates CLAUDE.md and CONTRIBUTING.md to document a transition to a trunk-based branching and merge workflow, detailing rules for branch naming, squash-merging, main branch protection, and releases. The review feedback suggests improving document navigation by converting plain text section references into clickable Markdown links and adjusting terminology to "Conventional Commits format" for consistency.
|
|
||
| 1. **Run all commands from the repo root.** `bun install`, `bun test`, `bun run dev <command>`, `bun run build:binary`. | ||
| 2. **Branches:** `main` only on tagged releases. Feature branches: `feat/`, `fix/`, `refactor/`, `test/`, `docs/`. Conventional commit messages. | ||
| 2. **Branching is trunk-based (Option A, locked 2026-05-29).** `main` is the protected trunk and the only long-lived branch. Every change lands via a short-lived branch -> PR -> green CI -> **squash-merge** -> head branch auto-deletes (merge-commit and rebase-merge are disabled). Prefixes: `feat/`, `fix/`, `refactor/`, `test/`, `docs/`, `chore/`, with a kebab-case slug after the slash, optionally issue-scoped (`fix/123-worktree-reset`). One branch = one PR = one squashed conventional commit = one concern; branch from latest `main` (`git fetch origin && git switch -c feat/<slug> origin/main`), never from another topic branch; never push `worktree-*` scratch branches. Releases are annotated SemVer tags (`vX.Y.Z-alpha.N`) on a green `main`, cut behind a `chore/release-*` PR. `main` is protected for everyone including admins (required `bun test` checks, linear history, no force-push or deletion, PR-before-merge). Full contract: CONTRIBUTING.md § "Branching and merge workflow". |
There was a problem hiding this comment.
| - Open the PR the same session and keep branches short-lived. On merge the branch **auto-deletes** — do not delete it by hand. | ||
| - Never push `worktree-*` scratch branches; git worktrees stay local. | ||
|
|
||
| **Merging.** PRs **squash-merge** into `main` (merge commits and rebase-merge are disabled), so one PR becomes exactly one conventional commit on `main`. The PR title is the squash commit subject, so it must be Conventional-Commit form. |
| - Substantive PRs get a Codex review pass (see above). The review verdict is recorded in the PR conversation. | ||
| - Block-push findings close in a follow-up commit on the PR branch before merge. | ||
| - The merge strategy is squash-merge to `finalize/<release>` branches or rebase to feature branches. `main` only receives release tags. | ||
| - The merge strategy is **squash-merge into `main`**; the head branch auto-deletes on merge. Release tags are cut on `main` behind a `chore/release-*` PR (see "Branching and merge workflow"). |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR updates project documentation: adjusts the offline test-suite pass/skip expectation and replaces previous branching guidance with a trunk-based workflow (protected ChangesTrunk-based branching workflow
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Pull request overview
Updates repository documentation to reflect the trunk-based “Option A” workflow now enforced by GitHub settings (protected main, squash-only merges, short-lived topic branches, and tag-based releases).
Changes:
- Replaces the old “
mainis tag-only / finalize/*” branching narrative with a trunk-based, short-lived branch + PR + squash-merge contract. - Documents branch naming/prefix rules (including
chore/) and the “one branch = one PR = one concern” convention. - Clarifies release mechanics as tags cut on green
mainbehind achore/release-*PR.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| CONTRIBUTING.md | Rewrites the branching section to describe the trunk-based PR + squash-merge workflow and updates the PR expectations section accordingly. |
| CLAUDE.md | Updates “Working in this repo” rule 2 to reflect the same trunk-based workflow and points readers to CONTRIBUTING for the full contract. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| 1. **Run all commands from the repo root.** `bun install`, `bun test`, `bun run dev <command>`, `bun run build:binary`. | ||
| 2. **Branches:** `main` only on tagged releases. Feature branches: `feat/`, `fix/`, `refactor/`, `test/`, `docs/`. Conventional commit messages. | ||
| 2. **Branching is trunk-based (Option A, locked 2026-05-29).** `main` is the protected trunk and the only long-lived branch. Every change lands via a short-lived branch -> PR -> green CI -> **squash-merge** -> head branch auto-deletes (merge-commit and rebase-merge are disabled). Prefixes: `feat/`, `fix/`, `refactor/`, `test/`, `docs/`, `chore/`, with a kebab-case slug after the slash, optionally issue-scoped (`fix/123-worktree-reset`). One branch = one PR = one squashed conventional commit = one concern; branch from latest `main` (`git fetch origin && git switch -c feat/<slug> origin/main`), never from another topic branch; never push `worktree-*` scratch branches. Releases are annotated SemVer tags (`vX.Y.Z-alpha.N`) on a green `main`, cut behind a `chore/release-*` PR. `main` is protected for everyone including admins (required `bun test` checks, linear history, no force-push or deletion, PR-before-merge). Full contract: CONTRIBUTING.md § "Branching and merge workflow". |
The exact suite count (3395) was already stale (~3789 today) and rots on every milestone. A '3750+ / 0 fail' floor stays accurate as suites are added.
Codifies the trunk-based Option A branching strategy adopted 2026-05-29, so the docs match the GitHub repo settings now in force.
What changed
CLAUDE.md— "Working in this repo" rule 2 rewritten from the one-line "main only on tagged releases" into the full trunk-based contract: branch from latestmain,feat|fix|refactor|test|docs|chore/prefixes with issue-scoped slugs, one-branch = one-PR = one-squashed-commit, squash-merge + auto-delete, protectedmain, releases as tags behindchore/release-*PRs.CONTRIBUTING.md— replaced the "Branch naming" subsection with a "Branching and merge workflow" section covering the same contract, and fixed the stale "squash-merge tofinalize/<release>branches or rebase to feature branches /mainonly receives release tags" line (that pattern is retired) to "squash-merge intomain; head branch auto-deletes."Why
On 2026-05-29 the repo settings were changed to match Option A:
deleteBranchOnMerge=on, squash-only (merge-commit + rebase-merge disabled), andmainbranch protection (requiredbun testchecks on both runners, strict/linear history, no force-push or deletion, PR-before-merge,enforce_adminson). The docs still described an olderfinalize/<release>+ tag-only flow that no longer matches reality. This PR is the documentation half of that change.Docs-only.
bun test ./testsis green locally: 3789 pass / 0 fail / 2 skip.Summary by CodeRabbit