generate-zap: resolve apps from package receipts - #23623
Open
loganrosen wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Enhances the brew generate-zap dev command to better derive scan patterns for package-installed casks by using local package receipts to discover installed .app bundles and their bundle identifiers, while preserving the existing token-derived fallback behavior.
Changes:
- Derive scan patterns from
.appbundles discovered viapkgutilreceipts when noappartifact exists. - Add helpers to extract top-level app bundle paths from receipt BOM entries and read bundle identifiers from
Info.plist. - Add/adjust specs to cover receipt-based resolution and stale receipt handling, and update
bundle_identifiersto acceptPathname.
Show a summary per file
| File | Description |
|---|---|
| Library/Homebrew/dev-cmd/generate-zap.rb | Adds receipt-based app discovery and pattern derivation for generate-zap. |
| Library/Homebrew/test/dev-cmd/generate-zap_spec.rb | Adds tests for package receipt resolution and updates bundle identifier tests to use Pathname. |
Review details
馃挕 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
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.
brew benchmarkresults.brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?GitHub Copilot CLI using GPT-5.6 Sol helped investigate the issue, implement the change, and write tests. I reviewed the resulting diff, tested it against Cloudflare WARP, Google Drive, and Zoom package receipts, and ran
brew lgtm --online.brew generate-zapresolves search patterns from anappartifact's name and bundle identifier. Casks installed through apkgartifact do not expose anappartifact, even when the package installs an application. The command therefore falls back to the title-cased token and can incorrectly report that no zap stanza is required.For example:
This change uses
pkgutildirectives from uninstall and zap artifacts to find installed package receipts. It derives top-level application bundles from each receipt, excluding nested helper apps and stale receipt paths, then scans using their application names and bundle identifiers. The existing token-derived pattern remains as a fallback so broader matches such as Zoom updater files are preserved.Package receipts are the local source of truth for package-installed applications and avoid downloading or expanding installers. This lets package-based casks use the same bundle-aware zap generation as casks with explicit
appartifacts.