Skip to content

perf(dashboard): separate dependency and frontend build invalidation - #11636

Open
ReubenBond wants to merge 5 commits into
dotnet:mainfrom
ReubenBond:rb-dashboard-build-incrementality
Open

ReubenBond wants to merge 5 commits into
dotnet:mainfrom
ReubenBond:rb-dashboard-build-incrementality

Conversation

@ReubenBond

@ReubenBond ReubenBond commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Problem

Dashboard frontend source edits and Rebuild run npm ci together with Vite compilation, repeating dependency installation even when the dependency tree is current.

Solution

Track installation independently using a success stamp inside node_modules, keyed to dependency manifest, installer script, and npm configuration contents, Node.js/npm versions, and effective dependency-tree options, including install-strategy. Clean retains this installation state.

Track frontend source paths and contents separately, together with the complete generated asset inventory. Source edits, deletions, renames, changed build configuration, and missing assets refresh the frontend bundle. Installation and compilation invalidate their success stamps before fallible work. Framework builds continue to share the outer project's frontend owner and embed every generated asset.

Real project builds demonstrate zero npm ci invocations for source-only edits and Rebuild, with one frontend compilation each; unchanged builds run neither operation. The regression script covers 17 incrementality, ownership, failure-recovery, and clean scenarios, configured for Windows and Linux CI. Local validation also exercises multiple Node applications on PATH and an effective installation-strategy change through the process environment. Both packaged target-framework assemblies retain byte-identical copies of all frontend assets, including fonts, images, and source maps.

Installation now runs through npm run restore, using the selected npm CLI and its configured registry/cache. The wrapper makes up to three clean-install attempts for structured npm ECONNRESET failures, including interrupted response bodies, and preserves npm debug logs and actual child-signal diagnostics. Other failures retain their exit status. Nine real-npm regression cases exercise recovery, bounded exhaustion, lifecycle execution, deterministic failures, and the composed MSBuild stamp boundary.

Discovery cost

Each outer build, including an otherwise unchanged build, executes node --version, npm --version, and a scoped npm config get once. These three serialized discovery commands keep tool and npm configuration invalidation current across all target frameworks. The prior up-to-date frontend target executed zero discovery commands, so this change adds discovery overhead to that path while eliminating repeated installation on source edits and Rebuild.

The existing two-framework no-op binlog for the initial implementation (d4edfede9b) records exactly three discovery Exec tasks, all in the outer project: 0.259 s for Node identity, 2.326 s for npm identity, and 4.148 s for npm configuration, totaling 6.734 s. PrepareNpmAppInstall executed once and took 6.958 s. These are elapsed observations from one shared-machine sample, including contention and subprocess launch costs, rather than a steady-state overhead estimate or an unchanged-build speedup claim.

Microsoft Reviewers: Open in CodeFlow

Copilot AI balanced review requested due to automatic review settings October 30, 2026 02:23

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 Node shim breaks Ubuntu CI before regression tests and builds run, while the installation fingerprint omits install-strategy, allowing stale dependency layouts to persist.

2 open issues
What changed in this PR

This PR separates dependency installation from frontend compilation in the Orleans Dashboard build, allowing source edits and Rebuild to reuse installed npm dependencies.

Changes:

  • Adds separate installation and compilation stamps, with content-based invalidation and generated-asset tracking.
  • Adds 15 regression scenarios and runs them in Windows and Linux CI.
  • Updates documentation for asset embedding and Clean/Rebuild behavior.
File Description
src/​Dashboard/​Orleans.Dashboard/​Orleans.Dashboard.Frontend.targets Separates installation and build invalidation and tracks generated assets.
src/​Dashboard/​Orleans.Dashboard.App/​README.md Documents output paths, dependency reuse, and rebuild behavior.
.github/​workflows/​ci.yml Adds the frontend incrementality regression step.
.github/​scripts/​test-dashboard-frontend.ps1 Tests invalidation, failure recovery, asset ownership, and cleaning.

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 30, 2026 02:38

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 are recorded for the changes separating Dashboard dependency installation from frontend compilation.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 30, 2026 02:45

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 are recorded for the separation of Dashboard dependency installation from frontend compilation.

No open issues 🎉

Review effort: Balanced

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.

🔵 Needs a closer look

Human assessment is needed to evaluate the risk of reusing incompatible native dependencies when npm platform settings change without invalidating the installation fingerprint.

No open issues 🎉

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 31, 2026 04:40

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.

🔵 Needs a closer look

Human assessment is needed because an unpublished finding identifies a risk of reusing incompatible native dependencies after architecture or npm platform-selector changes.

No open issues 🎉

Review effort: Balanced

Retry only npm structured ECONNRESET failures after the native request retry layer has finished. Preserve selected npm, configured feeds/cache, real ci and lifecycle execution, failure debug logs, actual signals, and frontend build gating. Make the installer exit code authoritative so recovered debug traces do not become MSBuild errors.

(cherry picked from commit c73dad75d756bd303a9d915e6c19079a65a4c5d1)
@ReubenBond
ReubenBond force-pushed the rb-dashboard-build-incrementality branch from 63279ee to dcd9c99 Compare October 31, 2026 16:46
Copilot AI balanced review requested due to automatic review settings October 31, 2026 16:47

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.

🔵 Needs a closer look

The fixture exercises Clean;Build rather than framework Rebuild targets, leaving Clean/Rebuild ordering and stamp lifetime unvalidated when those targets clean shared frontend state in a real multi-target SDK project.

No open issues 🎉

Review effort: Balanced

This branch has not been deployed

No deployments
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