fix(update): match Release Please component-prefixed tags in releases-API fallback#926
fix(update): match Release Please component-prefixed tags in releases-API fallback#926maxmilian wants to merge 1 commit into
Conversation
…-API fallback The releases-API version fallback in update-system.mjs parsed release.tag_name with /^v?(\d+\.\d+\.\d+)$/, but Release Please tags this repo's releases as `career-ops-v1.9.0`, which never matches the `^v?` anchor. So when the raw VERSION host is unreachable but api.github.com is, check() reports `no-remote-version` instead of falling back — the fallback was effectively dead code. Relax the anchor to `(?:^|-)v?` so the component prefix is stripped (changelog extraction was already fine; only the version-from-tag path was dead). To cover this in test-all.mjs, hoist and export SEMVER_RE and add an import.meta.url guard around MAIN (mirroring followup-cadence.mjs) so importing the module for assertions doesn't trigger a live update check. Fixes santifer#923 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Welcome to career-ops, @maxmilian! Thanks for your first PR. A few things to know:
We'll review your PR soon. Join our Discord if you have questions. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR fixes a dead-code path in ChangesUpdate system semver parsing and import safety
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested labels
🚥 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 |
What does this PR do?
update-system.mjs check()has two version sources: the rawVERSIONfile URL and the GitHub releases API as fallback. The fallback parsedrelease.tag_namewith/^v?(\d+\.\d+\.\d+)$/, but Release Please tags this repo's releases with the component prefix —career-ops-v1.9.0— which never matches the^v?anchor.So when the raw
VERSIONhost is unreachable butapi.github.comis,check()reportedno-remote-versioninstead of falling back: the releases-API version path was effectively dead code (changelog extraction fromrelease.bodyalready worked — only the version-from-tag path was dead).Fix: relax the anchor to
(?:^|-)v?so the component prefix is stripped (career-ops-v1.9.0→1.9.0), while plainv1.9.0/1.9.0tags keep working and non-semver input is still rejected.To cover this in
test-all.mjs,SEMVER_REis hoisted to module scope and exported, and animport.meta.urlguard now wrapsMAIN(mirroringfollowup-cadence.mjs) so importing the module for assertions doesn't trigger a live update check. No module currently importsupdate-system.mjs, and the existing CLI smoke test (update-system.mjs check, section 1) still passes.Related issue
Fixes #923
Type of change
Checklist
node test-all.mjslocally (219 passed, 0 failed)update-system.mjs,test-all.mjs)🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
career-ops-v1.9.0), while maintaining backward compatibility with standard semver formats likev1.9.0.Tests