Skip to content

fix(release): guard public install/version snippets (#3767)#3779

Merged
Hmbown merged 1 commit into
mainfrom
codex/0866-3767-install-version-guard
Jun 29, 2026
Merged

fix(release): guard public install/version snippets (#3767)#3779
Hmbown merged 1 commit into
mainfrom
codex/0866-3767-install-version-guard

Conversation

@Hmbown

@Hmbown Hmbown commented Jun 29, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #3767. prepare-release.sh / check-versions.sh only updated/guarded README --tag vX.Y.Z examples, so the user-facing codewhale --version # X.Y.Z lines and the docs/INSTALL.md npm-wrapper publish pointer could drift while the gate stayed green (on the 0.8.66 candidate, INSTALL.md still said 0.8.65 while check-versions.sh passed).

Changes

  • prepare-release.sh now bumps codewhale --version # <version> across README*.md + docs/INSTALL.md, and the docs/INSTALL.md "wrapper is published at vX.Y.Z" sentence. The v0.8.56 minimum-wrapper floor is preserved.
  • check-versions.sh now fails when any of those snippets drift from the workspace version. Narrowly scoped to those two snippet shapes to avoid flagging unrelated historical prose (e.g. "as of vX").

Validation (on this branch @ main 0.8.65)

  • ./scripts/release/check-versions.shVersion state OK, exit 0.
  • Negative: drifting a README --version comment → ::error:: ... not on 0.8.65, exit 1; reverted.
  • prepare-release.sh bump regexes unit-checked for the next version (and preserve the v0.8.56 floor).

Acceptance criteria

  • prepare-release.sh updates README + INSTALL.md --version comments
  • prepare-release.sh updates the INSTALL.md wrapper-published-at sentence
  • check-versions.sh fails when those snippets drift
  • Passes only after install docs align
  • Guard is scoped (no brittleness on unrelated prose)

`prepare-release.sh` and `check-versions.sh` only updated/guarded README
`--tag vX.Y.Z` examples, so the user-facing "verify your install" lines
(`codewhale --version   # X.Y.Z`) and the docs/INSTALL.md npm-wrapper publish
pointer could go stale while the release gate still reported green. On the
0.8.66 candidate, docs/INSTALL.md still said 0.8.65 while check-versions passed.

- `prepare-release.sh` now bumps `codewhale --version   # <version>` across
  README*.md and docs/INSTALL.md, and the docs/INSTALL.md "wrapper is published
  at vX.Y.Z" sentence (the v0.8.56 minimum-wrapper floor is preserved).
- `check-versions.sh` now fails when any of those snippets drift from the
  workspace version. Narrowly scoped to those two snippet shapes to avoid
  flagging unrelated historical prose ("as of vX").

Fixes #3767
@Hmbown Hmbown added this to the v0.8.66 milestone Jun 29, 2026
@claude

claude Bot commented Jun 29, 2026

Copy link
Copy Markdown

Claude finished @Hmbown's task in 1m 58s —— View job


Code Review — PR #3779

  • Gather context (read diff + surrounding files)
  • Review changes
  • Post findings

Summary

Solid, narrowly scoped fix for a real drift failure mode. The check-versions.sh guard and prepare-release.sh bump logic are both correct in practice, but there is one dead variable in check-versions.sh that is also structurally incorrect for the actual file layout — worth cleaning up before it misleads a future reader.


Findings

1. stale_wrapper_pointer is dead code — and would always be a false negative (check-versions.sh, line 196)

stale_wrapper_pointer="$(grep -nE -- "wrapper is published at" docs/INSTALL.md \
  | grep -E -- "v[0-9]+\.[0-9]+\.[0-9]+" \
  | grep -v -- "v${workspace_version}" || true)"
# The publish pointer can wrap onto the next line; also scan the line after the lead-in.
wrapper_pointer_version="$(grep -A1 -E -- "wrapper is published at" docs/INSTALL.md \
  | grep -oE -- "v[0-9]+\.[0-9]+\.[0-9]+" | head -n1 || true)"
if [[ -n "${wrapper_pointer_version}" && ... ]]; then

stale_wrapper_pointer is never read after this point — the actual gate is the wrapper_pointer_version block below. More importantly, the single-line grep approach used for stale_wrapper_pointer would always be empty given the real file layout:

# docs/INSTALL.md lines 129-130
npm is the recommended install path. The `codewhale` wrapper is published at
v0.8.65 (Node 18+; wrapper available for v0.8.56 and later).

The version is on the next line, so grep "wrapper is published at" | grep "v[0-9]+..." always finds nothing. The grep -A1 approach in wrapper_pointer_version correctly handles this. The variable should be removed.

Fix this →

2. No file-existence guard before the wrapper pointer checks (check-versions.sh, lines 196-202)

The --version comment loop at line 186 guards with [[ -f "${doc}" ]] || continue. The wrapper-pointer block below it has no such guard — if docs/INSTALL.md is absent, both greps return nothing (saved by || true), wrapper_pointer_version is empty, and the check silently passes. The behavior is consistent with the loop but not explicit. A quick [[ -f docs/INSTALL.md ]] || { echo "::warning::..." ; } or a guard before the block would make intent clear. (Low priority — the file is committed and unlikely to disappear, but worth a note if the guard philosophy is explicit file checks.)


Good choices

  • The ([^0-9]|$) negative-lookahead-equivalent in the exclusion grep correctly prevents 0.8.650 matching 0.8.65. Well-considered.
  • prepare-release.sh uses Python \s+ (not .+) in the wrapper-pointer pattern, so the newline between "published at" and "v0.8.65" is transparently handled and the line break is preserved in the replacement.
  • Hard exit (sys.exit) on zero replacements for both the --version comment block and the wrapper pointer bump means the release script fails loudly on format drift rather than silently producing an unbumped file.
  • || true is correctly placed to prevent set -euo pipefail from killing the script when grep returns 1 for no matches.
  • Scope is narrow; historical prose like "as of v0.8.xx" is not flagged.

Verdict: One real issue (dead variable that would also silently never fire if it were used). Everything else is correct. The fix is a one-line deletion in check-versions.sh.

@Hmbown Hmbown merged commit 6a60fe7 into main Jun 29, 2026
19 checks passed
@Hmbown Hmbown deleted the codex/0866-3767-install-version-guard branch June 29, 2026 16:55
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.

v0.8.66: Guard install-doc version snippets in release bump checks

1 participant