Skip to content

fix(publish): assert registry content before publish (#71) - #83

Open
srikolagani wants to merge 2 commits into
salesforce:mainfrom
srikolagani:fix/align-language-publish-pins
Open

srikolagani wants to merge 2 commits into
salesforce:mainfrom
srikolagani:fix/align-language-publish-pins

Conversation

@srikolagani

Copy link
Copy Markdown

Pre-publish registry-content fingerprint so internal to OSS sync cannot reuse a version whose dist drifted; complementary to #72 post-publish import smoke. Not a live latest outage. Fixes #71.

@BichengWang BichengWang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed d921e17291030c7d19f1d1a36674b5ddfbf1773f. Validation: 17 offline cases using the unchanged guard and publish.mjs on Node 26.10.0, with workspace discovery/install/publish stubbed and real loopback HTTP/tar extraction. No packages were published; CI Node 22 and the full monorepo suite were not run. Requesting changes for the metadata failure path below.

Comment on lines +62 to +63
} catch {
return null;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Treat only confirmed missing versions as unpublished

This catch returns null for HTTP 500, transport failures, and malformed JSON as well as 404. Lines 106–110 then classify an existing stale package as new, leaving stale empty and exiting successfully.

With unchanged local/registry language dist and a new compiler depending on it through workspace:*, valid mismatched metadata blocks the caller. Changing only the language metadata response to HTTP 500 makes the guard exit 0 and the unmodified publish.mjs reach pnpm -r publish. Curl timeout and malformed JSON also bypass; genuine 404 and matching-content controls pass as expected. If the registry recovers before publishing, the new dependent can be released pinned to the existing stale language version, recreating #71.

Please distinguish confirmed HTTP 404 from other failures and abort on HTTP/transport/parse errors or invalid metadata (including absent dist.tarball). Verified with loopback HTTP and an intercepted publish command; no package was published. The timeout bound was supplied by the test transport, since this curl invocation has none.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

2 participants