fix: bootstrap rush/autorest prerequisites in GenerateModules.ps1 for fresh clones#3653
Open
ramsessanchez wants to merge 1 commit into
Open
fix: bootstrap rush/autorest prerequisites in GenerateModules.ps1 for fresh clones#3653ramsessanchez wants to merge 1 commit into
ramsessanchez wants to merge 1 commit into
Conversation
GenerateModules.ps1 invokes rush and autorest via 'npx --no-install', which only resolves them from the repo-root node_modules. On a fresh clone that directory does not exist, so the script failed with 'could not determine executable to run'. CI worked because install-tools.yml installs these packages, masking the gap for local runs. - Add an idempotent bootstrap that installs @microsoft/rush, autorest@3.7.2 and @autorest/core@3.10.4 at the repo root only when the executables are missing. In Azure DevOps the packages are already present, so the step is skipped and CI behavior is unchanged. - Add a fail-fast check for the autorest.powershell submodule (rush.json) with a clear 'git submodule update --init --recursive' instruction. - Ignore the npm-generated root package.json/package-lock.json. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Works locally on my end. |
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
Running
tools/GenerateModules.ps1on a fresh clone fails at:npx --no-installresolvesrush/autorestonly from the repo-rootnode_modules, which does not exist on a fresh local clone. CI is unaffected because.azure-pipelines/common-templates/install-tools.ymlinstalls these packages first, which masked the gap for local runs.Changes
GenerateModules.ps1: installs@microsoft/rush,autorest@3.7.2and@autorest/core@3.10.4at the repo root only when the executables are missing (same versions asinstall-tools.yml).git submodule update --init --recursivemessage ifautorest.powershell/rush.jsonis absent, instead of a cryptic rush error.package.json/package-lock.json.Azure DevOps impact: none
The bootstrap is guarded by a presence check. In ADO the packages are already installed at the build sources directory, so the step is skipped - no new npm calls (safe for network-isolated release pipelines) and CI behavior is identical.
Validation
node_modules): installs tools,rush/autorestbins present,rush installthen succeeds.package.json/node_modulesconfirmed git-ignored.