Skip to content

Add INSTALL_RUN_RUSH_LOCKFILE_PATH to pipeline runs.#5710

Merged
iclanton merged 8 commits intomicrosoft:mainfrom
iclanton:add-INSTALL_RUN_RUSH_LOCKFILE_PATH
Mar 25, 2026
Merged

Add INSTALL_RUN_RUSH_LOCKFILE_PATH to pipeline runs.#5710
iclanton merged 8 commits intomicrosoft:mainfrom
iclanton:add-INSTALL_RUN_RUSH_LOCKFILE_PATH

Conversation

@iclanton
Copy link
Member

@iclanton iclanton commented Mar 21, 2026

Summary

Improves the reliability of pipeline runs by pinning the Rush version used by install-run-rush.js to a validated lockfile, preventing unexpected Rush upgrades from breaking CI.

  • Adds INSTALL_RUN_RUSH_LOCKFILE_PATH support to the install-run-rush.yaml pipeline template, pointing to a checked-in lockfile at common/config/validation/rush-package-lock.json.
  • Adds a RepoPath parameter to the template (defaults to $(Build.SourcesDirectory)) so callers with non-default checkout paths can specify the repo root; it drives both workingDirectory and the lockfile path.
  • Updates all pipeline templates and the GitHub Actions CI workflow to use the new template parameter.
  • Updates BumpDecoupledLocalDependencies to regenerate rush-package-lock.json as part of the automated decoupled dependency bump PR.

Details

install-run-rush.js respects the INSTALL_RUN_RUSH_LOCKFILE_PATH environment variable to pin the npm install of the Rush version to a specific lockfile. Previously this was not set, so Rush could be silently upgraded (or downgraded) between runs. The new template sets it unconditionally.

The RepoPath parameter was needed because the post-publish pipeline checks out a second repo (rushstackWebsites) into a non-default directory; without it, the workingDirectory and lockfile path would point at the wrong location.

BumpDecoupledLocalDependencies now copies the Rush package lockfile into common/config/validation/rush-package-lock.json after running rush update, keeping the pinned version in sync with the rest of the repo's dependency updates.

How it was tested

Reviewed pipeline template changes manually and confirmed that all callers pass through the new RepoPath parameter where needed. The rush-package-lock.json content was generated by running rush update locally.

@github-project-automation github-project-automation bot moved this to Needs triage in Bug Triage Mar 21, 2026
@iclanton iclanton enabled auto-merge (squash) March 21, 2026 02:56
@iclanton iclanton force-pushed the add-INSTALL_RUN_RUSH_LOCKFILE_PATH branch from 2a0d0ca to 3bb7435 Compare March 21, 2026 19:14
iclanton added a commit to SharePoint/spfx that referenced this pull request Mar 23, 2026
## Description

Sets `INSTALL_RUN_RUSH_LOCKFILE_PATH` on every `install-run-rush.js`
invocation in CI, pinning the Rush version used to the one recorded in
`common/config/validation/rush-package-lock.json`. This mirrors the
change made in microsoft/rushstack#5710.

Changes:
- Add `common/config/azure-pipelines/templates/install-run-rush.yaml` —
a new wrapper template that sets the env var and accepts `Arguments`,
`DisplayName`, `Condition`, and `RepoPath` parameters
- Update `templates/pack.yaml`, `templates/bump-versions.yaml`,
`bump-versions.yaml`, and `publish.yaml` to use the new template instead
of inline `script:` steps
- Add `INSTALL_RUN_RUSH_LOCKFILE_PATH` env var to the GitHub Actions CI
job

## How was this tested

Verified the pipeline YAML files are syntactically consistent with
existing usage patterns.

## Type of change

- [ ] Bug fix
- [ ] New feature
- [ ] Template change (keep templates and examples in sync)
- [x] Docs/CI change (no source change)

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
iclanton and others added 7 commits March 24, 2026 18:55
Add a configurable RepoPath parameter (defaulting to Build.SourcesDirectory)
so callers can specify a custom repo root when the checkout is in a
non-default location. The parameter sets workingDirectory and adjusts
INSTALL_RUN_RUSH_LOCKFILE_PATH accordingly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@iclanton iclanton force-pushed the add-INSTALL_RUN_RUSH_LOCKFILE_PATH branch from c22abea to 49871e7 Compare March 24, 2026 23:05
@iclanton iclanton merged commit 07d8024 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 add-INSTALL_RUN_RUSH_LOCKFILE_PATH branch March 25, 2026 00:33
stdio: ['ignore', 'pipe', 'pipe']
});
const stdoutBuffer: string[] = [];
childProcess.stdout!.on('data', (chunk) => stdoutBuffer.push(chunk));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're expecting chunk to be a string, that implies that you have set encoding on the stream

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.

3 participants