fix(release): publish the FFI tarballs by path, not GitHub shorthand - #921
Conversation
The first 2.0.0 release attempt failed in `Publish FFI packages` on the
very first tarball:
npm error command git --no-replace-objects ls-remote
ssh://git@github.com/ffi-dist/cipherstash-protect-ffi-darwin-arm64-0.32.0.tgz.git
`npm publish` was handed the bare relative path
`ffi-dist/<name>.tgz`, and npm's spec parser classifies an
`owner/repo`-shaped argument as a GitHub shorthand before it considers
it a file — so it tried to clone a repository named after the tarball
and died on SSH auth. A spec is only treated as a local tarball when it
starts with `./`, `../`, `/` or `file:`.
Prefix the path with `./`. Nothing else in the step is affected: the
`tar` reads and `npm view` probes never used the path as a package
spec. Trusted publishing was never exercised by the failure — the run
died before npm talked to the registry — so this fix is necessary for
the next release attempt but not yet proven sufficient; check
`npm trust list` on the seven packages before retrying (AGENTS.md,
"Publishing has moved here").
Note the workflow filename must not change: npm trusted publishing for
all seven FFI packages binds to (repository, workflow filename).
|
freshtonic
left a comment
There was a problem hiding this comment.
Approve. Correct diagnosis, minimal fix, and the failure log itself is the proof: npm literally attempted git ls-remote ssh://git@github.com/ffi-dist/cipherstash-protect-ffi-darwin-arm64-0.32.0.tgz.git, which is unambiguously the owner/repo shorthand misparse. The ./ prefix is the documented way npm-package-arg distinguishes a file spec (./, ../, /, file:) from a hosted-git shorthand.
What I verified:
$tgzis always the bare misparse-prone shape: it comes from theffi-dist/*.tgzglob, so every iteration produced exactly thedir/file.tgzform npm classifies as GitHub shorthand../$tgzfixes every path through the loop — platform packages and wrapper alike.- Nothing else in the step uses the path as a package spec, as the PR body claims:
meta()'star xzOf "$1"takes a filesystem path, andnpm viewtakesname@version. This is the onlynpm publishin any workflow (grepped.github/), so there's no second copy of the bug waiting inffi-preflight.ymlor elsewhere. - The re-run story holds: the step is idempotent per tarball (
npm viewskip-guard), so the next release attempt completes the set rather than tripping on anything the failed 2.0.0 run may have left behind — nothing was published, since the run died before npm reached the registry. - The comment at the call site is accurate and earns its place — this is precisely the kind of one-character load-bearing detail that gets "cleaned up" later without it.
- No changeset needed (workflow-only), and the honesty about scope is right: this fix is necessary but unproven-sufficient, since trusted publishing was never exercised. The
npm trust listcheck on all seven packages before the retry — flagged here and in AGENTS.md — remains the other half of de-risking the next attempt.
Agreed on merge order: this must land before the next Version Packages merge, or the release dies identically.
What happened
The 2.0.0 release run (#859's merge) failed in Publish FFI packages on the first platform tarball:
npm publishreceived the bare relative pathffi-dist/<name>.tgz. npm's spec parser classifies anowner/repo-shaped argument as a GitHub shorthand before it considers it a file, so it tried togit ls-remotea repository named after the tarball. A spec is only treated as a local tarball when it starts with./,../,/orfile:.Fix
One line:
npm publish --access public --provenance "./$tgz", with a comment explaining why the./is load-bearing. Nothing else in the step uses the path as a package spec (thetarreads andnpm viewprobes are unaffected).What this does and doesn't prove
npm trust list <pkg>on the seven FFI packages before retrying (per AGENTS.md, each configuration must also allownpm publish).ffi-preflight.ymlcouldn't have caught this: it dry-runschangeset publish, and this custom step has no dry-run path.Companion to #920 (which re-arms the release as 1.1.0). This must merge before the next Version Packages PR does, or the release fails the same way again.