Skip to content

ci(templates): Prioritize release path; gate nuget.org on publish, advise on PRs - #2184

Merged
agneszitte merged 1 commit into
mainfrom
dev/agzi/ci-prioritize-release-path
Jul 29, 2026
Merged

agneszitte merged 1 commit into
mainfrom
dev/agzi/ci-prioritize-release-path

Conversation

@agneszitte

@agneszitte agneszitte commented Jul 28, 2026 •

Copy link
Copy Markdown
Member

This PR makes two related CI changes to the release path. Both need to reach release/stable/6.6 for 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 particular sign (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 for build + the publish jobs before generating the matrix.

Behavior

  • Merge build: build → sign → publish* runs first (grabs the runners); the test matrix runs after publication. Release fast-forwards.
  • PRs / schedule / dispatch: the publish jobs are skipped (push-only), so the skip-tolerant condition lets the matrix run right after build — 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

Path Job Scope
Dev publish (push to main) verify_dependencies_dev → gates publish_dev full closure
Prod publish (push to release/**) verify_dependencies_prod → gates publish_release_nuget_org (runs publish_release_uno → verify → publish_nuget_org) full closure
Pull request report_dependencies (non-blocking) prerelease (dev) deps, direct manifest entries
  • The publish gates guarantee we never push a package publicly while a dependency (or a previously-released stable, in release order) is missing from nuget.org.
  • PRs never block. report_dependencies runs 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).
  • Fixed a latent list-return bug (return ,$list) so an empty/filtered result keeps its List typing.

New build/Report-MissingDependenciesOnPr.ps1

Reads the report JSON, groups packages by manifest line, and posts an idempotent (hidden per-version:line marker), resolvable review-thread comment per line. Never fails the job; -DryRun for local runs.


Validation

  • Unit: 44/44 Pester green (added Test-IsPrereleaseVersion, Select-ChecksForVerification, ConvertTo-MissingDependencyReport, prerelease-only transitive behavior).
  • End-to-end (real nuget.org): prerelease-only skips a fake stable + verifies a public dev pkg; full closure fails on the fake stable; stable-only manifest (the chore(sdk): Update Uno.Sdk to 6.6 SR2 (6.6.184) + register SimpleTheme packages #2178 case) → 0 checked; report-only emits JSON + exits 0; poster -DryRun locates the correct line; the exact gh api review-comment call posts + is resolvable.
  • Live on this PR: a temporary version bump made report_dependencies post a resolvable inline comment (github-actions[bot], anchored on the manifest line, non-blocking); the temp change has been reverted.
  • CI wiring: ci.yml parses; job graph verified, no cycles; Verify Dependencies (dev publish) correctly skips on PRs.

Follow-up to #2181. Both changes need to be on release/stable/6.6 for the 6.6 SR2 prod release — backport after merge.

Related to https://github.com/unoplatform/private/issues/1102

Copilot AI review requested due to automatic review settings July 28, 2026 20:49

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.

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-matrix wait for the publish jobs (dev on main, production on release/**) so the test matrix starts after publication on merge builds.
  • Adds an if: ${{ always() && ... }} condition so generate-test-matrix still 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.

Comment thread .github/workflows/ci.yml Resolved
@agneszitte

Copy link
Copy Markdown
Member Author

@Mergifyio backport release/stable/6.6

@mergify

mergify Bot commented Jul 28, 2026 •

Copy link
Copy Markdown

backport release/stable/6.6

✅ Backports have been created

Details

Copilot AI review requested due to automatic review settings July 28, 2026 21:51
@agneszitte
agneszitte force-pushed the dev/agzi/ci-prioritize-release-path branch from 65a15d8 to c778c2d Compare July 28, 2026 21:51

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.

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-matrix is currently gated on each publish job being success or skipped. On push builds, 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') }}

Copilot AI review requested due to automatic review settings July 29, 2026 01:23
@agneszitte agneszitte changed the title ci(templates): Prioritize release path over tests on merge builds ci(templates): Prioritize release path + release-channel-aware nuget.org gate Jul 29, 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.

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-ChecksForVerification is trying to return the same List[object] instance so later Add-DependencyCheck -Checks $checks and Build-DependencySourcesMap -Checks $checks (both strongly typed to List[object]) keep working. However, return ,$Checks / return ,$filtered produces 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-ChecksForVerification tests only assert .Count / indexing, which would still pass if the function accidentally returned an array (or enumerated output) instead of the intended List[object]. Since the main script relies on getting a List[object] back (it later calls Add-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

Copilot AI review requested due to automatic review settings July 29, 2026 01:29

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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings July 29, 2026 02:02
Comment thread src/Uno.Sdk/packages.json Resolved
@agneszitte agneszitte changed the title ci(templates): Prioritize release path + release-channel-aware nuget.org gate ci(templates): Prioritize release path; gate nuget.org on publish, advise on PRs Jul 29, 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.

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-matrix will not run when any publish job fails (only success/skipped are 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). Since needs already 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 -AsArray is not available in all PowerShell versions; relying on it can make the reporting path fail on runners/environments with older pwsh. 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_dependencies posts 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 -PrereleaseDependenciesOnly parameter 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.

Copilot AI review requested due to automatic review settings July 29, 2026 02:07
@agneszitte
agneszitte force-pushed the dev/agzi/ci-prioritize-release-path branch from e1a366d to 1afbe66 Compare July 29, 2026 02:07
@unoplatform unoplatform deleted a comment from mergify Bot Jul 29, 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.

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-matrix currently requires the publish jobs to be success (or skipped). 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 allowing failure as well and only excluding cancelled.
      ${{ 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]>
Copilot AI review requested due to automatic review settings July 29, 2026 02:17
@agneszitte
agneszitte force-pushed the dev/agzi/ci-prioritize-release-path branch from 1afbe66 to 9e13652 Compare July 29, 2026 02:17
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