Skip to content

fix(release): decouple amazon-cognito-identity-js latest dist-tag from postpublish hook#14846

Open
bobbor wants to merge 1 commit into
v5-stablefrom
phandpau/fix/lts-release-dist-tag
Open

fix(release): decouple amazon-cognito-identity-js latest dist-tag from postpublish hook#14846
bobbor wants to merge 1 commit into
v5-stablefrom
phandpau/fix/lts-release-dist-tag

Conversation

@bobbor

@bobbor bobbor commented Jun 22, 2026

Copy link
Copy Markdown
Member

Summary

The v5 LTS release was failing on the amazon-cognito-identity-js postpublish hook, which ran npm dist-tag add … latest inside lerna's parallel publish. lerna swallowed the hook's stderr and a single failure aborted the entire fleet release — leaving the v5 line partially published (the umbrella aws-amplify and several @aws-amplify/* packages never reached npm even though their versions were bumped, committed, and tagged).

This moves the latest dist-tag promotion out of the package lifecycle and into an explicit, sequential release step.

Changes

  • packages/amazon-cognito-identity-js/package.json — remove the postpublish hook (npm dist-tag add $npm_package_name@$npm_package_version latest).
  • .github/workflows/callable-npm-publish-lts-release.yml
    • Add an explicit "Promote amazon-cognito-identity-js to the latest dist-tag" step that runs after the fleet publish, reads the just-published version, and fails loudly (no swallowed stderr) without aborting the publish.
    • Add git pull --rebase before the post-release git push to fix the separate non-fast-forward push failure seen on 06-12.

amazon-cognito-identity-js is the only package with a postpublish and the only unscoped package whose latest must track the v5 line while the rest of the fleet rides stable-5; everything else is unaffected.

Why

  • Lifecycle hooks running mid-parallel-publish hide their errors and make one package's tag-move fatal to the whole release.
  • An explicit post-publish step is observable, retryable, and cannot abort already-published packages.

Testing

  • yarn && yarn bootstrap && yarn build green on the branch (Node 22).
  • YAML + JSON validated.
  • The partial-publish backlog this bug created was separately reconciled out-of-band via lerna publish from-package (10 packages republished to stable-5; aws-amplify@5.3.35 now resolves all pinned deps).

Notes

  • Does not change the publish auth path.

…ublish

The per-package postpublish hook ran 'npm dist-tag add ... latest' mid
lerna parallel-publish, where lerna swallowed its output and a single
failure aborted the entire LTS release. Move it to an explicit step that
runs after the fleet publish so failures are visible and retryable
without re-publishing. Also pull --rebase before pushing post-release
changes to avoid non-fast-forward push failures.
@bobbor bobbor requested review from a team as code owners June 22, 2026 15:12
@changeset-bot

changeset-bot Bot commented Jun 22, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: bb0ec43

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@bobbor bobbor changed the title fix(release): decouple acij latest dist-tag from postpublish hook fix(release): decouple amazon-cognito-identity-js latest dist-tag from postpublish hook Jun 22, 2026
github_user: ${{ vars.GH_USER}}
github_email: ${{ vars.GH_EMAIL}}

- name: Promote amazon-cognito-identity-js to the "latest" dist-tag

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.

Should we move this step after push or mark with continue-on-error ? If dist-tag fails the commit/tags never get pushed.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants