Skip to content

fix(post-publish): handle Rush version bump in npm-post-publish pipeline#5725

Merged
iclanton merged 2 commits intomicrosoft:mainfrom
iclanton:fix-post-publish
Mar 25, 2026
Merged

fix(post-publish): handle Rush version bump in npm-post-publish pipeline#5725
iclanton merged 2 commits intomicrosoft:mainfrom
iclanton:fix-post-publish

Conversation

@iclanton
Copy link
Member

Summary

  • Fix issues with updates to rushstack-websites (prior commit): adds DisableInstallRunRushLockfile parameter to the install-run-rush.yaml template and uses it for the rushstack-websites stage, which doesn't have a lockfile checked in.

  • Handle Rush version bump in post-publish pipeline (this commit): when bump-decoupled-local-dependencies updates the Rush version in rush.json, the subsequent rush update step would fail because install-run-rush.js tried to install the new Rush version while INSTALL_RUN_RUSH_LOCKFILE_PATH still pointed to the old version's lockfile.

    Fix:

    • BumpDecoupledLocalDependencies now emits RushWasUpdated (true/false) and NewRushVersion as Azure Pipelines variables, and only writes rush.json when the version actually changed.
    • If RushWasUpdated is true, a new conditional step bootstraps the new Rush version (skipping lockfile validation), then copies the new lockfile into common/config/validation/rush-package-lock.json before rush update runs — so rush update proceeds normally with a matching lockfile.

Test plan

  • Verify the pipeline runs successfully when Rush is not updated (normal path unchanged)
  • Verify the pipeline runs successfully when Rush is updated (new bootstrap steps trigger, rush update no longer fails)

🤖 Generated with Claude Code

iclanton and others added 2 commits March 25, 2026 12:02
If `bump-decoupled-local-dependencies` updates the Rush version in
`rush.json`, the subsequent `rush update` step would fail because
`install-run-rush.js` tried to install the new Rush version but the
checked-in `rush-package-lock.json` still referenced the old version.

Fix by emitting `RushWasUpdated` and `NewRushVersion` Azure Pipelines
variables from `BumpDecoupledLocalDependencies`, then conditionally
bootstrapping the new Rush version (skipping lockfile validation) and
updating the checked-in lockfile before running `rush update` normally.

Also only write `rush.json` when the Rush version actually changed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@iclanton iclanton merged commit 0020d94 into microsoft:main Mar 25, 2026
6 checks passed
@github-project-automation github-project-automation bot moved this from Needs triage to Closed in Bug Triage Mar 25, 2026
@iclanton iclanton deleted the fix-post-publish branch March 25, 2026 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Closed

Development

Successfully merging this pull request may close these issues.

2 participants