Repository navigation
fix(release): make the npm publish loop re-dispatchable - #212
Conversation
|
Stellar review: no review-relevant changes (docs/CI-only diff). ✅ |
|
Rust review: no rust-relevant changes (no Rust files modified). ✅ |
| # the message, and it must still fail closed. | ||
| if out="$(npm publish "./$tgz" "${args[@]}" 2>&1)"; then | ||
| printf '%s\n' "$out" | ||
| elif printf '%s\n' "$out" | grep -qiE 'cannot publish over|EPUBLISHCONFLICT'; then |
There was a problem hiding this comment.
[Low] Integrity: the conflict-skip accepts whatever copy of that version is already on the registry — it never checks that copy matches the tarball the job just attestation-verified.
Why this matters: EPUBLISHCONFLICT / "cannot publish over" only proves a version number exists, not that it is this artifact; a party able to publish to the scope (compromised maintainer token) gets its version kept live while the release reports success and no post-publish npm view check exists to notice.
Suggested fix: on the skip arm, compare the local tarball's sha512 against the registry's dist.integrity (e.g. npm view "<name>@<version>" dist.integrity) and fail closed on mismatch.
|
Security review (security-review skill) The skill reviewed the composite npm-publish action and the publishing doc change: the publish loop now captures npm output and skips tarballs whose version the registry rejects as already published, so an interrupted release can be re-dispatched. No secrets, credentials, auth changes, new dependencies, or new input surfaces are introduced; the change is confined to the release pipeline and still fails closed on unexpected errors. One low-severity release-integrity gap is noted inline: the skip trusts the registry's existing artifact without comparing it to the locally verified tarball.
Security review: ✅ no issues found |
Oplane Security ReviewOplane reviewed this PR and did not identify any security requirements that need attention. Review the generated threat model. Change comment settings · Set up Oplane in your agent · Workflow guidance |
| if out="$(npm publish "./$tgz" "${args[@]}" 2>&1)"; then | ||
| printf '%s\n' "$out" | ||
| elif printf '%s\n' "$out" | grep -qiE 'cannot publish over|EPUBLISHCONFLICT'; then | ||
| echo "$(basename "$tgz"): version already on the registry — skipping" |
There was a problem hiding this comment.
[Low] Supply chain / release integrity: the version-exists skip accepts whatever artifact the registry already holds without comparing it to the locally verified tarball.
Why this matters: the docs now direct maintainers to re-dispatch a failed publish, and if the tarballs were rebuilt at the same version between attempts, the job reports success while the registry keeps serving the older bytes; the skip is also driven by a substring of npm's combined output, so an unrelated failure that echoes that text exits 0 instead of failing the job.
Suggested fix: gate the skip on an identity check, e.g. compare npm view "$pkg@$ver" dist.integrity (sha512) with the tarball's digest and skip only on a match; otherwise fail.
Spec-harness coverage — 🟡
Rerun |
Summary
Fix: the npm-publish action's loop failed the whole job on the first
already-published tarball, so an interrupted npm leg could never be
re-dispatched — the runbook's recovery note said to finish the remaining
tarballs manually. The loop now skips a tarball the registry rejects as a
republish, the same arm the crates.io loop carries (#189). This is what
strands
@relate/relate1.0.0 today: in publish run 43094992373 theplatform's job-completion lag closed the run before the queued
npm-mainjob ran, and a plain re-dispatch would have E403'd on the six published
tarballs and failed again.
Changes
npm-publish/action.yml: eachnpm publishattempt is captured —success prints npm's output; a republish rejection
(
cannot publish over/EPUBLISHCONFLICT, case-insensitive)logs a per-tarball skip and continues; anything else prints the
captured output and fails closed. The pattern is deliberately
narrow to the republish wording: an auth 403 shares the error code
but not the message, and must still fail the job
docs/PUBLISHING.md: the "re-running hits E403 — publish theremaining tarballs manually" note replaced with the re-dispatch
recipe
Verification
against a stubbed npm: all-already-published → 3 skips, exit 0;
mixed → 2 skips + 1 publish, exit 0; auth 403 (same E403 code,
different message) → exit 1 with the registry's message preserved;
the expected-count check still fails closed unchanged
action.ymlparses;bash -nclean on the extracted scriptpattern / no sensitive data in logged output), both graded
IMPLEMENTED with per-case file:line evidence
six published tarballs,
npm-mainpublishes@relate/relate1.0.0This description was auto generated.