fix(brew): also recognize legacy "cask: true" metadata key#45
Merged
kevinelliott merged 1 commit intomainfrom Apr 25, 2026
Merged
fix(brew): also recognize legacy "cask: true" metadata key#45kevinelliott merged 1 commit intomainfrom
kevinelliott merged 1 commit intomainfrom
Conversation
Five catalog entries (block-goose, openclaw, droid, claude-squad, amazon-q-cli at lines 468/706/2149/2212/2630) declare cask-ness via metadata.cask: "true" rather than the canonical metadata.type: "cask". parseBrewPackage only checked the canonical key, so "brew install" ran without --cask for those agents and Homebrew rejected them as unknown formulae. Now accepts either form: - "type": "cask" (canonical) - "cask": "true" (legacy, common in user-customized catalogs too) Provider behavior change is the entire fix — no catalog edits needed. brew install/upgrade/uninstall already build their own arg lists from isCask, so the catalog command/update_cmd strings (which lack --cask for these legacy entries) are documentation only. Closes the corresponding Copilot review comment from PR #28. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Updates the Homebrew installer provider to correctly treat certain catalog entries as casks when they use the legacy metadata.cask: "true" flag, ensuring brew install/upgrade/uninstall includes --cask where needed.
Changes:
- Extend
parseBrewPackagecask detection to accept bothmetadata.type == "cask"and legacymetadata.cask == "true". - Add/adjust unit tests for canonical and legacy cask metadata handling.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| pkg/installer/providers/brew.go | Updates cask detection logic (and adds documentation) in parseBrewPackage. |
| pkg/installer/providers/providers_test.go | Extends TestBrewProviderParseBrewPackage with new cask-metadata cases. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+189
to
+192
| // Cask is detected from method.Metadata using either of two keys: | ||
| // - "type": "cask" — canonical form, used by current catalog entries | ||
| // - "cask": "true" — legacy form, accepted for back-compat with custom | ||
| // user catalogs and historical catalog entries |
Comment on lines
+199
to
204
| // Check metadata for cask indicator (both canonical and legacy forms). | ||
| if method.Metadata != nil { | ||
| if method.Metadata["type"] == "cask" { | ||
| if method.Metadata["type"] == "cask" || method.Metadata["cask"] == "true" { | ||
| isCask = true | ||
| } | ||
| } |
Comment on lines
+1053
to
+1056
| name: "cask metadata both keys agree", | ||
| method: catalog.InstallMethodDef{ | ||
| Package: "firefox", | ||
| Metadata: map[string]string{"type": "cask", "cask": "true"}, |
kevinelliott
added a commit
that referenced
this pull request
Apr 25, 2026
Patch release. The notable shipping fix is the brew cask metadata recognition (#45) — five catalog entries declared cask-ness via the legacy "cask: true" key that the parser ignored, so brew install ran without --cask and Homebrew rejected those agents. Also rolls up the broader review-feedback batch in #44 (race fix, ctx-error caching, concurrent-write safety, /usr/share probe path, removed dead --all/--check-updates flags, etc.). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Five catalog entries (`block-goose`, `openclaw`, `droid`, `claude-squad`, `amazon-q-cli`) declare cask-ness via `metadata.cask: "true"` rather than the canonical `metadata.type: "cask"`. `parseBrewPackage` only checked the canonical key, so `brew install` ran without `--cask` for those agents and Homebrew rejected them as unknown formulae.
`parseBrewPackage` now accepts either form:
Why no catalog edits
`brew install/upgrade/uninstall` already build their own arg lists from `isCask` — the `command`/`update_cmd`/`uninstall_cmd` strings in the catalog are documentation only. With the parser fix, all five existing entries Just Work; bumping the catalog version to canonicalize would force a refresh round-trip without changing behavior.
Tests
`TestBrewProviderParseBrewPackage` extended with three new cases:
Closes
Copilot review comment on PR #28 (catalog.json:707).
🤖 Generated with Claude Code