fix: release config script validation and broken postbump#825
fix: release config script validation and broken postbump#825carlos-alm merged 5 commits intomainfrom
Conversation
The postbump referenced sync-native-versions.js which does not exist (only .ts exists). The npm version lifecycle in package.json already handles native version syncing correctly via node-ts.js, making this entry both redundant and broken. Closes #823
Add Step 7b to the release skill that verifies all script references in .versionrc.json and package.json lifecycle hooks point to files that actually exist. Also fix .js → .ts reference in the skill docs. Prevents the class of review comments seen on #822 where broken script paths went undetected until reviewers caught them.
|
Claude finished @carlos-alm's task —— View job PR Review CompleteReviewing PR #825: fix: release config script validation and broken postbump Todo List
Root Cause AnalysisProblem Being Solved: The Why This Approach: The fix is correct — removing the broken/redundant script and adding validation to prevent future occurrences. The Risk Assessment: Low risk. This is removing a broken feature, not introducing new logic. The validation step is defensive and preventive. Backlog Compliance
Critical ConcernsNone. This is a clean, well-motivated fix. Code Quality AssessmentPositive aspects:
Technical review:
No concerns with:
Final Recommendation
The PR correctly identifies that |
Greptile SummaryThis PR adds a Step 7b validation block to the Confidence Score: 5/5Safe to merge — documentation-only change with no runtime code affected. All changes are in a skill documentation file. The previously raised P1 about forwarded script validation has been addressed. The grep patterns correctly extract and validate both the runner and the forwarded argument. No logic or runtime code is modified. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Step 7b: Validate release config scripts] --> B[Scan .versionrc.json for node references]
B --> C[Extract runner argument]
C --> D[Extract forwarded script argument]
D --> E{Both files exist?}
E -- no --> F[Print ERROR and stop]
E -- yes --> G[Scan package.json version lifecycle hooks]
G --> H[Extract runner argument]
H --> I[Extract forwarded script argument]
I --> J{Both files exist?}
J -- no --> K[Print ERROR and stop]
J -- yes --> L[All refs valid - proceed to Step 8]
Reviews (2): Last reviewed commit: "fix(skills): validate forwarded script a..." | Re-trigger Greptile |
| grep -oP 'node \K[^ "]+' .versionrc.json 2>/dev/null | while read script; do | ||
| [ ! -f "$script" ] && echo "ERROR: .versionrc.json references '$script' but it does not exist" | ||
| done | ||
|
|
||
| # package.json — check version/preversion/postversion lifecycle hooks | ||
| grep -E '"(pre)?version"|"postversion"' package.json | grep -oP 'node \K[^ "&]+' | while read script; do | ||
| [ ! -f "$script" ] && echo "ERROR: package.json lifecycle references '$script' but it does not exist" |
There was a problem hiding this comment.
Step 7b only validates the runner, not the target script
Both grep patterns extract only the first token after node (e.g. scripts/node-ts.js), so the actual .ts file passed as the second argument (scripts/sync-native-versions.ts) is never checked. A broken reference like node scripts/node-ts.js scripts/non-existent.ts would pass the validation silently because node-ts.js exists.
To also validate the forwarded script, extend the capture to the second argument when the runner is node-ts.js:
# package.json — check version/preversion/postversion lifecycle hooks
grep -E '"(pre)?version"|"postversion"' package.json | grep -oP 'node \K[^ "&]+' | while read script; do
[ ! -f "$script" ] && echo "ERROR: package.json lifecycle references '$script' but it does not exist"
# Also check the forwarded script when using node-ts.js
if [[ "$script" == *node-ts.js* ]]; then
forwarded=$(grep -oP "$script \K[^ \"&]+" package.json 2>/dev/null | head -1)
[ -n "$forwarded" ] && [ ! -f "$forwarded" ] && echo "ERROR: package.json lifecycle references '$forwarded' but it does not exist"
fi
doneThere was a problem hiding this comment.
Fixed — added a second grep pass for both .versionrc.json and package.json that extracts the forwarded script argument (the second token after node <runner>). Now node scripts/node-ts.js scripts/non-existent.ts would be caught because both scripts/node-ts.js and scripts/non-existent.ts are validated independently.
Summary
postbumpscript from.versionrc.jsonthat referenced non-existentsync-native-versions.js(only.tsexists). The npmversionlifecycle inpackage.jsonalready handles native version syncing correctly vianode-ts.js, making this entry both redundant and broken/releaseskill that validates all script references in.versionrc.jsonandpackage.jsonlifecycle hooks point to files that actually exist, preventing this class of issue from recurring.js→.tsreference in the release skill docsCloses #823
Test plan
npm run release:dry-runsucceeds without the removed postbumppackage.jsonversionlifecycle still syncs native versions correctly/release