Repository navigation
Switch release flow to draft-then-publish for immutable releases - #18068
Conversation
Today the release pipeline creates a GitHub release as published and then mutates it (CLI assets, agentic notes rewrite, homebrew validation against the public download URL). All of those operations are blocked by GitHub's immutable-releases setting. This change moves every mutation to occur while the release is still a draft, then a human publishes the draft as the final step: - release-github-tasks.yml: gh release create now passes --draft; placeholder body and job summary tell the release manager they need to publish the draft after review. - release-notes-generate.md: trigger flipped to release: [created], draft guard inverted so the agentic notes update runs against the draft. Step 1 makes draft == false the early-exit case. lock.yml recompiled with gh-aw v0.77.5. - release-publish-nuget.yml: removed HomebrewValidateJob (and the SkipHomebrewValidation parameter). Homebrew validation needs the public download URL, which is only available after publish. - homebrew-validate-release.yml: NEW. Runs on release: [released] + workflow_dispatch, regenerates the cask via eng/homebrew/generate-cask.sh against the now-public release URL and runs the full validation in LiveRelease mode. Comment asks reviewers to ping @radical. - docs/release-process.md: adds the draft-then-publish section, lists the five components, and renumbers post-release steps into 4 verify / 5 publish / 6 comms with the architecture diagram updated. Post-merge steps tracked separately: - Backport PR #17869 (GH_ALLOWED_BOTS) to release/13.4. - Enable the repository's 'Immutable releases' setting. Co-authored-by: Copilot <[email protected]>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 18068Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 18068" |
- extension-release.yml: drop SkipHomebrewValidation from the extension-only release parameter table. The parameter was removed from release-publish-nuget.yml in the previous commit, so any release manager copy-pasting from the generated PR body would have hit a hard 'parameter not defined' AzDO error. - eng/homebrew/README.md: rewrite the CI Pipeline section and LiveRelease row to point at homebrew-validate-release.yml instead of the removed HomebrewValidateJob. Add a Note documenting the trade-off introduced by regenerating the cask from scratch (generate-cask.sh becomes the de-facto source of truth) so future contributors understand the hidden coupling. - release-notes-generate.md: remove the misleading 'fall back to listing releases' paragraph. The agent never executes the lookup; gh-aw's compiled update_release.cjs does, and it has no list fallback. The GitHub App token sees drafts via getReleaseByTag, so the fallback was never going to fire. - release-github-tasks.yml: replace the dead 'untagged-<version>' draft link in the run summary with the Releases page (GitHub assigns drafts a random hex identifier, not the version). Explain inline why there is no stable deep link until publish. - homebrew-validate-release.yml: SHA-pin actions/checkout to v6.0.2 to match the rest of the workflows (zizmor scan requires this). Add an inline note tagging @radical to flag the cask-regeneration trade-off for review. - Stale comment cleanup in prepare-homebrew-cask.yml, prepare-cask-artifact.sh, validate-cask-artifact.sh, and ReleasePublishNugetPipelineTests.cs to remove references to the removed HomebrewValidateJob. Tested: ReleasePublishNugetPipelineTests still pass (17/17). Co-authored-by: Copilot <[email protected]>
|
❓ CLI E2E Tests unknown — 113 passed, 0 failed, 2 unknown (commit View all recordings
📹 Recordings uploaded automatically from CI run #27243506136 |
Resolves conflicts from 527 commits of main drift. Key resolutions:
- release-publish-nuget.yml: keep main's UpdateNixPackageJob, drop the
in-pipeline HomebrewValidateJob (moved to the post-publish
homebrew-validate-release.yml workflow); merge Stage-3 narrative +
stage condition; drop SkipHomebrewValidation param.
- docs/release-process.md: merge draft-then-publish narrative with main's
Nix flake flow; adopt main's Marketplace service-connection wording.
- ReleasePublishNugetPipelineTests.cs: expected-jobs list now
{PublishReleaseAssetsJob, UpdateNixPackageJob}; drop stale
SkipHomebrewValidation assertion.
- release-notes-generate.lock.yml: recompiled with gh-aw v0.86.2 from the
merged .md (trigger release:[created], guard draft==true).
- eng/homebrew/README.md: point at homebrew-validate-release.yml.
Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 053d9b6f-21e9-404b-9174-c610ae3a3741
The Nix manifest updater previously read each aspire-cli-*.tar.gz.sha512 asset from the published GitHub release. Under immutable releases the release is a draft while the pipeline runs, and a draft's assets aren't served from the public releases/download/... URL, so that read would 404. Add an opt-in offline mode to update-versions.sh (--sha512 <rid>=<hex>, all four platforms required) and have UpdateNixPackageJob download the .sha512 sidecars from the source build's BlobArtifacts (already verified and uploaded by PublishReleaseAssetsJob) and forward the digests to update-nix-cli-flake.yml as workflow inputs. The url fields written to versions.json remain the public versioned release download URLs; only the checksum source changed. Manual runs against a published release omit the inputs and fall back to reading the release assets. Adds NixCliPackageTests coverage for the offline path and the partial-override error, and updates release-process.md, eng/nix/README.md, and docs/ci/native-cli-packaging.md to match. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 053d9b6f-21e9-404b-9174-c610ae3a3741
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
Moves release mutations before publication to support immutable GitHub releases.
Changes:
- Creates draft releases and generates notes/assets before manual publication.
- Moves Homebrew validation post-publication.
- Supplies Nix checksums directly from build artifacts.
Show a summary per file
| File | Description |
|---|---|
tests/Infrastructure.Tests/Pipelines/ReleasePublishNugetPipelineTests.cs |
Updates removed Homebrew-job expectations. |
tests/Infrastructure.Tests/Pipelines/NixCliPackageTests.cs |
Tests offline checksum overrides. |
eng/pipelines/templates/prepare-homebrew-cask.yml |
Updates validation-flow comments. |
eng/pipelines/release-publish-nuget.yml |
Removes Homebrew validation and forwards Nix checksums. |
eng/nix/update-versions.sh |
Adds offline checksum inputs. |
eng/nix/README.md |
Documents draft-compatible Nix updates. |
eng/homebrew/validate-cask-artifact.sh |
References the new workflow. |
eng/homebrew/README.md |
Documents post-release validation. |
eng/homebrew/prepare-cask-artifact.sh |
Updates validation-flow comments. |
docs/release-process.md |
Documents draft review and publication. |
docs/ci/native-cli-packaging.md |
Documents build-sourced checksums. |
.github/workflows/update-nix-cli-flake.yml |
Accepts platform checksum inputs. |
.github/workflows/release-notes-generate.md |
Changes notes generation to draft creation. |
.github/workflows/release-notes-generate.lock.yml |
Recompiles the agentic workflow. |
.github/workflows/release-github-tasks.yml |
Creates draft releases and adds instructions. |
.github/workflows/homebrew-validate-release.yml |
Adds post-publication Homebrew validation. |
.github/workflows/extension-release.yml |
Removes the obsolete skip parameter. |
Review details
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Suppressed comments (1)
docs/release-process.md:213
- This duplicates the preceding baseline-version PR bullet, so the release checklist lists the same item twice.
- Baseline version PR: updates `PackageValidationBaselineVersion`.
- Files reviewed: 17/17 changed files
- Comments generated: 3
- Review effort level: Balanced
Collapse the extra blank lines before the "Installer channels" heading that markdownlint flagged (MD012/no-multiple-blanks) at docs/release-process.md:58-59. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 053d9b6f-21e9-404b-9174-c610ae3a3741
|
David Fowler (@davidfowl) tagging you since you added the Nix package. Immutable releases mean the release is a draft while the pipeline runs, and So the checksums now come from the source build's
Mind giving it a look? |
There was a problem hiding this comment.
Review details
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
.github/workflows/release-notes-generate.md:143
- The PR description says draft lookup should fall back when
GET /releases/tags/{tag}returns 404, but this still assumes that endpoint returns the draft and later treats “release can't be found” as a successful no-op. In an auth context where the tag endpoint hides drafts, notes generation will silently leave the placeholder. Add the documented fallback by listing releases and selecting the matching draft before declaring it missing.
`prerelease`. The workflow runs with a GitHub App token that can see
drafts in `microsoft/aspire`, so this call returns the draft record
when the release-create step has just fired `release: [created]`.
- Files reviewed: 17/17 changed files
- Comments generated: 1
- Review effort level: Balanced
This comment has been minimized.
This comment has been minimized.
…ase event Draft releases do not fire the `release: [created]` event in GitHub Actions, so under the draft-then-publish (immutable releases) flow the release-notes-generate agentic workflow never ran and the draft kept its placeholder body permanently. Replace the implicit `release: [created]` trigger with an explicit workflow_dispatch: release-github-tasks.yml now dispatches release-notes-generate (via the aspire-repo-bot App token) right after it creates the draft release, passing the tag_name input, gated so it only fires when a real non-dry-run draft was actually created. Remove the dead `release` trigger and its unreachable draft-only `if:` branch from release-notes-generate.md, recompile the gh-aw lock, and correct the comments that incorrectly claimed draft creation fires `release: created`. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 053d9b6f-21e9-404b-9174-c610ae3a3741
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Review details
Suppressed comments (4)
Previously missed (2) — in code that hasn't changed since the last review.
.github/workflows/homebrew-validate-release.yml:64
- For
workflow_dispatch, checkout otherwise uses the selected/default branch rather than the tag named byrelease_version. A retry for an older release can therefore generate and validate a cask using currentmainscripts/template instead of the released source. Check out the matching release tag explicitly.
- name: Checkout repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 1
docs/release-process.md:211
- This duplicates the immediately preceding baseline-version bullet.
- Baseline version PR: updates `PackageValidationBaselineVersion`.
docs/release-process.md:429
- The architecture diagram still says release-note generation is triggered by
release: created, contradicting the explicit dispatch implemented inrelease-github-tasks.yml.
GitHub release-notes-generate.lock.yml (triggered on `release: created`)
docs/release-process.md:235
- A failed Homebrew install/signing audit can mean the newly immutable assets are unusable, so the release is not necessarily “fine,” and rerunning cannot repair those assets. The runbook should distinguish the support-page workflow from asset-validation failures and direct managers to assess impact and cut a corrected release when necessary.
If either downstream workflow fails, the release itself is fine — the release is published and immutable. Investigate the failure on the workflow run, fix the underlying issue, and rerun via `workflow_dispatch` against the published tag.
- Files reviewed: 17/17 changed files
- Comments generated: 4
- Review effort level: Balanced
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
… reruns, docs ordering - homebrew-validate-release.yml: subscribe to `release: [published]` instead of `[released]`. GitHub does not reliably fire `released` when a release is published from a draft, so under the draft-then-publish flow the cask validation would never run. The stable/non-draft/non-prerelease `if:` guard already covers what `released` used to imply. Comments/docs updated to match. - release-github-tasks.yml: dispatch release-notes-generate on every eligible non-dry rerun instead of gating on `release_exists`. If a first run created the draft but died before dispatching, the old gate would permanently skip note generation on rerun. Re-dispatching is safe because release-notes-generate is idempotent (no-op unless the body is still the exact placeholder). - docs/release-process.md: defer merging the baseline version PR until after the draft is published, since its eng/nix/versions.json points at release download URLs that 404 until publish (merging early would break the flake on main). Also correct the two remaining `release: created` trigger descriptions to reflect the explicit workflow_dispatch, drop stale `released` mentions, and remove a duplicated baseline-PR bullet. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 053d9b6f-21e9-404b-9174-c610ae3a3741
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Review details
Suppressed comments (5)
.github/workflows/release-github-tasks.yml:699
- This warning is emitted even for dry runs,
skip_github_release: true, and failed/skipped release jobs, so the summary can tell a release manager to publish a draft that this run did not create. Gate the manual-publish section on a successful non-dry-run release path (while still allowing the existing-draft rerun case).
## ⚠️ Manual step required — publish the draft release
docs/release-process.md:441
- The architecture diagram names the wrong event.
homebrew-validate-release.ymllistens forrelease: published, so this should match the workflow and the explanation earlier in this document.
GitHub homebrew-validate-release.yml (triggered on `release: released`)
eng/pipelines/release-publish-nuget.yml:2377
- This says the workflow runs on
released, but its executable trigger ispublishedbecausereleasedis unreliable for a draft-to-published transition.
# .github/workflows/homebrew-validate-release.yml and runs on the
# `release: [released]` event, i.e. only once the release manager
# publishes the draft and the asset URLs become public. See that
.github/workflows/homebrew-validate-release.yml:118
- The workflow runs on
release: [published], notreleased; this comment contradicts the trigger and the detailed explanation at the top of the same file.
# public, which is why this workflow runs on release: [released]
# rather than [created]/[published-on-a-draft].
eng/homebrew/README.md:146
- This table still names
released, while the workflow intentionally subscribes topublished.
| `LiveRelease` | Yes — points at a live GitHub release | `brew audit --cask --online --signing` + `brew install`/`brew uninstall` | `.github/workflows/homebrew-validate-release.yml`, on `release: [released]` after the human publishes the draft |
- Files reviewed: 17/17 changed files
- Comments generated: 7
- Review effort level: Balanced
The homebrew validation workflow now triggers on `release: [published]`, but several comments and docs across the repo still described it (and the release-notes dispatch) as firing on `release: [released]`. Sweep those stale strings so the runbook, pipeline comments, and homebrew docs match the executable trigger contract. Comments/docs only; no behavior change. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 053d9b6f-21e9-404b-9174-c610ae3a3741
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
There was a problem hiding this comment.
Review details
Suppressed comments (2)
Previously missed (2) — in code that hasn't changed since the last review.
.github/workflows/homebrew-validate-release.yml:44
- The automatic event uses
vX.Y.Zwhile the documented manual input isX.Y.Z, so these produce different concurrency groups and can run simultaneously despite the stated deduplication. Normalize the manual branch to the tagged form in the group expression.
group: homebrew-validate-${{ github.event.release.tag_name || github.event.inputs.release_version }}
.github/workflows/release-notes-generate.md:136
- Draft releases have
published_at: null, but Step 3 still requires the previous release'spublished_atto be earlier than this value. That condition cannot select a prior stable release, so every draft run can take the “first stable release” fallback and generate notes from only the last 30 commits. Select the latest published, non-prerelease release excluding the current tag (or compare against the draft'screated_at) instead.
Fetch the full release record for `microsoft/aspire` by tag
(`GET /repos/microsoft/aspire/releases/tags/<tag>`). Capture its `id`,
`tag_name`, `name`, `body`, `published_at`, `html_url`, `draft`, and
`prerelease`. The workflow runs with a GitHub App token that can see
drafts in `microsoft/aspire`, so this call returns the draft record that
`release-github-tasks.yml` created just before dispatching this workflow.
- Files reviewed: 17/17 changed files
- Comments generated: 0 new
- Review effort level: Balanced
Tests selector (audit mode)The full test matrix and all jobs still run in audit mode. The tests and jobs below are what selective CI would run under enforcement. 2 / 102 test projects · 4 jobs, from 13 changed files. Selected test projects (2 / 102)
Selected jobs (4)
How these were chosen — grouped by what changed📄 📄 📄 📄 📄 📄 📄 📄 📄 📄 📄 🧪 🧪 Job reasons
Selection computed for commit |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
13843dd
into
main
|
✅ No documentation update needed. Step 5 branch taken: Triggered signals (1): Why this is a false positive: The signal matched the PR-body snippet Changed-file analysis: All 17 changed files are internal release-engineering/CI infrastructure in the No documentation changes were made on aspire.dev. |
Why
We want to enable GitHub's immutable releases setting on
microsoft/aspirefor supply-chain integrity. Immutability locks assets and the tag as soon as a release is published. Today our release flow assumes the opposite — we publish first and then mutate:eng/pipelines/release-publish-nuget.yml(PublishReleaseAssetsJob) uploads CLI binaries viagh release upload --clobberagainst the already-published release.release-notes-generate.mdis an agentic workflow that triggers onrelease: [published]and rewrites the placeholder body via gh-aw'supdate-releasesafe output.HomebrewValidateJobin the same pipeline runsbrew audit/installagainst the public download URL of the just-published release.All three would break (or be denied) once immutability is on. This PR moves every mutation to happen while the release is still a draft, and adds a manual "publish the draft" step at the end of the release process.
What changes
.github/workflows/release-github-tasks.ymlgh release create --draft. Placeholder body and job summary updated to tell the release manager they need to publish the draft after review..github/workflows/release-notes-generate.mdrelease: [created], guard inverted todraft == true. Step 1 now early-exits when the release is already published (since the body can no longer be safely overwritten). Added a fallback note aboutGET /releases/tags/{tag}returning 404 for drafts in some auth contexts..github/workflows/release-notes-generate.lock.ymleng/pipelines/release-publish-nuget.ymlHomebrewValidateJoband theSkipHomebrewValidationparameter. Stage-3 comments updated to reflect 2 jobs instead of 3..github/workflows/homebrew-validate-release.ymlrelease: [released]andworkflow_dispatch. Regenerates the cask from the now-public asset URL viaeng/homebrew/generate-cask.shand runs the full validation inLiveReleasemode.docs/release-process.mdNew end-to-end flow
Notes-generation and asset-upload run in parallel and touch different fields of the release (body vs. assets), so they don't conflict. Step 2's idempotency check in the agentic workflow (looks for the placeholder phrase in
body) still protects against accidental double-edit if a human publishes mid-flight.Reviewer asks
HomebrewValidateJobpipeline integration; the newhomebrew-validate-release.ymldoes the samegenerate-cask.sh+validate-cask-artifact.sh --validation-mode LiveReleasebut runs after publish. Please flag anything I missed (auth, caching, where the cask artifact ends up, etc.).Follow-ups (NOT in this PR)
GH_ALLOWED_BOTS) torelease/13.4— needed becauserelease-notes-generate.lock.ymlon that branch is built with an older gh-aw that doesn't handle the bot permission correctly. Surfaced by the failing 13.4.3 run.