Publish PR artifacts early and reuse them across validation - #870
Conversation
Reuse same-run packages across validation and samples, retain strict merge gates, and cancel superseded PR runs. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Preserve All coverage across two fail-fast-disabled lanes and consolidate reports for existing test reporting and metrics. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Failed validation on main can replace the successful metrics baseline used for future PR comparisons.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Publishes build artifacts early, then reuses them across independent validation jobs.
Changes:
- Adds artifact-production and reuse modes with regression coverage.
- Refactors validation, samples, metrics, and aggregate checks.
- Documents early artifacts as awaiting validation.
File summaries
| File | Description |
|---|---|
scripts/build-cli.ps1 |
Adds artifact reuse and separated validation. |
scripts/package-npm.ps1 |
Validates generated npm commands before packaging. |
scripts/tests/build-cli.Tests.ps1 |
Tests build modes and failure handling. |
scripts/tests/artifact-workflow.Tests.ps1 |
Tests workflow dependencies and metrics gates. |
.github/workflows/build-package.yml |
Splits artifact production from validation. |
.github/workflows/test-samples.yml |
Reuses same-run packages for sample tests. |
.github/workflows/post-metrics-comment.yml |
Clarifies validation and test status. |
.github/actions/collect-metrics/action.yml |
Requires complete test reports. |
README.md |
Documents early PR downloads. |
AGENTS.md |
Documents the new build and CI workflow. |
Review details
- Files reviewed: 10/10 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Allow failure metrics only for pull-request reports; retain successful non-PR baselines. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Leave failure reporting and required validation gates intact while avoiding empty-artifact errors on canceled runs. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Use an absolute Pester report path so sample cleanup cannot relocate reports; fail uploads when expected results are missing. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Build Metrics ReportBinary Sizes
Test Results✅ 7494 passed, 37 skipped out of 7531 tests in 1680.4s (+180.7s vs. baseline) Test Coverage✅ 85.8% line coverage, 80.1% branch coverage · CLI Startup Time49ms median (x64, Try This BuildInstalls the MSIX for your architecture, replacing any previously installed build. Needs the GitHub CLI — the command offers to install it and sign you in if it is missing. & ([scriptblock]::Create((irm https://raw.githubusercontent.com/microsoft/winappCli/main/scripts/winapp-pr.ps1))) 870Switching between builds often?Put the tool on your PATH once: & ([scriptblock]::Create((irm https://raw.githubusercontent.com/microsoft/winappCli/main/scripts/winapp-pr.ps1))) -AddToPathThen this build is just: winapp-pr 870Run Updated 2026-09-18 20:00:31 UTC · commit |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Package verified same-commit architecture outputs without republishing, partition CLI tests exhaustively with complementary MTP filters, and run auxiliary validation once. Preserve unique reports, coverage union, and strict aggregate gates. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Pass the warning-as-error property previously provided by the full solution build when the analyzer suite builds independently. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Return both publishes and packaging to one artifact producer. Remove unpublished architecture-only modes and provenance scaffolding after measured overhead outweighed the latency benefit. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Use MTP's executed-test minimum only to reject empty execution; retain exact discovery-to-TRX totals, complete result-state accounting, coverage requirements and all nonzero exits. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🔵 Needs a closer look
The required-check orchestration and artifact trust boundaries warrant final human verification despite comprehensive tests and a green hosted run.
Review details
- Files reviewed: 14/14 changed files
- Comments generated: 0 new
- Review effort level: Balanced
Re-running a single failed lane fails on the artifact name, not the testsWhat is wrong: Splitting Artifacts have to persist across attempts, incidentally — that is exactly why the re-run lane can still download Show me:
Expected: re-running the failed lane replaces its results artifact and the run can go green. The same applies to the combined Note the shape of it: the conflict only occurs when tests genuinely ran and one failed — precisely the case worth retrying. If a lane dies before producing results, Why it matters: "Re-run all jobs" still works, because GitHub deletes the previous attempt's artifacts on a full re-run. But that re-runs Smallest fix: add one input to the affected upload steps. - name: Upload test results
if: ${{ !cancelled() }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: validation-results-${{ matrix.lane }}
path: artifacts/TestResults/
if-no-files-found: error
overwrite: trueSame on Worth a regression test in Related, lower severity: a failing test on
|
Overwrite only each producer's own artifacts on rerun. Collect failed validation reports on all events while gating main baseline promotion on successful validation. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Fixed both issues from your review in bc0dece. Every producer now overwrites only its own uniquely named artifacts, including samples and metrics-data. Failed main/manual validation publishes combined test-results, while successful-validation gating still protects main baseline promotion. Verified run 35384710380: the full run passed; attempt 2 reran only Auxiliary and its dependent reporting jobs, replacing exactly Auxiliary/test-results/metrics-data while all 23 other artifact IDs and digests remained unchanged. Attempt 3 reran only packaging-cli and its aggregates, replacing only that sample report; all 25 siblings remained unchanged. Package producer timestamps were unchanged throughout—no rebuild and no 409 conflicts. All 25 workflow regressions and actionlint passed, including failed-main reporting versus baseline-promotion conditions. The current-head CLI/docs build passed. Both issues are addressed; no validation gates or tests were removed. |
|
Verified Artifact overwrite. All 12 uploads now set I checked the one way Failed-main reporting. Moving the gate from the job to the I also confirmed Verification on my side. No further findings from me. 👍 |
Description
Publish downloadable PR packages before full validation finishes, then run validation in parallel without removing any test or merge gate.
-SkipTests -SkipDocs. Existing CLI, npm, MSIX and four NuGet artifacts become downloadable immediately, labeled awaiting validation.PackageCommandTests; shard 2 uses its exact complement, automatically covering new tests. Each invocation checks nonempty/exhaustive discovery, at least one executed test, exact discovery-to-TRX totals including intentional skips, complete result states and coverage output. No process failure is ignored.test-resultsartifact. Reject missing/extra reports and union overlapping coverage rather than averaging percentages or duplicating source-line denominators.build-and-package/test-samples-resultchecks. Failures, cancellations and unexpected dependency skips cannot pass.Default local/ADO All behavior and full main/manual validation remain. Manual sample runs stay self-contained. The parallel-architecture experiment and its unpublished modes/provenance scaffolding were removed with user approval after measuring insufficient benefit.
Review fixes verified on current HEAD
bc0dece8addresses both issues in the artifact-rerun/reporting review: each producer overwrites only its own uniquely named artifacts on rerun, and failed main/manual validation still publishes combined test reports without promoting a failed metrics baseline.Run 35384710380 passed on that HEAD, including two controlled partial reruns:
validation-results-Auxiliary,test-results, andmetrics-datareceived new artifact IDs; the other 23 IDs and digests were unchanged.packaging-clisample and its aggregate checks. Onlytest-results-packaging-cliwas replaced; the other 25 artifacts were unchanged.All 25 targeted workflow regressions and actionlint passed, including the failed-main report/baseline-promotion truth table. Both architectures built and generated documentation validated locally. Current merged reports contain 7,531 .NET cases: 7,494 passed, zero failed, 37 intentional skips; coverage is 85.8% lines / 80.1% branches. These counts include changes already present in the live PR head before the review fixes. No inline review threads remain unresolved.
Usage Example
CI selects
-TestSuite Cli -CliShard 1,-TestSuite Cli -CliShard 2,-TestSuite Auxiliary, and-TestSuite UIAutomationon separate runners, never concurrently in one checkout.Related Issue
N/A
Type of Change
Final measured result
Run 35290431008, HEAD
256db41b: all build, validation, sample and aggregate checks passed.The original observed workflows withheld downloads until roughly 30+ minutes. The successful intermediate Core/UI comparisons took 37m 47s / 121.0 runner-minutes and 39m 41s / 136.95 runner-minutes. The final run finished 9m 53s sooner than the closer comparison, while using 8.9 more runner-minutes. Across-run restore/runtime/sample variation means these are observed comparisons, not controlled benchmark guarantees. Electron was the final run's longest downstream job at 17m 52s.
The removed architecture experiment made packages available in 9m 30s versus 9m 52s–10m 02s in then-current serial-publish runs, but cost about five extra artifact runner-minutes. That variance-sized latency difference did not justify the extra orchestration.
Verification
Final hosted run:
Local final validation also passed 228 script regressions, real Windows package builds, generated docs/schema checks and actionlint. A containment test now uses the existing architecture-aware published-binary helper rather than choosing the newest
binexecutable, avoiding ARM64 selection on x64. No product code changed.Issues found and resolved during measurement
The initial shard minimum used the discovered count with MTP's
--minimum-expected-tests, but that option counts executed tests and excludes intentional skips. It was corrected to minimum 1 with separate exact TRX accounting. Real passing-plus-skipped and all-skipped MTP runs verified the semantics; regressions still reject missing cases, partial reports, all-skipped runs, failed/nonterminal states and every nonzero process exit.An unchanged native Media Foundation test failed once in the expanded experiment. It passed in both later hosted runs, including the final green run; its original cause remains unproven. No test was retried away, skipped or weakened to hide it. Failed intermediate runs remained red and retained diagnostic reports.
Checklist
MainProtection's exact
build-and-packagecontext remains. The branch is behind newer main changes, which were deliberately not chased by repeatedly canceling measurements. A current-base update may be required by strict branch protection before landing. The PR remains open and unmerged.