Fix: make release guards consume release profile#698
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughWalkthroughAdds a YAML-backed release-profile CLI, uses it to derive required release-doc paths and version lockstep checks, and routes release-guard and docs-topology scripts through the new commands. Tests cover profile loading, doc paths, and version drift. ChangesRelease profile-driven guards
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Release Preflight
If this PR is from a |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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 `@scripts/check-docs-topology.sh`:
- Line 5: The REQUIRED_DOCS population in check-docs-topology.sh currently
trusts the output of node scripts/release-profile.ts required-docs without
verifying whether the command succeeded, which can leave the array empty and
skip validation; update the script to check the CLI exit status (or otherwise
fail fast) before using REQUIRED_DOCS, and ensure the topology check aborts with
a clear error if the release-profile command fails.
In `@scripts/release-guard.sh`:
- Around line 391-396: The release-doc check in the `required-docs` loop can
incorrectly pass when `node scripts/release-profile.ts required-docs` fails,
because the process substitution yields no paths and `missing` stays zero.
Update the release guard logic around the `while IFS= read -r path; do ... done`
block to capture the command’s exit status (or otherwise verify generation
succeeded) and fail the script immediately if `required-docs` cannot be
produced, so `REL-DOC-EVIDENCE` does not pass on a broken
`release-profile.ts`/CLI path.
In `@scripts/release-profile.ts`:
- Around line 145-160: The glob handling in expandVersionSourcePaths is still
hardcoded to a single repo-specific pattern, which defeats the profile-driven
design. Update the function to stop special-casing packages/*/package.json and
instead resolve supported version-source globs from the ReleaseVersionSource
data/profile itself, using expandVersionSourcePaths and the ReleaseProfileError
path only for truly unsupported patterns. Keep the directory scanning logic
generic enough that future profile-owned glob changes do not require code edits.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 69a0216b-a7fc-4d19-9251-46215db16abf
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (6)
.continuum/release.ymlpackage.jsonscripts/check-docs-topology.shscripts/release-guard.shscripts/release-profile.tstest/unit/scripts/release-profile.test.ts
Release Preflight
If this PR is from a |
Summary
.continuum/release.ymlreader for release profile mechanicsscripts/release-guard.shvalidate version sources and release docs from the profile instead of duplicated shell arraysscripts/check-docs-topology.shderive current docs from the profile and topic shelfyamldirectly and test release-profile doc/version drift behaviorCloses #689.
Part of #693.
Validation
npx vitest run test/unit/scripts/release-profile.test.tsnpx vitest run test/unit/scripts/release-profile.test.ts test/unit/scripts/source-size-inventory-command.test.ts test/unit/scripts/pre-push-hook.test.tsnpm run typechecknpm run lintnpm run lint:docs-topologynpm run release:guard -- --stage prep-prSummary by CodeRabbit