fix: serialize multi-semantic-release init to avoid flaky release failures#1364
Merged
Conversation
The release job runs with minimal permissions (id-token + contents). When multi-semantic-release fails, @semantic-release/github's fail step tries to open a "release is failing" issue and gets 403 Resource not accessible by integration. Granting issues:write lets that notification be created.
… failures multi-semantic-release runs every package's init/verifyConditions phase in parallel with no concurrency limit, so all packages fire their git tag/notes reads and npm OIDC token exchanges simultaneously. Under that load the operations intermittently collide or get throttled: two consecutive attempts of the same commit failed differently, one on 'git log --notes=refs/notes/ semantic-release*' (exit 128, failed to read notes tree) and one on the npm OIDC token exchange (ENONPMTOKEN for a subset of packages), while every package is correctly configured for trusted publishing. --sequential-init serializes the init phase (dhoulb/multi-semantic-release#24), letting each package initialize one at a time so the git and OIDC calls no longer race or get rate limited.
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.
Problem
The
Release on npmstep failed on run 30022960959 withENONPMTOKEN No npm token specifiedforelectron-infoand@ffflorian/jszip-cli.The root cause is not a missing token or a code regression:
semantic-release25.0.6 -> 25.0.8, whichmulti-semantic-releasedoes not use (it bundles its own nested copy).git log ... --notes=refs/notes/semantic-release*exited 128 (Failed to read notes tree).ENONPMTOKENfor a subset of packages (their OIDC token exchange returned nothing).Non-deterministic failures across re-runs point to a concurrency/throttling issue.
multi-semantic-releaseruns every package's init/verifyConditionsphase in parallel with no concurrency limit, so all ~15 packages fire their git tag/notes reads and npm OIDC token exchanges simultaneously. Under that burst the calls intermittently collide or get rate limited, and which packages fall over varies run to run.Changes
releasescript: add--sequential-init. This is the built-inmulti-semantic-releaseflag for exactly this case (its own comment: "Avoid hypothetical concurrent initialization collisions / throttling issues", Is it possible to add the --debug arg to be passed to semantic-release? dhoulb/multi-semantic-release#24). It serializes the init phase so each package initializes one at a time, so the git-notes reads and OIDC token exchanges no longer race or get throttled.issues: writeto the release job. When a release does fail,@semantic-release/github's fail step tries to open a "release is failing" issue and was getting403 Resource not accessible by integrationbecause the job only hadid-token+contents. This lets that notification be created instead of erroring.Verification
The release step only runs on push to
main(skipped on PRs), so the real confirmation is the next push tomain, or re-running the failed job with these changes in place.