fix(ci): gate release on npm registry propagation - #5572
Open
svozza wants to merge 1 commit into
Open
Conversation
svozza
force-pushed
the
fix/5564-npm-registry-propagation-gate
branch
2 times, most recently
from
August 20, 2026 10:22
0e2224b to
fec4389
Compare
svozza
force-pushed
the
fix/5564-npm-registry-propagation-gate
branch
from
August 20, 2026 10:31
fec4389 to
075c190
Compare
publish_layer's cdk synth runs npm i @aws-lambda-powertools/<pkg>@<version> seconds after npm publish returns, before the registry actually serves the new versions, so the layer build intermittently failed with a misleading 'ETARGET / No matching version found' that blocked every downstream job. - Add .github/scripts/verify_npm_publish.sh: after publishing, poll the registry for every non-private workspace version (version doc + tarball) until served, timing out after 7 minutes with an accurate message instead of a downstream ETARGET. Wired into the publish-npm job, so publish_layer/create_tag (which need: publish-npm) transitively wait. - Retry the layer bundling npm i with exponential backoff in layer-publisher-stack.ts, covering the manual publish_layer dispatch too. Closes #5564
svozza
force-pushed
the
fix/5564-npm-registry-propagation-gate
branch
from
August 20, 2026 10:45
075c190 to
fb4f446
Compare
dreamorosi
approved these changes
Aug 20, 2026
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.
Summary
publish_layer'scdk synthrunsnpm i @aws-lambda-powertools/<pkg>@<version>seconds afternpm publishreturns, before registry.npmjs.org actually serves the new versions.needs: publish-npmonly guarantees publish returned, not that the registry resolves the versions, so the layer build intermittently fails with a misleadingETARGET / No matching version found(as in the v2.35.0 release), which blocks every downstream job. This adds a registry-availability gate plus a retry so the release either waits or fails with an accurate reason.If the gate does time out because of registry eventual consistency, it is safe to simply re-run the failed job once npm catches up — nothing needs to be republished.
Changes
.github/scripts/verify_npm_publish.sh: after publishing, poll the registry for every non-private workspace version (version document +dist.tarball) until it is served, failing after 7 minutes with a message that names the pending versions and explains the ETARGET symptom, rather than letting it surface later.Verify npm registry propagationstep into thepublish-npmjob, sopublish_layerandcreate_tag(bothneeds: publish-npm) transitively wait.npm iwith exponential backoff inlayers/src/layer-publisher-stack.ts, which also protects the manualpublish_layerdispatch path.Testing
Rehearsed end-to-end against a full stubbed copy of the release pipeline (npm publish, AWS, and CDK deploy edges stubbed; job graph, gating, and artifact flow kept real):
Verify npm registry propagationstep passes against the real registry and the layer build'scdk synth/npm isucceeds; the pipeline proceeds.ETARGETdownstream — andpublish_layer/create_tagare skipped.Issue number: closes #5564
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.