chore: add Lage for dependency-aware incremental builds and tests#7426
Open
chore: add Lage for dependency-aware incremental builds and tests#7426
Conversation
d22d1a0 to
3b038b0
Compare
Integrate Lage as the monorepo task runner to enable incremental, dependency-aware build and test execution. This replaces the previous approach of running all tests regardless of what changed. Changes: - Add lage.config.js with pipeline for build, test:node, test:playwright, test:chromium, and test:rules tasks - Update root package.json scripts to use lage - Add test:chromium scripts to fast-element, fast-html, and fast-ssr packages for Chromium-only test runs - Update ci-validate-pr.yml and ci-validate-platforms.yml to use lage --since for incremental PR validation - Add Rust crate change detection to force full builds when crates/ files change - Update CONTRIBUTING.md and copilot-instructions.md with lage commands and documentation Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
lage is installed as a local devDependency and is not available on the runner PATH. Use npx to resolve it from node_modules/.bin. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The site's generate-docs.cjs imports from @microsoft/fast-build and resolves @microsoft/fast-element, but neither was declared as a dependency. With npm workspaces this worked because packages built sequentially before the site. With lage's parallel builds, the site needs explicit dependencies so lage knows to build fast-element and fast-build first. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
With lage running tests in parallel, fast-element and fast-html both used port 5173 for their Vite test servers. When fast-element tests completed first, Playwright shut down the shared server, causing all fast-html tests to fail with ERR_CONNECTION_REFUSED. Assign fast-html to port 5174 so each package has its own server. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The 'Detect changed scope' step uses bash syntax (if/then) which fails on Windows runners that default to PowerShell. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace the multi-step crate detection + output variable approach with inline GitHub Actions expressions. The --since flag is applied for pull_request events and omitted for push/schedule events. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
387a48b to
4bf13e9
Compare
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.
Pull Request
📖 Description
Currently, the CI PR gates run all tests for all packages regardless of what changed. This wastes CI time when only a subset of packages are affected by a PR.
This change integrates Lage as the monorepo task runner to enable dependency-aware, incremental build and test execution. Lage understands the package dependency graph and can selectively run tasks only for changed packages and their dependents using the
--sinceflag.Key behaviors:
lage --since origin/<base-branch>to only build and test packages that changed or have a changed dependency--since)crates/) change, the--sinceflag is omitted to force a full rebuild (since Rust source lives outside npm workspaces)🎫 Issues
N/A
👩💻 Reviewer Notes
lage.config.jsdefines the task pipeline:buildruns in topological order (^build), and test tasks (test:node,test:playwright,test:chromium) depend onbuildtest:chromiumscripts were added tofast-element,fast-html, andfast-ssrto enable Chromium-only test runs without lage passthrough arg conflicts with Rust/cargo buildsfast-htmltest server was moved to port 5174 to avoid port conflicts when lage runs tests in parallel (fast-element uses 5173)sites/website) gained explicitdevDependencieson@microsoft/fast-buildand@microsoft/fast-element— itsgenerate-docs.cjsalready imported from these packages, but the implicit dependency was masked by npm's sequential workspace ordering. Lage's parallel builds require the dependency to be declared explicitlyshell: bashto ensure the bash script runs correctly on Windows runners (which default to PowerShell)biome-changed(already optimized for changed files)📑 Test Plan
lage buildcorrectly builds all packages in dependency orderlage test:chromiumruns Chromium Playwright tests for affected packages without port conflictslage --since origin/maincorrectly scopes to changed packages and their dependentsnpm run checkchangepasses with the included change files✅ Checklist
General
$ npm run change⏭ Next Steps