Skip to content

fix(samples): isolate Razor compilation in CI - #11298

Merged
ReubenBond merged 2 commits into
dotnet:mainfrom
ReubenBond:rb-fix-shoppingcart-razor-ci
Sep 17, 2026
Merged

ReubenBond merged 2 commits into
dotnet:mainfrom
ReubenBond:rb-fix-shoppingcart-razor-ci

Conversation

@ReubenBond

@ReubenBond ReubenBond commented Sep 17, 2026 •

Copy link
Copy Markdown
Member

The documentation workflow intermittently corrupts Razor-generated sources in its long-lived compiler server, producing spurious RZ1021 and cascading C# errors in the ShoppingCart sample. The identical commit passed after the job restarted, matching the compiler-server corruption documented in dotnet/roslyn#85656 and dotnet/roslyn#85196.

DOTNET_TieredPGO=0 is not sufficient evidence of resolution because dotnet/roslyn#85656 includes later recurrence reports with that setting active. This change instead adds an opt-in Build-Samples.ps1 switch which passes UseSharedCompilation=false only to the sample solution build. That bypasses the stateful compiler server for the affected Razor workload while preserving the standard sample compilation requirement. The CI job uses no-incremental builds and previously completed in under five minutes against a 45-minute timeout, leaving ample capacity for the isolated compiler processes.

The runtime fix in dotnet/runtime#132631 is scheduled for 10.0.13. Once global.json selects an SDK carrying runtime 10.0.13 or later, remove the switch and validate shared compilation across repeated pull-request and scheduled Documentation runs. If the Razor corruption recurs, restore the bounded switch and continue investigation with generated sources and binlogs against dotnet/roslyn#85656.

Mitigates #11235

Copilot AI lite review requested due to automatic review settings September 17, 2026 08:14

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.

Copilot review overview

🟢 Approval recommended

The change is a scoped, low-risk CI mitigation applied only to the affected workflow job and is clearly documented for future removal.

Review effort: Lite
Findings: None

What changed in this PR

Mitigates intermittent Razor compilation failures in the documentation/samples CI job by disabling Tiered PGO via an environment variable, aligning with the documented workaround for the suspected runtime/JIT issue until the repo’s pinned SDK/runtime is updated.

Changes:

  • Adds DOTNET_TieredPGO=0 at the job level for the “Build documentation projects and samples” workflow job.
  • Documents the linked tracking issue and removal criteria in the workflow comments.
File Description
.github/​workflows/​docs.yml Sets a job-scoped environment variable to disable Tiered PGO to stabilize Razor compilation in CI for docs/samples.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@ReubenBond ReubenBond changed the title fix(samples): stabilize Razor compilation in CI fix(samples): isolate Razor compilation in CI Sep 17, 2026
@github-actions

github-actions Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Code coverage

Metric Pull request Current main Variance
Lines 82.06% (112,189 / 136,709) 82.12% (112,272 / 136,709) -0.0607 pp
Branches 71.24% (32,270 / 45,295) 71.32% (32,306 / 45,295) -0.0795 pp

Report-only conclusion: regressed.

The current-main baseline is commit 2e40fa8a3b and uses the same reviewed coverage matrix.

Coverage combines every CI test matrix job, including providers, CodeGen, .NET 8/10, Linux, Windows, and macOS, using canonical physical source and branch identities.

The comparison remains report-only while normal line and branch variance is calibrated.

Coverage details

Copilot AI review requested due to automatic review settings September 17, 2026 08: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.

Copilot review overview

🟢 Approval recommended

The change is narrowly scoped to CI/sample build behavior, is opt-in at the script level, and cleanly adds diagnostics without affecting default local builds.

Review effort: Lite
Findings: None

@ReubenBond
ReubenBond merged commit 35f61ae into dotnet:main Sep 17, 2026
73 checks passed
@ReubenBond
ReubenBond deleted the rb-fix-shoppingcart-razor-ci branch September 17, 2026 13:58
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