[issues/249] Release gating scripts#606
Conversation
…cripts nextTargetVersion was a boolean disguised as a string: the SemVer code path in the QA generators is dead now that lock-version.sh will handle version lock-in. Dropped the field from package.json and hardcoded the Unreleased convention directly into generate-qa-test-plan.sh and generate-release-testing-instructions.sh. Updated qa-suggest SKILL.md to match. Also dropped the boilerplate Phase 0 section (environment setup) from the generated release testing instructions — every contributor already has Node.js/pnpm/gh configured. BATS tests: deleted 4 SemVer-path tests (forward compat is no longer needed), removed the field from 11 fixture JSONs.
Idempotent script that transitions from the deferred "Unreleased" version to a concrete SemVer. Takes an X.Y.Z argument and validates it, then renames qa-test-cases-unreleased.yaml → qa-test-cases-vX.Y.Z.yaml, bumps package.json .version, and regenerates versioned release testing instructions with internal references fixup'd. Detects the already-locked state (.version matches the target + versioned YAML exists) and prints a summary instead of re-running steps, so it's safe to re-run after adding bug-fix TCs during QA. 11 BATS tests cover the happy path, idempotency, error paths, and YAML content preservation.
One-way-door script that finalizes a release after QA passes. Reads .version from package.json (no argument — the version was already locked by lock-version.sh), validates prerequisites (versioned YAML exists, CHANGELOG has [Unreleased] section, README has <sup>Unreleased</sup> markers), then: replaces ## [Unreleased] → ## [X.Y.Z] - YYYY-MM-DD in CHANGELOG, strips all <sup>Unreleased</sup> markers from README, removes the [!IMPORTANT] banner block, formats both files with prettier, and runs generate-publishing-instructions.sh to produce the publishing guide. 7 BATS tests cover the happy path, content preservation, and error paths (missing .version, dirty tree, no versioned YAML, no [Unreleased] section, no markers).
Idempotent script that starts the next development cycle after a release. Reads .version from package.json, copies the versioned QA YAML → qa-test-cases-unreleased.yaml (skip if exists), prepends a fresh ## [Unreleased] header with empty Added/Changed/Fixed sections to CHANGELOG (skip if already present), and re-adds the > [!IMPORTANT] banner before the first ## header in README (skip if already present). Uses head/tail splitting with a fallback for the INSERT_LINE=1 edge case since macOS head -n 0 is illegal. 8 BATS tests cover the happy path, idempotency, partial re-run, YAML content preservation, CHANGELOG structure, banner content, and error paths. Added pnpm scripts for all three release scripts: lock-version, finalize-release, and start-release in the child package.json (alphabetically ordered), with delegating root-level scripts (e.g. pnpm lock-version:vscode-extension X.Y.Z). Updated all documentation references to use root-level pnpm commands instead of direct .sh script names, removed redundant -- separators (pnpm no longer needs them), and eliminated all cd commands from RELEASE-STRATEGY.md examples in favor of root-level pnpm scripts. TESTING.md: rewrote the Release QA Cycle section — consolidated the prose list into the release scripts reference table placed before the Mermaid diagram, replaced the nextTargetVersion filename-mirror sentence with the deferred-version convention, and mapped all commands to pnpm scripts. RELEASE-STRATEGY.md: deleted the "Stripping Markers at Release Time" section (duplicates what the scripts document), updated the High-Level Process with a nested numbered list under Prepare, rewrote Examples 2 & 3 using root-level pnpm scripts, removed the "Release v0.1.1 (Full Process)" Quick Reference, and marked "Release verification scripts" and "Pre-commit hooks" as done in Future Enhancements.
|
Warning Review limit reached
More reviews will be available in 24 minutes and 3 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
WalkthroughThis PR replaces the ChangesRelease Workflow Restructuring
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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.
Actionable comments posted: 6
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.claude/skills/qa-suggest/SKILL.md:
- Line 26: The docs still branch on nextTargetVersion in Step 7 causing
inconsistent filenames/headers despite the tooling using the "Unreleased"
convention; update Step 7 to remove any conditional branching on
nextTargetVersion and standardize on the fixed "Unreleased" naming (e.g.,
qa-test-cases-unreleased.yaml) and header text, and clarify that
package.json.version remains the last published SemVer; search for occurrences
of nextTargetVersion, Step 7, and references to filenames/headers in SKILL.md
and replace them with the single-source "Unreleased" convention and a short note
referencing package.json.version.
In `@docs/RELEASE-STRATEGY.md`:
- Line 139: Update the sentence that currently attributes bumping `.version` to
the `finalize-release` step: change it to assign `.version` updates to the
`lock-version` step so the text reads that `pnpm
finalize-release:vscode-extension` performs hard-finalize (updates CHANGELOG,
strips README markers, generates publishing instructions) while `lock-version`
is responsible for bumping/locking `.version`; reference the task names
`finalize-release` and `lock-version` and the `.version` file in the updated
sentence to make ownership explicit.
In `@packages/rangelink-vscode-extension/scripts/finalize-release.sh`:
- Around line 70-80: The release scripts use BSD-only sed in-place syntax (sed
-i '') which breaks on GNU sed; update finalize-release.sh (the sed calls that
edit "$CHANGELOG" and "$README") and lock-version.sh (the multi -e sed in-place
rewrite) to perform portable in-place edits by writing sed output to a temporary
file and atomically moving it back (or use sed -i.bak then remove the backup)
instead of relying on '' argument; locate the specific sed invocations in
finalize-release.sh and the multi -e sed block in lock-version.sh and replace
each in-place sed invocation with the temp-file + mv (or sed -i.bak + rm)
pattern so the scripts work on both BSD and GNU environments.
In `@packages/rangelink-vscode-extension/scripts/lock-version.sh`:
- Around line 67-70: The script currently exits if the UNRELEASED_YAML file is
missing; change that check to allow partial-run recovery by first testing for
any existing versioned YAML (e.g., files matching qa-test-cases-v*.yaml) before
failing: if UNRELEASED_YAML is missing but a versioned file exists, treat that
as a successful prior run and continue (skip the hard exit), otherwise keep the
error and exit; update the conditional around UNRELEASED_YAML to look for
matching versioned files (using the UNRELEASED_YAML variable and a glob like
"${UNRELEASED_YAML%unreleased.yaml}-v"*" .yaml" or explicit pattern) and only
call exit 1 when neither the unreleased nor any versioned file is present.
In `@packages/rangelink-vscode-extension/scripts/start-release.sh`:
- Around line 69-71: The numeric test uses INSERT_LINE (set by grep -n) without
guarding for an empty value; if grep finds no match INSERT_LINE is empty and the
[[ "$INSERT_LINE" -eq 1 ]] test will fail at runtime. Fix by validating
INSERT_LINE before numeric comparison (e.g., check [[ -n "$INSERT_LINE" ]] or
use a regex/ctype test) and only perform -eq when INSERT_LINE is numeric; update
the same pattern around the other occurrence (the block around INSERT_LINE usage
at the later section) so both places guard against empty/non-numeric
INSERT_LINE.
In `@packages/rangelink-vscode-extension/TESTING.md`:
- Line 282: Update the YAML rename ownership text so both statements reference
the same script: replace the mention of finalize-release with pnpm
lock-version:vscode-extension in this section (the line that currently ties
version locking to pnpm lock-version:vscode-extension is correct—ensure the
other sentence(s) that claim finalize-release performs the rename instead point
to pnpm lock-version:vscode-extension) and keep the note that the filename
during trunk development is qa-test-cases-unreleased.yaml and that
generate-qa-issue parses it automatically.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: dae4fb4f-1227-402b-be39-e54dcf208536
📒 Files selected for processing (15)
.claude/skills/qa-suggest/SKILL.mddocs/RELEASE-STRATEGY.mdpackage.jsonpackages/rangelink-vscode-extension/TESTING.mdpackages/rangelink-vscode-extension/package.jsonpackages/rangelink-vscode-extension/scripts/finalize-release.shpackages/rangelink-vscode-extension/scripts/generate-qa-test-plan.shpackages/rangelink-vscode-extension/scripts/generate-release-testing-instructions.shpackages/rangelink-vscode-extension/scripts/lock-version.shpackages/rangelink-vscode-extension/scripts/start-release.shtests/shell/finalize-release.batstests/shell/generate-qa-test-plan.batstests/shell/generate-release-testing-instructions.batstests/shell/lock-version.batstests/shell/start-release.bats
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…guards Corrected several places that attributed .version bumping and YAML renaming to finalize-release when lock-version performs those steps. Replaced BSD-only sed -i '' with portable sed -i.bak + rm .bak in finalize-release.sh and lock-version.sh. Added INSERT_LINE guard and partial-run recovery to start-release.sh and lock-version.sh. Benefits: - Scripts work on both macOS (BSD sed) and Ubuntu CI (GNU sed) - Docs accurately reflect which script owns each release step - Lock and start scripts handle edge cases (empty grep results, partial prior runs) - SKILL.md no longer references the removed nextTargetVersion field Ref: #606 (review)
✅ CI / Integration Tests (with extensions) — run summary
|
✅ CI / Test & Validate — run summary
|
Summary
Closes the deferred-version loop from PR #605. Adds three release gating scripts that form a pipeline — soft-lock a version for QA, hard-finalize when QA passes, start the next cycle — and wires them into root-level
pnpmscripts. Removes thenextTargetVersionfield since the "Unreleased" convention is embedded in the scripts.Changes
lock-version.sh— idempotent soft-lock (rename YAML, bump.version, regenerate versioned instructions). 11 BATS tests.finalize-release.sh— one-way-door hard-finalize (CHANGELOG, README markers/banner, publishing instructions). 7 BATS tests.start-release.sh— idempotent next-cycle setup (copy YAML, prepend CHANGELOG header, re-add README banner). 8 BATS tests.nextTargetVersionfrompackage.json; simplifiedgenerate-qa-test-plan.sh,generate-release-testing-instructions.sh, andqa-suggestSKILL.md to always-on Unreleased mode.pnpmscripts for all three (pnpm lock-version:vscode-extension X.Y.Z, etc.); examples no longercdinto package directories.Test Plan
grep -r "nextTargetVersion"returns nothing in source files (scripts, package.json)Related
2.0.0release #249Summary by CodeRabbit
Release Notes
Documentation
Tests
Chores