Repository navigation
Switch Aspire Homebrew cask to upstream autobump + harden the validation gauntlet - #17405
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 17405Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 17405" |
Make the Aspire Homebrew cask install from a GitHub release asset URL (`https://github.com/microsoft/aspire/releases/download/v#{version}/...`) parameterized on a single `#{version}` value, so `brew bump-cask-pr --version=<v>` can rewrite it in one substitution. Switch the cask's livecheck from `:skip` to `strategy :github_latest` so Homebrew/homebrew-cask's autobump workflow (`brew bump --auto`, 3-hour schedule) can detect new versions automatically. Declare `depends_on :macos` and an empty `zap trash: []` stanza to satisfy upstream's tap-syntax check and triage workflow. Rewrite `eng/homebrew/validate-cask-artifact.sh` so its audit pass mirrors the per-cask matrix in `Homebrew/homebrew-cask`'s `ci.yml` for a bump PR — a clean local run implies the upstream autobump PR will audit cleanly too. Two modes pick the audit-arg combination by whether the cask URL resolves yet: - `LiveRelease`: `brew audit --cask --online --signing` plus a real `brew install`/`brew uninstall` cycle, for use after the GitHub release upload has populated the cask URL. Used by the release pipeline's `HomebrewValidateJob` against the live release. - `LiveArchives`: `brew audit --cask --no-signing` (no `--online`), for source-build prep where the release for `v#{version}` does not exist yet. Used by `eng/pipelines/azure-pipelines.yml` and `.github/workflows/prepare-installer-artifacts.yml`. `--online` is dropped wholesale rather than excluded per-method with `--except`, so any new `--online`-gated audit method touching the archive in a future brew release does not silently start failing. Add `brew test-bot --tap <local> --only-tap-syntax` — the upstream CI step that catches `Invalid cask (Linux on …)` and matches the `depends_on :macos` requirement. `dogfood.sh` rewrites the GitHub release URL to a `file://` URL and drops the `verified:` line for local install — `file://` URLs are exempt from `audit_missing_verified` via brew's `file_url?` short-circuit, and `dogfood.sh` only runs `brew install`, never `brew audit`. Co-authored-by: Copilot <[email protected]>
Drop the custom `publish-homebrew.yml` template (537 lines) and the `HomebrewJob` it ran in `release-publish-nuget.yml`. That job forked `Homebrew/homebrew-cask` as `aspire-homebrew-bot`, branched, force-pushed, and opened cask-bump PRs against upstream. Bumps are now picked up by upstream [`Homebrew/homebrew-cask`'s `autobump.yml`](https://github.com/Homebrew/homebrew-cask/blob/master/.github/workflows/autobump.yml) (runs `brew bump --auto` on a 3-hour schedule, detects new versions via the cask's `livecheck :github_latest` block). Removes the `SkipHomebrewPublish` parameter, the `aspire-homebrew-bot-pat` secret dependency, and the homebrew-cask-stable artifact republish in `PrepareArtifactsJob`. Add `HomebrewValidateJob` to the `GitHubTasks` stage. It runs `validate-cask-artifact.sh --validation-mode LiveRelease` against the cask emitted by the source build, after `PublishReleaseAssetsJob` uploads the `aspire-cli-osx-*` archives to the GitHub release — the first moment the cask URL actually resolves. Catches problems that would otherwise only surface to end users running `brew install aspire`, or block Homebrew/homebrew-cask's autobump PR a few hours later. Gated by a new `SkipHomebrewValidation` parameter for partial-failure re-runs. Runs on `macOS-latest-internal` because it does a real `brew install`/`brew uninstall`. The initial cask submission to `Homebrew/homebrew-cask` remains a one-time human-driven PR (autobump only handles version bumps for an already-merged cask). Co-authored-by: Copilot <[email protected]>
Update `eng/homebrew/README.md` and `docs/release-process.md` to describe the new flow: the cask installs from `github.com/microsoft/aspire/releases/...`, Homebrew/homebrew-cask autobump submits version bumps via livecheck-detected releases, and the release pipeline's `HomebrewValidateJob` runs the same audit gauntlet upstream homebrew-cask CI runs on a bump PR. Document the two validation modes (`LiveRelease`, `LiveArchives`), the `--archive-root` SHA256 source-of-truth, the `SkipHomebrewValidation` re-run knob, and that the initial cask submission is a one-time human-driven step. Co-authored-by: Copilot <[email protected]>
8a2cb7e to
59b61c9
Compare
…act-version, default prepare to LiveArchives
Three related cleanups falling out of PR review:
1. generate-cask.sh's BASE_URL still pointed at ci.dot.net even
though the cask template now embeds a github.com release URL.
The two were only consistent because every CI caller passes
--archive-root (which short-circuits the URL fetch). Any local
invocation without --archive-root would have written a cask
whose SHA was computed from ci.dot.net bytes while the cask URL
pointed at github.com.
2. --artifact-version is now dead. The template no longer references
${ARTIFACT_VERSION} (the URL is parameterized solely on
#{version}), and after fix #1 above BASE_URL no longer uses it
either. Drop the parameter from generate-cask.sh,
prepare-cask-artifact.sh, prepare-homebrew-cask.yml, and the two
AzDO pipeline callers. The aspireArtifactVersion pipeline variable
stays because WinGet still uses it.
3. Flip prepare-cask-artifact.sh's default from LiveRelease to
LiveArchives. Every prod CI caller already passed
skipUrlValidation=true → LiveArchives. Prepare time means "the
cask URL points at a v#{version} release that hasn't been
published yet" by construction, so LiveArchives is the only
correct semantics. Drop the now-redundant skipUrlValidation
parameter from prepare-homebrew-cask.yml and the explicit
--validation-mode LiveArchives from the GH Actions caller.
LiveRelease is preserved as an opt-in for local dev and for the
Bash_PrepareHomebrewCask_FailedVerification_UninstallsCask test
(which depends on brew install/uninstall behavior); the test now
requests LiveRelease explicitly. LiveRelease validation in CI
still runs unchanged via HomebrewValidateJob, which calls
validate-cask-artifact.sh directly.
Also:
* Replace fragile cross-file line-number references with the
stable `audit_args` block name.
* Add a `Homebrew Val:` row to the RELEASE SUMMARY box in
release-publish-nuget.yml so a release manager can see at a
glance whether SkipHomebrewValidation is set.
Co-authored-by: Copilot <[email protected]>
…nk installer docs
Cleanups from review of the cask template and surrounding scripts/docs.
eng/homebrew/aspire.rb.template:
* livecheck comment was misplaced — it described the url substitution
above it, not the livecheck block it sat above. Replaced with a
short note that livecheck drives upstream autobump detection.
* postflight sidecar comment was narrating the next line of code.
Replaced with the actual reason — channel attribution for self-
update routing.
eng/homebrew/{validate,prepare}-cask-artifact.sh:
* --validation-mode accepted four spellings per mode (PascalCase,
lower, hyphenated lower, hyphenated mixed). The hyphenated forms
weren't documented anywhere and not used by callers. Dropped them
and switched to `shopt -s nocasematch` so any case of the canonical
spellings (LiveRelease / LiveArchives) is accepted.
eng/pipelines/release-publish-nuget.yml:
* Removed the 6-line "Homebrew bumps are NOT submitted here" block.
The enumerated steps above already don't list a cask-bump step,
and the line immediately below points at docs/release-process.md
which covers it in the new Installer channels section.
docs/release-process.md:
* New `Installer channels` section with a table covering NuGet,
WinGet, Homebrew cask, dotnet-tool, and the install script —
who submits the bump for each, with links to the per-channel docs
(eng/winget/README.md, eng/homebrew/README.md, install-routes.md).
* Trimmed the Overview's Homebrew bullet now that the section covers
the autobump detail.
* Related Documentation extended with the per-channel READMEs.
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Pull request overview
This PR migrates the Aspire Homebrew cask flow to Homebrew/homebrew-cask’s standard upstream autobump path by switching the cask to GitHub release asset URLs (enabling livecheck :github_latest) and removing the bespoke bot-driven PR submission pipeline. It also hardens validation so CI matches upstream cask CI expectations, adding a release-time “live URL” validation job.
Changes:
- Switch cask URL +
livecheckto be compatible with upstreamautobump.yml, and add macOS-only guards (depends_on :macos) plus adjustedverified:handling. - Replace the custom Homebrew PR submission pipeline with upstream autobump, and add a release-time job that validates the generated cask against the live GitHub release URL.
- Update validation scripts/tests/workflows to support the new
LiveReleasevsLiveArchivesvalidation split and upstream-equivalent checks (incl.brew test-bot --only-tap-syntax).
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/Aspire.Acquisition.Tests/Scripts/PRScriptInstallerModeTests.cs | Updates bash-script tests for new validation mode naming and GitHub release URL expectations. |
| eng/pipelines/templates/publish-homebrew.yml | Removes the custom Homebrew PR submission template (no longer used). |
| eng/pipelines/templates/prepare-homebrew-cask.yml | Renames/threads validation modes to the Homebrew cask preparation step. |
| eng/pipelines/release-publish-nuget.yml | Removes Homebrew publish job and adds HomebrewValidateJob to validate against live GitHub release assets. |
| eng/pipelines/common-variables.yml | Updates comments now that Homebrew submission is removed. |
| eng/pipelines/azure-pipelines.yml | Forces skipUrlValidation: true for source-build prep (ensuring LiveArchives behavior). |
| eng/homebrew/validate-cask-artifact.sh | Adds upstream-equivalent validation (tap syntax via brew test-bot) and splits audit behavior by validation mode. |
| eng/homebrew/README.md | Updates documentation to describe upstream autobump + new validation model. |
| eng/homebrew/prepare-cask-artifact.sh | Updates validation-mode handling and threads mode into generation/validation. |
| eng/homebrew/dogfood.sh | Updates URL rewrite logic to handle GitHub release URLs and drop verified: for file:// installs. |
| eng/homebrew/aspire.rb.template | Updates the cask template for GitHub release URLs, livecheck :github_latest, macOS-only dependency, and zap policy. |
| docs/release-process.md | Updates release process docs to reflect removal of Homebrew PR submission and addition of live-release validation. |
| .github/workflows/prepare-installer-artifacts.yml | Updates Homebrew artifact preparation to use LiveArchives mode. |
| livecheck do | ||
| skip "ci.dot.net artifact storage has no version index; Aspire release automation manages cask updates" | ||
| url :url | ||
| strategy :github_latest |
There was a problem hiding this comment.
nit (totally optional): could tack a regex(/^v?(\d+(?:\.\d+)+)$/i) onto this block as belt-and-suspenders against picking up a prerelease tag. /releases/latest already filters those out on the GitHub side, so this is purely defense-in-depth — feel free to ignore!
9591a10
into
microsoft:main
Replaces the bot-driven Homebrew submission flow with two changes that move us
onto Homebrew/homebrew-cask's standard release path:
(
https://github.com/microsoft/aspire/releases/download/v#{version}/...)instead of
ci.dot.net. The URL is parameterized on a single#{version}value so
brew bump-cask-pr --version=<v>can rewrite it in onesubstitution. The
livecheckblock switches fromskiptostrategy :github_latestso upstream autobump can detect new versions.Homebrew/homebrew-cask'sautobump.yml(runs
brew bump --autoon a 3-hour schedule, detects new versions viathe cask's
livecheck :github_latestblock).This deletes the custom publish flow we owned:
publish-homebrew.yml(537lines that forked
Homebrew/homebrew-cask, branched, force-pushed, openedPRs against it as
aspire-homebrew-bot), theHomebrewJobinrelease-publish-nuget.yml, theSkipHomebrewPublishparameter, and theaspire-homebrew-bot-patsecret dependency. The initial cask submission toHomebrew/homebrew-caskremains a one-time human-driven PR (still trackedin README "Open Items"); only subsequent version bumps are autobumped.
Validation: match upstream CI exactly
validate-cask-artifact.shnow runs the same arg setHomebrew/homebrew-cask's per-cask CI runs on a bump PR, with two modesthat differ only in whether the cask URL resolves yet:
LiveReleasebrew audit --cask --online --signing+ realbrew install/brew uninstallLiveArchivesbrew audit --cask --no-signing(no--online)LiveArchivesdrops--onlinebecause several--online-gated auditmethods (
audit_download,audit_signing,audit_rosetta,audit_min_os) fetch the cask URL, which points at a GH release thathasn't been uploaded yet at source-build time. Excluding them
individually with
--exceptwould be brittle — any new--online-gatedaudit method touching the archive in a future brew release would
silently start failing.
A new
HomebrewValidateJobinrelease-publish-nuget.ymlrunsLiveReleaseagainst the cask emitted by the source build, afterPublishReleaseAssetsJobuploads theaspire-cli-osx-*archives to theGitHub release. This is the first moment the cask URL actually resolves,
and catches problems that would otherwise only surface to end users
running
brew install aspire(or block the autobump PR). Gated by a newSkipHomebrewValidationparameter for partial-failure re-runs. Runs onmacOS-latest-internalbecause it does a realbrew install/brew uninstall.validate-cask-artifact.shalso now runsbrew test-bot --tap <local> --only-tap-syntax, which is the upstream CI step that catches "Invalidcask (Linux on …)" — the same check that requires
depends_on :macosona macOS-only cask.
Call-outs
depends_on :macosin the cask is required forbrew test-bot --only-tap-syntaxto pass. Without it, the syntax job tries toevaluate the cask on Linux too, fails to match an
archkey, andrejects the cask.
zap trash: []is intentional — Aspire CLI state under~/.aspire/is preserved across uninstall. The stanza is present(not omitted) so
Homebrew/homebrew-cask's triage workflow does notapply the
missing-zaplabel (it greps formissing_content: zap .+\n).verified:host change:verified: "ci.dot.net/public/aspire/"→verified: "github.com/microsoft/aspire/"to match the new URL host(
brew auditrejects mismatches between the URL host and theverified:prefix).dogfood.shURL rewrite: replaces the GH release URL with afile://URL and drops theverified:line for local install.file://URLs are exempt fromaudit_missing_verified(via brew'sfile_url?short-circuit), anddogfood.shonly runsbrew install— never
brew audit— so this is purely abrew installSHA-checkredirect.
homebrew-cask-stableasone of its own outputs —
HomebrewValidateJobpulls the artifactdirectly from the
aspire-buildsource-build resource.HomebrewValidateJobcannot be exercised on a feature branch. Itruns in
release-publish-nuget.yml(1600), is gated onDryRun=false, and would attempt real NuGet/darc publishingalongside the cask audit. End-to-end validation against the live GH
release happens at release time; the release manager triggers the
pipeline with appropriate skip flags.