fix(release): tolerate missing baseline package versions#126
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a fallback mechanism for the update baseline version in the install smoke tests, allowing the script to select an alternative published version if the requested one is unavailable or skip the update lane gracefully if no baseline exists. Feedback focuses on improving the robustness of the version resolution by using stdin for Node.js processing to avoid command-line length limits and refining the fallback selection logic to ensure it strictly tests upgrades rather than potential downgrades.
|
|
||
| resolve_update_baseline_version() { | ||
| local versions_json | ||
| versions_json="$(quiet_npm view "$PACKAGE_NAME" versions --json 2>/dev/null || true)" |
There was a problem hiding this comment.
Passing the output of npm view directly as a command-line argument to node -e can be risky if the package has a very large number of versions, as it might exceed the maximum command-line length limit (ARG_MAX). A safer approach would be to pipe the JSON string to stdin and read it within the Node.js script.
| process.stdout.write(requested); | ||
| process.exit(0); | ||
| } | ||
| const fallback = [...versions].reverse().find((value) => value !== expected) ?? ""; |
There was a problem hiding this comment.
The fallback logic currently picks the most recently published version that is not the expected version. While this is generally correct, it doesn't guarantee that the fallback is older than the current version. If a newer version was published from another branch, the update smoke test would effectively be testing a downgrade. Consider filtering for versions that are semantically older than the expected version if the intent is strictly an upgrade test.
Summary
./scripts/release-npm.shcould fail in the final install-smoke stage whenscripts/test-install-sh-docker.shtried to pack a hard-coded baseline version that was never published for the QVerisBot fork.@qverisai/qverisbot@2026.4.10does not exist on npm yet.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause (if applicable)
scripts/test-install-sh-docker.shassumed the configured baseline version already existed on npm and unconditionally rannpm pack "${PACKAGE_NAME}@${UPDATE_BASELINE_VERSION}", which is false for the fork's unpublished historical versions.Regression Test Plan (if applicable)
test/scripts/test-install-sh-docker.test.tsUser-visible / Behavior Changes
None for end users.
Release behavior changes:
Diagram (if applicable)
Security Impact (required)
No)No)No)No)No)Yes, explain risk + mitigation: N/ARepro + Verification
Environment
24.2.0,pnpm, Docker-based install smoke script@qverisai/qverisbot2026.4.10, but that version is not published for the fork packageSteps
./scripts/release-npm.shon the fork.@qverisai/qverisbot@2026.4.10and fail withnpm ERR! code ETARGET.Expected
Actual
Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
bash -n scripts/test-install-sh-docker.shandnode scripts/run-vitest.mjs run test/scripts/test-install-sh-docker.test.ts./scripts/release-npm.shthrough Docker publish smoke after this patch.Review Conversations
Compatibility / Migration
Yes)No)No)Risks and Mitigations