Repository navigation
fix(publish): retry provenance signing on Sigstore tlog 409 conflict - #1422
Merged
Merged
Conversation
@lerna-lite/changed
@lerna-lite/cli
@lerna-lite/core
@lerna-lite/diff
@lerna-lite/exec
@lerna-lite/init
@lerna-lite/list
@lerna-lite/listable
@lerna-lite/npmlog
@lerna-lite/profiler
@lerna-lite/publish
@lerna-lite/run
@lerna-lite/version
@lerna-lite/watch
commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1422 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 168 169 +1
Lines 5961 6080 +119
Branches 1544 1584 +40
==========================================
+ Hits 5961 6080 +119 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
🎉 This pull request is included in version 5.6.4 📦 |
Nick-Lucas
added a commit
to trpc/trpc
that referenced
this pull request
Oct 28, 2026
## Summary This bumps `@lerna-lite/cli` and `@lerna-lite/publish` from `^5.6.3` to `^5.6.4` in the catalog. It also deletes `patches/@[email protected]`, because 5.6.4 ships the same change upstream. 5.6.4 includes two release-relevant fixes: - [lerna-lite#1433](lerna-lite/lerna-lite#1433) upstreams our 403 PUT response-body logger, with output truncated at 4,000 characters. The upstream PR names #7669 as its origin. - [lerna-lite#1422](lerna-lite/lerna-lite#1422) retries provenance signing, up to 3 times, when Sigstore returns `TLOG_CREATE_ENTRY_ERROR` with a 409. That error ended the second attempt of the 2026-10-28 canary run ([40729427954](https://github.com/trpc/trpc/actions/runs/40729427954)). The orphaned `@lerna-lite/{cli,core,init,version}@5.6.3` entries were a self-referencing cycle that pnpm did not prune, so I removed them from the lockfile by hand. `pnpm install --frozen-lockfile` and `pnpm install --lockfile-only` both leave the lockfile unchanged. ## Verification - `pnpm lerna publish --force-publish --canary --preid canary --dist-tag canary --yes --dry-run` on lerna-lite 5.6.4 prints `lerna-lite success published 7 packages [dry-run]`. - In the installed 5.6.4, `dist/command.js` contains `logForbiddenPutBody`, and `dist/lib/npm-publish.js` contains `isTlogConflictError`. Stacked below #7736. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Chores** * Updated the Lerna Lite CLI and publish tooling to version 5.6.4. * **Changes** * Certain failed publish requests no longer include raw response data in error logs. This reduces diagnostic detail in those cases. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: Charon <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
Merged
2 of 10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Wraps the
libnpmpublishpublish()call innpmPublish()with a small retry loop that only fires when Sigstore fails withTLOG_CREATE_ENTRY_ERRORand a409status ("an equivalent entry already exists in the transparency log").Sigstore transparency log conflict (409) for @scope/pkg, retrying provenance signing (attempt 2/3)release.yml(f385d93) so the next releases test the in-library fix directly.Fix and tests written with help from GitHub Copilot (Claude Opus 5.5)
Motivation and Context
When publishing with provenance (OIDC trusted publishing / short-lived token), the publish sometimes fails partway through with:
Root cause:
@sigstore/signretries its own HTTP requests. When the first POST to Rekor actually succeeds but the response is lost (timeout/5xx), the internal retry re-POSTs the same entry and gets a 409. Sigstore has afetchOnConflictoption for this case, but it is hard-coded tofalsein[email protected]and isn't passed through bylibnpmpublish, so we can't turn it on from outside.Retrying at the Lerna-Lite level is safe because
libnpmpublishsigns the provenance (buildMetadata) before it uploads the package to the registry. So nothing has been published for that package when this error is thrown. A new attempt signs with a new temporary key, which produces a different signature, so it no longer conflicts.Until now this had to be worked around in CI with a bash retry loop around
lerna publish(see f385d93). With this change, users no longer need their own retry loop in CI.How Has This Been Tested?
Added unit tests in
packages/publish/src/__tests__/npm-publish.spec.ts(using Vitest fake timers):publishcalled twice,postpublishlifecycle still runs)E403)Ran
vitest run packages/publish/src/__tests__/npm-publish.spec.ts(20/20 passing), plusoxlintandoxfmt --checkon the changed files.Types of changes
Checklist: