Skip to content

homebrew: fix brew style failure, sync formula to v5.5.0, preserve tap bottles#1626

Merged
sbryngelson merged 2 commits into
masterfrom
fix/homebrew-formula-style-tap-sync
Jul 2, 2026
Merged

homebrew: fix brew style failure, sync formula to v5.5.0, preserve tap bottles#1626
sbryngelson merged 2 commits into
masterfrom
fix/homebrew-formula-style-tap-sync

Conversation

@sbryngelson

@sbryngelson sbryngelson commented Jul 2, 2026

Copy link
Copy Markdown
Member

Description

The v5.5.0 release runs of Deploy Homebrew Tap and Homebrew Formula Test both failed on the same brew style offense: Homebrew added a new RuboCop cop, Homebrew/FormulaPathMethods (Homebrew/brew, 2026-06-22), and both workflows install latest brew via setup-homebrew@master. The formula itself hadn't changed since February. Note the release still shipped: homebrew-release.yml succeeded and the tap already serves v5.5.0 with bottles.

Commit 1 — formula fixes

  1. The lint offenseFormula["python@3.12"].opt_binformula_opt_bin("python@3.12") in packaging/homebrew/mfc.rb. The helper is defined in Utils::Path and included in Formula, so it is equivalent at install time.
  2. Stale in-repo formula version — the repo copy still pointed at v5.2.0 while the tap is at v5.5.0. Bumped url/sha256 to v5.5.0 (sha256 computed independently from the release tarball; matches the tap).

Commit 2 — deploy-tap.yml hardening

  1. Never downgrade the tap — push-to-master deploys copied the repo formula verbatim into the tap. Since homebrew-release.yml bumps the tap directly on releases, the repo copy lags behind, and a formula-only push would have downgraded the tap and deleted its bottles. The copy step now adopts the tap's url/sha256 whenever the tap pins a newer release, and preserves the tap's bottle do block whenever the pinned release is unchanged. Genuine version bumps still drop the stale bottle block as before.
  2. Drop the redundant create: (tag) triggerhomebrew-release.yml already owns tag releases, so both workflows raced to push the tap on every tag, and this one put a strict brew audit on the release critical path (exactly what turned red for v5.5.0). Tag handling is kept for manual workflow_dispatch from a tag ref.

Type of change

  • Bug fix

Testing

  • brew style packaging/homebrew/mfc.rb (Homebrew 6.0.6, includes the new cop): old formula reproduces the CI failure, fixed formula passes.
  • Ran the copy-step script (extracted verbatim from the workflow YAML) locally against the real current tap formula in three scenarios:
    • repo == tap version → tap bottle block preserved;
    • repo v5.2.0 / tap v5.5.0 → tap's url+sha adopted, bottles preserved (no downgrade);
    • repo v5.6.0 / tap v5.5.0 → repo pin wins, stale bottle dropped.
      All merged outputs pass brew style and ruby -c.
  • deploy-tap.yml parses as valid YAML; PR checks on this branch exercise both previously-failing workflows in audit mode.

Checklist

  • I added or updated tests for new behavior (local brew style/merge-script scenario runs above; no test-suite surface for packaging CI)
  • I updated documentation if user-facing behavior changed (n/a)

AI code reviews

Reviews are not retriggered automatically. To request a review, comment on the PR:

  • @claude full review — Claude full review (also triggers on PR open/reopen/ready)
  • Or add label claude-full-review — Claude full review via label

…e tap bottles

- Replace Formula["python@3.12"].opt_bin with formula_opt_bin("python@3.12"):
  Homebrew's new FormulaPathMethods cop (brew 2026-06-22) fails brew style on
  the old form, which broke Deploy Homebrew Tap and Homebrew Formula Test on
  the v5.5.0 release.
- Bump the in-repo formula url/sha256 to v5.5.0 to match the tap, so the
  push-triggered tap deploy does not downgrade the tap back to v5.2.0.
- Preserve the tap's existing bottle block in deploy-tap.yml when the release
  URL is unchanged, so formula-only pushes to master no longer delete bottles
  built for the current version.
Copilot AI review requested due to automatic review settings July 2, 2026 16:20

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 updates the Homebrew packaging and deployment workflow to keep the in-repo formula aligned with the v5.5.0 release and to prevent brew style failures and inadvertent bottle loss when syncing the formula into the MFlowCode/homebrew-mfc tap.

Changes:

  • Updates the Homebrew formula to v5.5.0 (URL + sha256) and fixes the new brew style cop by switching to formula_opt_bin("python@3.12").
  • Adjusts deploy-tap.yml to preserve the tap’s existing bottle do block when the release URL is unchanged, avoiding bottle deletion on formula-only pushes.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packaging/homebrew/mfc.rb Bumps formula to v5.5.0 and updates Python path usage to satisfy new Homebrew style rules.
.github/workflows/deploy-tap.yml Preserves existing tap bottles when syncing the formula on non-version-bump updates.

Comment thread .github/workflows/deploy-tap.yml Outdated
NEW_URL="$(grep -E '^ url ' packaging/homebrew/mfc.rb || true)"
OLD_URL="$(grep -E '^ url ' tap-repo/Formula/mfc.rb 2>/dev/null || true)"
if [[ -n "${NEW_URL}" && "${NEW_URL}" == "${OLD_URL}" ]] && grep -q '^ bottle do' tap-repo/Formula/mfc.rb; then
awk '/^ bottle do/,/^ end$/' tap-repo/Formula/mfc.rb > /tmp/bottle.block
- Push-to-master deploys previously copied the in-repo formula verbatim into
  the tap. Since homebrew-release.yml bumps the tap directly on releases, the
  repo copy lags behind and such a push would downgrade the tap and delete its
  bottles. The copy step now adopts the tap's url/sha256 whenever the tap pins
  a newer release, and the tap commit message uses the deployed version.
- Remove the 'create' (tag) trigger: homebrew-release.yml already owns tag
  releases, so both workflows raced to push the tap on every tag, and this
  one put a strict brew audit on the release critical path (the v5.5.0
  failure). Tag handling is kept for manual dispatch from a tag ref.
@sbryngelson sbryngelson merged commit 54aa379 into master Jul 2, 2026
36 checks passed
@sbryngelson sbryngelson deleted the fix/homebrew-formula-style-tap-sync branch July 2, 2026 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants