Compare commits

..
Author SHA1 Message Date
Kevin CodexandClaude Opus 5.5 208918f699 ci(coderabbit): make Release-As releases explicit in the release check
The release check claimed a Release-As footer could override the bump
rule, but CodeRabbit's pre-merge checker cannot see commit footers, so a
forced-version release would fail with no stated way through. It now
names both versions and says a maintainer must ignore the check for
such a release.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-04 10:43:23 +08:00
Kevin CodexandClaude Opus 5.5 f94c9cc830 ci(coderabbit): decide the release check from the title and diff only
CodeRabbit's pre-merge checker does not receive the head branch name,
the PR body, or GitHub Check results. On #29 it reported the release
check as inconclusive for that reason, and an inconclusive check does
not block approval, so on a real release PR the gate would have done
nothing.

Scope is now decided from what the checker sees: a PR is a release PR
when its title starts with "chore(main): release" or its diff changes
the package version or the release-please manifest. Either signal is
enough, so a retitled release PR still fails on its title. The body and
GitHub Checks items are removed because the checker cannot evaluate
them; CI stays covered by required status checks and by the release
workflow's own gate. An item that still cannot be decided now fails
instead of reporting inconclusive.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-04 10:32:44 +08:00
Kevin CodexandClaude Opus 5.5 173fbb7073 ci(coderabbit): count every non-feature changelog section as a fix
The bump-level item only mapped "Bug Fixes" and "Performance
Improvements" to a fix, so a revert-only release, which release-please
cuts as a patch with a "Reverts" section, would have been rejected.
release-please bumps the patch for any releasable change that is not a
feature or breaking, so every other section now counts as a fix.

Addresses CodeRabbit's third review on #29.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-04 10:21:17 +08:00
Kevin CodexandClaude Opus 5.5 fb238621bf ci(coderabbit): validate the release PR body and every check conclusion
release-please finds a merged release PR by parsing its body: the `---`
delimiters and a release-notes heading that names the version. A body
edited out of that layout can leave the merge without a tag, GitHub
release, or npm publish, so the release check now fails it.

The checks item now fails any completed check whose conclusion is not
success, neutral, or skipped, which adds action_required and stale.
Pending or absent checks still do not fail it.

Addresses CodeRabbit's second review on #29.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-04 10:09:35 +08:00
Kevin CodexandClaude Opus 5.5 3da783fa8b ci(coderabbit): select release PRs by branch, not title
The release check treated a PR as a release only when both its head
branch and its title matched, so editing a release PR's title skipped
every validation and the check passed. Release PRs are now selected by
the release-please head branch alone, and a malformed title fails the
check as its own item. NEW now comes from package.json at the PR head.

Addresses CodeRabbit's review on #29.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-04 09:59:39 +08:00
Kevin CodexandClaude Opus 5.5 b253c2d2aa ci(coderabbit): let CodeRabbit approve PRs and gate release PRs
Move from the deprecated reviews.request_changes_workflow to
reviews.auto_approvals.enabled. CodeRabbit reads the old key as an
alias, and setting both keys to different values turns approvals off.

