fix(pipelines): install build-tools on bundle-size-artifacts pipeline so flub is on PATH#27252
Conversation
PR microsoft#27246 switched the "Calculate bundle sizes" step in build-npm-package.yml from Npm@1 to Bash@3 so that `flub` would resolve to the globally-linked workspace build (which has the new bundleAnalyzerJson aggregation logic) instead of the catalog-pinned one. That worked on PR builds and main client CI builds because both invoke include-set-package-version, which transitively runs include-install-build-tools and globally links flub. It broke the dedicated baseline pipeline (build-bundle-size-artifacts.yml, definition 48). That pipeline sets `isBundleSizeArtifactsPipeline: true`, which gates set-package-version off — so flub is never linked, and the Bash@3 step fails with `flub: command not found` (build 398408). Fix: invoke include-install-build-tools standalone right before the bundle-analysis section, gated on `isBundleSizeArtifactsPipeline=true`, so flub is on PATH in exactly the case set-package-version doesn't cover. PR/main-client paths are untouched — they still get flub via set-package- version. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates the bundle-analysis portion of the npm package build template so the bundle-size-artifacts pipeline has flub available on PATH even when set-package-version is intentionally skipped.
Changes:
- Conditionally runs
include-install-build-toolsforisBundleSizeArtifactsPipelineduring bundle analysis. - Ensures
flubis globally linked for the baseline bundle-size artifact publishing pipeline without invoking version-bump logic.
| # the bundle-analysis steps below. Other pipelines already have flub | ||
| # linked via set-package-version, so this is a no-op for them. |
|
Hi! Thank you for opening this PR. Want me to review it? Based on the diff (12 lines, 1 files), I've queued these reviewers:
How this works
|
Description
Follow-up fix for #27246. That PR switched the "Calculate bundle sizes" step in
build-npm-package.ymlfromNpm@1toBash@3soflubwould resolve through PATH to the globally-linked workspace build (which has the newbundleAnalyzerJsonaggregation logic) instead ofnode_modules/.bin/flub(the catalog-pinned version, which does not).That fix worked on PR builds and main-branch client CI builds because both run
include-set-package-version, which transitively invokesinclude-install-build-toolsand globallynpm links the workspace flub.It broke the dedicated baseline-CI pipeline (
build-bundle-size-artifacts.yml, definition 48 — the pipeline that publishes thebundleAnalyzerJsonartifact that PR builds compare against). That pipeline setsisBundleSizeArtifactsPipeline: true, which gatesset-package-versionoff, soflubis never linked. Build 398408 failed at the "Calculate bundle sizes" step withflub: command not found.The
set-package-versionskip is itself a deliberate workaround — see #15110, which originally added the gate. Briefly:update-package-version.shcallsflub bump $RELEASE_GROUP …where$RELEASE_GROUPis thetagNameparameter. The bundle-size-artifacts pipeline passestagName: bundle-and-code-coverage-artifacts, which isn't a real release group in the fluidBuild config. Runningflub bumpagainst it would fail at release-group lookup. Properly fixingflub bumpto support "set versions for a non-release-group set of packages" is a much larger change than this PR wants to take on.Fix
Decouple flub installation from version-setting: invoke
include-install-build-toolsstandalone right before the bundle-analysis section inbuild-npm-package.yml, gated onisBundleSizeArtifactsPipeline=true. That makesflubavailable in exactly the caseset-package-versiondoesn't cover, without invoking the fragile release-group-name machinery. PR/main-client paths are untouched — they still getflubviaset-package-version.Reviewer Guidance
The review process is outlined on this wiki page.