Skip to content

Switch Aspire Homebrew cask to upstream autobump + harden the validation gauntlet - #17405

Merged
Jose Perez Rodriguez (joperezr) merged 5 commits into
microsoft:mainfrom
radical:homebrew-pipeline-hardening
May 27, 2026
Merged

Jose Perez Rodriguez (joperezr) merged 5 commits into
microsoft:mainfrom
radical:homebrew-pipeline-hardening

Conversation

@radical

@radical Ankit Jain (radical) commented May 23, 2026 •

Copy link
Copy Markdown
Member

Replaces the bot-driven Homebrew submission flow with two changes that move us
onto Homebrew/homebrew-cask's standard release path:

  1. The cask now installs from a GitHub release asset URL
    (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 one
    substitution. The livecheck block switches from skip to
    strategy :github_latest so upstream autobump can detect new versions.
  2. Cask version bumps are now picked up by upstream
    Homebrew/homebrew-cask's autobump.yml
    (runs brew bump --auto on a 3-hour schedule, detects new versions via
    the cask's livecheck :github_latest block).

This deletes the custom publish flow we owned: publish-homebrew.yml (537
lines that forked Homebrew/homebrew-cask, branched, force-pushed, opened
PRs against it as aspire-homebrew-bot), the HomebrewJob in
release-publish-nuget.yml, the SkipHomebrewPublish parameter, and the
aspire-homebrew-bot-pat secret dependency. The initial cask submission to
Homebrew/homebrew-cask remains a one-time human-driven PR (still tracked
in README "Open Items"); only subsequent version bumps are autobumped.

Validation: match upstream CI exactly

validate-cask-artifact.sh now runs the same arg set
Homebrew/homebrew-cask's per-cask CI runs on a bump PR, with two modes
that differ only in whether the cask URL resolves yet:

Mode When Audit args
LiveRelease Release pipeline, after GH release upload brew audit --cask --online --signing + real brew install/brew uninstall
LiveArchives Source-build prep (release URL doesn't exist yet) brew audit --cask --no-signing (no --online)

LiveArchives drops --online because several --online-gated audit
methods (audit_download, audit_signing, audit_rosetta,
audit_min_os) fetch the cask URL, which points at a GH release that
hasn't been uploaded yet at source-build time. Excluding them
individually with --except would be brittle — any new --online-gated
audit method touching the archive in a future brew release would
silently start failing.

A new HomebrewValidateJob in release-publish-nuget.yml runs
LiveRelease against the cask emitted by the source build, after
PublishReleaseAssetsJob uploads the aspire-cli-osx-* archives to the
GitHub 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 new
SkipHomebrewValidation parameter for partial-failure re-runs. Runs on
macOS-latest-internal because it does a real brew install/brew uninstall.

validate-cask-artifact.sh also now runs brew test-bot --tap <local> --only-tap-syntax, which is the upstream CI step that catches "Invalid
cask (Linux on …)" — the same check that requires depends_on :macos on
a macOS-only cask.

Call-outs

  • depends_on :macos in the cask is required for brew test-bot --only-tap-syntax to pass. Without it, the syntax job tries to
    evaluate the cask on Linux too, fails to match an arch key, and
    rejects the cask.
  • Empty 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 not
    apply the missing-zap label (it greps for missing_content: zap .+\n).
  • verified: host change: verified: "ci.dot.net/public/aspire/" →
    verified: "github.com/microsoft/aspire/" to match the new URL host
    (brew audit rejects mismatches between the URL host and the
    verified: prefix).
  • dogfood.sh URL rewrite: replaces the GH release URL with 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 — so this is purely a brew install SHA-check
    redirect.
  • The release pipeline no longer republishes homebrew-cask-stable as
    one of its own outputs — HomebrewValidateJob pulls the artifact
    directly from the aspire-build source-build resource.
  • HomebrewValidateJob cannot be exercised on a feature branch. It
    runs in release-publish-nuget.yml (1600), is gated on
    DryRun=false, and would attempt real NuGet/darc publishing
    alongside 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.

@github-actions

github-actions Bot commented May 23, 2026 •

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 17405

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 17405"

@radical Ankit Jain (radical) changed the title WIP - tightening homebrew process Switch Aspire Homebrew cask to upstream autobump + harden the validation gauntlet May 26, 2026
Ankit Jain (radical) and others added 3 commits May 26, 2026 16:57
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]>
@radical
Ankit Jain (radical) force-pushed the homebrew-pipeline-hardening branch from 8a2cb7e to 59b61c9 Compare May 26, 2026 20:59
@radical Ankit Jain (radical) added this to the 13.4 milestone May 26, 2026
Ankit Jain (radical) and others added 2 commits May 26, 2026 19:34
…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]>
@radical
Ankit Jain (radical) marked this pull request as ready for review May 27, 2026 00:18
Copilot AI review requested due to automatic review settings May 27, 2026 00:18

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 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 + livecheck to be compatible with upstream autobump.yml, and add macOS-only guards (depends_on :macos) plus adjusted verified: 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 LiveRelease vs LiveArchives validation 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.

Comment thread eng/homebrew/prepare-cask-artifact.sh Resolved
livecheck do
skip "ci.dot.net artifact storage has no version index; Aspire release automation manages cask updates"
url :url
strategy :github_latest

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

@joperezr
Jose Perez Rodriguez (joperezr) merged commit 9591a10 into microsoft:main May 27, 2026
311 checks passed
@radical
Ankit Jain (radical) deleted the homebrew-pipeline-hardening branch May 27, 2026 02:59
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants