Skip to content

perf(dashboard): commit the frontend build and verify it in CI - #11664

Merged
ReubenBond merged 11 commits into
dotnet:mainfrom
ReubenBond:rb-frontend-build-artifacts
Nov 2, 2026
Merged

ReubenBond merged 11 commits into
dotnet:mainfrom
ReubenBond:rb-frontend-build-artifacts

Conversation

@ReubenBond

@ReubenBond ReubenBond commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Normal solution builds currently install the Dashboard npm tree and run Vite inside the multi-targeted .NET build. That external work delays Dashboard and downstream compilation even when the frontend is unchanged, and requires Node.js for every .NET build.

This commits the Dashboard production build under src/Dashboard/Orleans.Dashboard.App/dist and uses the standard committed-build-output pattern:

  • .NET builds embed every file in dist/ as a resource. Orleans.Dashboard.Frontend.targets is now a static item include; .NET builds and packs need neither Node.js nor npm.
  • Contributors changing the frontend run npm run restore and npm run build, then commit dist/ alongside the source change.
  • CI: a new Dashboard workflow runs only when a pull request or push changes src/Dashboard/Orleans.Dashboard.App/** (or the workflow itself), using GitHub's paths filter. Its Dashboard assets job runs the same two commands with the pinned Node.js version and fails if git status shows any difference in dist/; its Dashboard UI regressions job (moved from ci.yml) runs the Playwright tests. PRs that don't touch the Dashboard app never run npm, so unrelated changes such as new npm advisories or upstream nondeterminism cannot fail them.
  • Third-party notices use Vite's built-in build.license option (THIRD-PARTY-NOTICES.md), embedded in the assembly and included as a standalone file in the NuGet package. The Bootstrap, AdminLTE, and Font Awesome stylesheets are now imported from index.tsx rather than via CSS @import, so Vite's license collection sees them; index.css and index.min.js are otherwise unchanged.
  • Reproducibility: frontend sources are checked out with LF on all platforms (.gitattributes), and Node.js/npm are pinned via .node-version and package.json engines/packageManager. The logo moved from a JavaScript import to public/img/ (same output path and bytes): Rolldown emitted a random asset reference ID for the imported image into the source map, making builds nondeterministic. Repeated fresh builds on Windows and Linux now reproduce the committed dist/ byte-for-byte.
  • npm resilience: npm run restore retains the bounded ECONNRESET-only clean-install retry from ci: Dashboard npm ci exits with code 152 in the Ubuntu BVT build #11548, with lockfile, authentication, integrity, lifecycle, and signal failures propagated immediately.

Because .NET builds no longer run npm, the BuildExternalAssets property and its plumbing (run-tests action input, Build-Samples.ps1 -SkipExternalAssets, docs commands) are removed, along with Node.js setup in the BVT, macOS, and analyzer-audit .NET jobs.

Measurements

Measured against main 625b2baf761fa3cbfc35d1125c6b0d3244fdd847 in an exclusive serial A–B–B–A window, using an earlier revision of this PR (a94dfef794) that additionally ran an SDK hash-verification task during the build:

Normal fresh Orleans.slnx build Control Prebuilt assets
First sample 145.64 s 117.40 s
Second sample 140.39 s 97.03 s
Median 143.02 s 107.22 s

This is an observed 35.80 s / 25.0% median reduction from two samples per variant on a shared Windows host (same SDK, Debug, 32 MSBuild nodes, warm dependency stores, fresh project intermediates, restore included). Every sample performed the identical 294 C# and 8 F# compilation inventory; control performed one npm install/build, the candidate none. npm phase durations overlap compilation and are not additive savings. The current revision removes the verification task, so the .NET build does strictly less work than the measured candidate.

The repository tradeoff is ~25.6 MB of generated assets, most of it the existing 19.3 MB source map.

Relates to #11548 and #11636.

Microsoft Reviewers: Open in CodeFlow

Copilot AI balanced review requested due to automatic review settings November 2, 2026 05:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The fixture input manifest omits hidden files on Linux, causing the expected-success build to fail with ORLEANSDASHBOARD001 and blocking the Ubuntu Build job.

1 open issue
1 file not reviewed
  • src/Dashboard/Orleans.Dashboard.App/package-lock.json: Generated file
What changed in this PR

This PR moves Dashboard frontend generation out of ordinary .NET builds. Builds and packages instead verify and embed committed assets, while explicit generation and selective CI checks establish reproducibility.

Changes:

  • Replace build-time npm/Vite execution with SDK-only source and output hash validation.
  • Add pinned, canonical asset generation with bounded npm recovery and third-party notices.
  • Add Windows/Linux reproduction selection and regression checks while preserving required .NET build gates.
File Description
src/​Dashboard/​Orleans.Dashboard/​Orleans.Dashboard.Frontend.targets Verify and embed committed assets; package notices.
src/​Dashboard/​Orleans.Dashboard.App/​verify-assets.cs Validate complete input/output inventories and hashes.
src/​Dashboard/​Orleans.Dashboard.App/​scripts/​install.mjs Retry structured npm connection-reset failures.
src/​Dashboard/​Orleans.Dashboard.App/​README.md Document generation, verification, and development.
src/​Dashboard/​Orleans.Dashboard.App/​package.json Pin tooling and expose asset-management commands.
src/​Dashboard/​Orleans.Dashboard.App/​package-lock.json Record matching toolchain requirements.
src/​Dashboard/​Orleans.Dashboard.App/​generate-assets.mjs Generate canonical assets, manifests, and notices.
src/​Dashboard/​Orleans.Dashboard.App/​dist/​index.html Commit the deployable HTML entry point.
src/​Dashboard/​Orleans.Dashboard.App/​assets.outputs.sha256 Record generated asset hashes.
src/​Dashboard/​Orleans.Dashboard.App/​assets.inputs.sha256 Record canonical frontend input hashes.
src/​Dashboard/​Orleans.Dashboard.App/​.node-version Pin the generation Node.js version.
src/​Dashboard/​Orleans.Dashboard.App/​.gitignore Allow committed frontend outputs.
.github/​workflows/​ci.yml Integrate selective reproduction and regression checks.
.github/​scripts/​test-summarize-coverage.ps1 Check the expanded coverage trust-input list.
.github/​scripts/​test-dashboard-npm.mjs Exercise npm recovery and generation failures.
.github/​scripts/​test-dashboard-frontend.ps1 Exercise SDK verification and asset preservation.
.github/​scripts/​test-dashboard-frontend-selection.ps1 Test change selection and workflow routing.
.github/​scripts/​select-dashboard-frontend-check.ps1 Select reproduction using immutable PR changes.
.github/​coverage-inputs.txt Include the selector in trusted coverage inputs.
.gitattributes Normalize source line endings and preserve output bytes.

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 2, 2026 07:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues remain for the switch from build-time Dashboard frontend compilation to committed assets.

No open issues 🎉

1 resolved since last review
1 file not reviewed
  • src/Dashboard/Orleans.Dashboard.App/package-lock.json: Generated file

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 2, 2026 14:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues remain for the Dashboard frontend build and asset-verification changes.

No open issues 🎉

1 file not reviewed
  • src/Dashboard/Orleans.Dashboard.App/package-lock.json: Generated file

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 2, 2026 15:13
@ReubenBond ReubenBond changed the title perf(dashboard): consume verified prebuilt frontend assets perf(dashboard): commit the frontend build and verify it in CI Nov 2, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues block the changes separating Dashboard frontend compilation from normal .NET builds.

No open issues 🎉

1 file not reviewed
  • src/Dashboard/Orleans.Dashboard.App/package-lock.json: Generated file

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 2, 2026 15:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues were identified for the change separating Dashboard frontend compilation from normal .NET builds.

No open issues 🎉

1 file not reviewed
  • src/Dashboard/Orleans.Dashboard.App/package-lock.json: Generated file

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 2, 2026 16:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues block the change separating Dashboard frontend compilation from ordinary .NET builds.

No open issues 🎉

1 file not reviewed
  • src/Dashboard/Orleans.Dashboard.App/package-lock.json: Generated file

Review effort: Balanced

@ReubenBond
ReubenBond merged commit 6248376 into dotnet:main Nov 2, 2026
156 of 158 checks passed
@ReubenBond
ReubenBond deleted the rb-frontend-build-artifacts branch November 2, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants