Repository navigation
ci(templates): Prioritize release path; gate nuget.org on publish, advise on PRs - #2184
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adjusts the CI job dependency graph so merge builds (pushes to main / release/**) prioritize the release pipeline (build → sign → publish*) ahead of the large template test matrix, reducing runner contention and speeding up signing/publication.
Changes:
- Makes
generate-test-matrixwait for the publish jobs (dev onmain, production onrelease/**) so the test matrix starts after publication on merge builds. - Adds an
if: ${{ always() && ... }}condition sogenerate-test-matrixstill runs when publish jobs are skipped (PRs/schedule/dispatch), while preserving failure propagation when publish jobs fail.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@Mergifyio backport release/stable/6.6 |
✅ Backports have been createdDetails
|
65a15d8 to
c778c2d
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
.github/workflows/ci.yml:202
generate-test-matrixis currently gated on each publish job beingsuccessorskipped. Onpushbuilds, any publish failure (e.g., transient nuget.org outage) will prevent the entire template test matrix from running, which is a behavior change vs. before and can reduce diagnostics on main/release pushes.
If the goal is only to delay tests until after the publish path completes (regardless of outcome), you can keep the needs: ordering but drop the publish result checks and rely on always() + needs to ensure the job waits for publish completion.
&& (needs.publish_dev.result == 'success' || needs.publish_dev.result == 'skipped')
&& (needs.publish_release_uno.result == 'success' || needs.publish_release_uno.result == 'skipped')
&& (needs.publish_release_nuget_org.result == 'success' || needs.publish_release_nuget_org.result == 'skipped') }}
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (2)
build/Verify-NuGetDependenciesOnNuGetOrg.ps1:324
Select-ChecksForVerificationis trying to return the sameList[object]instance so laterAdd-DependencyCheck -Checks $checksandBuild-DependencySourcesMap -Checks $checks(both strongly typed toList[object]) keep working. However,return ,$Checks/return ,$filteredproduces an array wrapper and does not reliably prevent enumeration; this can change the type seen by the caller and break later.Add()usage.
Return the list as a single object using Write-Output -NoEnumerate (or equivalent) instead of the unary comma.
# Return with the unary comma so the List is passed back intact: a bare `return $list`
# is enumerated by the pipeline (collapsing an empty list to $null and a single-item list
# to a scalar), which would break the caller's List typing and later `.Add()` calls.
if (-not $PrereleaseDependenciesOnly) {
return ,$Checks
build/Verify-NuGetDependenciesOnNuGetOrg.Tests.ps1:109
- The
Select-ChecksForVerificationtests only assert.Count/ indexing, which would still pass if the function accidentally returned an array (or enumerated output) instead of the intendedList[object]. Since the main script relies on getting aList[object]back (it later callsAdd-DependencyCheck -Checks $checks), add an explicit type check so this contract can’t regress silently.
It 'returns the list unchanged when the switch is off (full closure)' {
$checks = [System.Collections.Generic.List[object]]::new()
$checks.Add([PSCustomObject]@{ Id = 'Uno.A'; Version = '7.0.3'; Source = 't' })
$checks.Add([PSCustomObject]@{ Id = 'Uno.B'; Version = '7.1.0-dev.1'; Source = 't' })
$result = Select-ChecksForVerification -Checks $checks -PrereleaseDependenciesOnly $false
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (4)
.github/workflows/ci.yml:256
generate-test-matrixwill not run when any publish job fails (onlysuccess/skippedare allowed). This changes behavior from “prioritize release path” to “skip tests entirely on publish failure,” which can hide useful test signal when publication fails for non-code reasons (token outage, transient nuget.org errors). Sinceneedsalready enforces ordering, you can let the matrix run after the publish jobs complete regardless of their conclusion.
if: >-
${{ always()
&& needs.build.result == 'success'
&& (needs.publish_dev.result == 'success' || needs.publish_dev.result == 'skipped')
&& (needs.publish_release_uno.result == 'success' || needs.publish_release_uno.result == 'skipped')
&& (needs.publish_release_nuget_org.result == 'success' || needs.publish_release_nuget_org.result == 'skipped') }}
build/Verify-NuGetDependenciesOnNuGetOrg.ps1:814
ConvertTo-Json -AsArrayis not available in all PowerShell versions; relying on it can make the reporting path fail on runners/environments with olderpwsh. You can force array output portably by using-InputObject @($reportPayload)instead.
if ($ReportOnly -and -not [string]::IsNullOrWhiteSpace($ReportOutputPath)) {
$reportPayload = ConvertTo-MissingDependencyReport -MissingDependencies $missingDependencies
($reportPayload | ConvertTo-Json -Depth 5 -AsArray) | Set-Content -Path $ReportOutputPath -Encoding utf8
Write-Host "ReportOnly: wrote $($reportPayload.Count) missing dependency record(s) to '$ReportOutputPath'."
.github/workflows/ci.yml:77
- PR description says PRs should “fail fast” on missing prerelease (dev) dependencies, but the updated workflow explicitly makes PR dependency verification non-blocking (
report_dependenciesposts comments and the build/tests proceed). Please align either the PR description or the workflow behavior so reviewers don’t expect PR failures that won’t happen.
# The nuget.org dependency verification is a HARD GATE only on the publication paths:
# * dev publish (push to main) -> verify_dependencies_dev (this job) gates publish_dev
# * prod publish (push to release/**) -> verify_dependencies_prod gates publish_release_nuget_org
# On PRs it is NOT a gate: the build restores from the internal feed, so a dev package that is not
# yet on nuget.org does not block the PR -- report_dependencies surfaces it as a resolvable comment.
build/Verify-NuGetDependenciesOnNuGetOrg.ps1:29
- The
-PrereleaseDependenciesOnlyparameter comment frames this as a “PR fail-fast” mode, but in the current workflow it’s also used for non-blocking PR reporting (-ReportOnly). Updating the wording would help avoid confusion about whether PRs are expected to fail.
# PR fail-fast pass: verify ONLY prerelease (dev) coordinates on nuget.org, skipping every
# stable-versioned dependency (direct or transitive). Dev packages are published to nuget.org
# continuously, so a missing one is a genuine error worth failing a PR fast; stable versions may
# legitimately be unpublished while a stable release is staged on the internal feed first, and
# are gated later — only right before the nuget.org publish. Full-closure (switch off) is used
# for the dev-publish (main) path and the pre-prod-publish gate.
e1a366d to
1afbe66
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (2)
build/Report-MissingDependenciesOnPr.ps1:40
- The header comment says this script “Never throws … so the job stays green”, but with
$ErrorActionPreference = 'Stop'the JSON read/parse (Get-Content | ConvertFrom-Json) will still terminate the job if the report file is empty/corrupted/truncated. Wrapping the JSON load in a try/catch (and returning after logging a warning) makes the behavior match the non-blocking intent.
$missing = @(Get-Content -Path $ReportPath -Raw | ConvertFrom-Json)
if ($missing.Count -eq 0) {
Write-Host "No missing dependencies reported; nothing to comment."
return
}
.github/workflows/ci.yml:256
generate-test-matrixcurrently requires the publish jobs to besuccess(orskipped). If a publish job fails (e.g., transient nuget push issue), the test matrix will never generate and the entire template test suite will be skipped, even though tests could still provide useful signal. If the intent is only to wait until publish completes (to prioritize runners), consider allowingfailureas well and only excludingcancelled.
${{ always()
&& needs.build.result == 'success'
&& (needs.publish_dev.result == 'success' || needs.publish_dev.result == 'skipped')
&& (needs.publish_release_uno.result == 'success' || needs.publish_release_uno.result == 'skipped')
&& (needs.publish_release_nuget_org.result == 'success' || needs.publish_release_nuget_org.result == 'skipped') }}
…vise on PRs
Two related CI changes to the release path (backport to release/stable/6.6 after merge).
1) Prioritize release path over tests on merge builds
generate-test-matrix waits for build + the publish jobs, so on a push to
main/release the sign + publish jobs grab the hosted runners first and the
test matrix runs after publication. On PRs/schedule/dispatch the publish
jobs skip, so the skip-tolerant condition runs the matrix right after build.
2) Gate the nuget.org dependency check on publication only; advise on PRs
The check previously blocked every trigger on the full Uno.* closure being
public, which wrongly failed stable-release builds and PRs referencing
not-yet-published stable versions (stable packages are staged on the internal
feed and tested first, published to nuget.org only at the end). Now:
- verify_dependencies_dev gates publish_dev (push to main, full closure)
- verify_dependencies_prod gates publish_release_nuget_org (release, full
closure; runs publish_release_uno -> verify -> publish_nuget_org)
- report_dependencies (PRs) is non-blocking: it runs the check in report-only
+ prerelease-only mode and posts a resolvable inline comment for any dev
dependency not yet on nuget.org. Build/tests are unaffected (internal feed),
and internal-feed-only packages surface as advisories, not false failures.
Script (Verify-NuGetDependenciesOnNuGetOrg.ps1):
- Add -PrereleaseDependenciesOnly (verify only prerelease coordinates, direct +
transitive) and -ReportOnly / -ReportOutputPath (collect + emit JSON, no throw).
- Return the checks list with a unary comma so an empty/filtered result keeps its
List typing (a bare return enumerates to a scalar/null and breaks later .Add()).
- Splat params via hashtable in ci.yml (an array splat binds positionally).
New build/Report-MissingDependenciesOnPr.ps1:
- Groups missing packages by manifest line and posts idempotent (per version:line
marker), resolvable review-thread comments; never fails the job. -DryRun for
local validation.
Decouple build from the gate; drop verify_dependencies from generate-test-matrix.
Validation: 44/44 Pester; report-mode + poster DryRun + live gh api call; and a
temporary version bump confirmed report_dependencies posts a resolvable inline
comment on the PR (reverted).
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
1afbe66 to
9e13652
Compare
This PR makes two related CI changes to the release path. Both need to reach
release/stable/6.6for the 6.6 SR2 prod release (backport after merge).1. Prioritize release path over tests on merge builds
Problem
On a merge build (push to
main/release/**) the release path — Build → Sign → Publish — competes with the template test matrix (24×3 jobs) for hosted runners. In particularsign(windows-latest) queues behind the 24 Windows test jobs, so signing + publication only start once a runner frees up — delaying the release.Change
GitHub Actions has no native job priority, so it's expressed as a dependency:
generate-test-matrix(which every test job already depends on) is gated on the full release path — it waits forbuild+ the publish jobs before generating the matrix.Behavior
build → sign → publish*runs first (grabs the runners); the test matrix runs after publication. Release fast-forwards.push-only), so the skip-tolerant condition lets the matrix run right afterbuild— tests prioritized, no regression.2. Gate the nuget.org check on publication only; advise on PRs
Problem
The nuget.org dependency check (added in #2181) blocked every trigger on the full Uno.* closure being public. That's correct for dev, but wrong for a stable release: stable packages are built + signed + pushed to the internal feed and deeply tested first, and are published to nuget.org only at the very end. So a stable release build — or a PR bumping the SDK to not-yet-published stable versions (e.g. #2178) — failed on packages that are intentionally not public yet. A PR build doesn't even need nuget.org (it restores from the internal feed), so blocking it was guarding a non-problem.
Change — the blocking gate lives only where we publish
main)verify_dependencies_dev→ gatespublish_devrelease/**)verify_dependencies_prod→ gatespublish_release_nuget_org(runspublish_release_uno → verify → publish_nuget_org)report_dependencies(non-blocking)report_dependenciesruns the check in report-only + prerelease-only mode and, for any dev dependency not yet on nuget.org, posts a resolvable inline PR comment on the manifest line. The build/tests are unaffected (internal feed). This also future-proofs internal-feed-only packages: they surface as advisory comments, not false failures.Script (
Verify-NuGetDependenciesOnNuGetOrg.ps1)-PrereleaseDependenciesOnly— verify only prerelease-versioned coordinates (direct + transitive); stable versions skipped.-ReportOnly/-ReportOutputPath— collect missing deps and emit JSON without failing (for the PR advisory).return ,$list) so an empty/filtered result keeps itsListtyping.New
build/Report-MissingDependenciesOnPr.ps1Reads the report JSON, groups packages by manifest line, and posts an idempotent (hidden per-
version:linemarker), resolvable review-thread comment per line. Never fails the job;-DryRunfor local runs.Validation
Test-IsPrereleaseVersion,Select-ChecksForVerification,ConvertTo-MissingDependencyReport, prerelease-only transitive behavior).-DryRunlocates the correct line; the exactgh apireview-comment call posts + is resolvable.report_dependenciespost a resolvable inline comment (github-actions[bot], anchored on the manifest line, non-blocking); the temp change has been reverted.ci.ymlparses; job graph verified, no cycles;Verify Dependencies (dev publish)correctly skips on PRs.Related to https://github.com/unoplatform/private/issues/1102