Release-please PRs publish to npm when merged, so a blocking
"npm release PR validated" check runs on them: only the release files
change, the version agrees everywhere, the bump fits the changelog, and
no GitHub Check failed. Stop ignoring github-actions[bot], which opens
those PRs and was why CodeRabbit skipped them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-04 09:47:45 +08:00
+29 -3
View File
@@ -5,8 +5,13 @@ tone_instructions: "Be direct and prioritize actionable correctness, safety, CLI
reviews:
profile: "chill"
# Allow explicit @coderabbitai approve / resolve commands to submit review verdicts.
request_changes_workflow: true
# CodeRabbit requests changes for blocking findings and approves the PR once
# they are resolved, the latest commit is reviewed, and every pre-merge check
# below passes. This is the current key for the deprecated
# request_changes_workflow; setting both keys turns approvals off. Explicit
# @coderabbitai approve / resolve commands keep working.
auto_approvals:
enabled: true
high_level_summary: true
poem: false
# Avoid noisy "review skipped" status comments when CodeRabbit decides not to run.
@@ -32,6 +37,26 @@ reviews:
- path: "**/*.go"
instructions: |
Do not request Plan 9 or other unsupported GOOS/GOARCH shims. The five native prebuilt release targets are linux-x64, linux-arm64, macos-arm64, macos-x64, and windows-x64. Android/Termux is also a supported runtime through the documented android-arm64 source build and Linux artifact fallback. Other GOOS/GOARCH combinations are not a review criterion.
pre_merge_checks:
custom_checks:
- name: "npm release PR validated"
mode: "error"
instructions: |
Merging a release PR publishes the package to npm, so CodeRabbit approves one only after this check passes.
Decide every item from the PR title and the diff alone. This check does not receive the head branch name, the PR body, or GitHub Check results, so no item depends on them. If an item still cannot be decided from the title and the diff, fail it and say what was missing; never report this check as inconclusive.
Scope: a PR is a release PR when its title starts with `chore(main): release`, or when its diff changes `version` in `package.json` or any value in `.release-please-manifest.json`. Either signal is enough, so editing the title does not take a release PR out of scope. Every other PR passes this check; say "Not a release PR."
For a release PR, NEW is `version` in `package.json` after the change, and PREVIOUS is the `"."` value of `.release-please-manifest.json` before the change. The check passes only when all of the following hold. When it fails, list each failed item with the file and the value found.
1. Title: the title is exactly `chore(main): release NEW`. A malformed or edited title fails this item; quote it.
2. Changed files: the diff touches only `package.json`, `package-lock.json`, `.release-please-manifest.json`, and `CHANGELOG.md`. Any other path fails, whether source, tests, workflows, scripts, dependency manifests, or lockfiles.
3. One version everywhere: NEW equals the top-level `version` and `packages[""].version` in `package-lock.json`, and the `"."` value in `.release-please-manifest.json`.
4. Version-only edits: in `package.json` only the `version` line changes, in `package-lock.json` only the two root version fields change, and in `.release-please-manifest.json` only the `"."` value changes. No dependency, `engines`, `files`, `bin`, `exports`, or `scripts` change is allowed.
5. Valid increment: NEW is a plain MAJOR.MINOR.PATCH with no prerelease or build suffix, and it is greater than PREVIOUS.
6. Bump level: this repo uses release-please defaults, without `bump-minor-pre-major`. A breaking change bumps MAJOR, even from 0.x to 1.0.0. A feat bumps MINOR and resets PATCH, and a fix bumps PATCH. Read the change types from the new CHANGELOG section: a "BREAKING CHANGES" heading means a breaking change, "Features" means a feat, and every other section, such as "Bug Fixes", "Performance Improvements", "Reverts", or "Dependencies", counts as a fix. NEW must be exactly the next version for the highest change type present. This check cannot see commit footers, so it cannot confirm a `Release-As:` override. When NEW differs from the version these rules give, fail this item and name both versions; a release forced with `Release-As:` passes only when a maintainer ignores this check.
7. Changelog: `CHANGELOG.md` gains exactly one new section, at the top, headed `## [NEW](https://github.com/Twigpine/zero/compare/vPREVIOUS...vNEW) (YYYY-MM-DD)`, with at least one entry. Everything below it is unchanged, so no earlier section is edited or removed.
tools:
github-checks:
timeout_ms: 300000
@@ -46,10 +71,11 @@ reviews:
- "[skip review]"
labels:
- "!do-not-review"
# github-actions[bot] is not ignored on purpose: it opens the release-please
# PRs, and the "npm release PR validated" check has to run on them.
ignore_usernames:
- "dependabot[bot]"
- "renovate[bot]"
- "github-actions[bot]"
# CodeRabbit reviews default-branch PRs by default. This extends automatic
# reviews to PRs targeting any branch, including release and stacked branches.
base_branches: