Skip to content

chore: protect main, document trunk-based branch model - #12

Merged
snchimata merged 1 commit into
mainfrom
chore/branch-protection
Aug 18, 2026
Merged

chore: protect main, document trunk-based branch model#12
snchimata merged 1 commit into
mainfrom
chore/branch-protection

Conversation

@snchimata

Copy link
Copy Markdown
Owner

Enforces "no direct push to main" and writes down the branch model.

What changed

  • .github/rulesets/main-protection.json — PR required (0 approvals, squash/merge), 8 required status checks, blocks deletion and force-push. Already applied as ruleset 20996245.
  • .github/rulesets/release-tags.jsonrefs/tags/v* immutable. Already applied as ruleset 20996247.
  • CONTRIBUTING.md — branch model, change flow, release-via-PR flow, ruleset apply commands.
  • AGENTS.md — "Branches and pull requests" section.
  • ci.yml — dropped the deleted develop branch from both triggers.

Branch model

main is the only long-lived branch; releases are selected by vX.Y.Z tags, not by branches. No develop/preprod/production — those model a continuously-deployed service, whereas this repo publishes versioned artifacts to crates.io, PyPI, npm, and GitHub Releases, where the tag is the release selector. The stale develop branch (0 ahead of main, 18 behind) has been deleted.

This supersedes the previous convention of pushing release commits directly to main.

Required status checks

Required: lint, test, node-api (Node 22), node-api (Node 24), coverage, and the three golden-cross-platform matrix legs.

Three jobs are deliberately excluded because they cannot gate a PR:

Job Why
bench-smoke if: github.event_name == 'push' — never runs on a PR, so requiring it would block every PR permanently
security continue-on-error on PRs — always reports success there
fidelity-smoke continue-on-error on PRs — always reports success there

Known gap, not addressed here: the existing "advisory on PR, blocking on push to main" policy now fires only after a merge, since nothing else pushes to main. Closing it means dropping those continue-on-error conditions.

main is now protected by a repository ruleset: no direct pushes, no
force-pushes, no deletion, and every change lands through a pull request
with green CI. Release-preparation commits go through a PR too, replacing
the previous direct-to-main release convention.

Store both ruleset payloads under .github/rulesets/ so the protection is
reviewable and re-appliable; GitHub does not sync them from the repository
automatically. The companion tag ruleset makes published v* tags immutable,
since publish-packages.yml builds registry artifacts from the release a tag
produces.

Drop the unused develop branch from the CI triggers.
@snchimata
snchimata merged commit 0e68d24 into main Aug 18, 2026
11 checks passed
@snchimata
snchimata deleted the chore/branch-protection branch August 18, 2026 15:21
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.

1 participant