Skip to content

Prefill app and zap in brew create --cask - #24316

Merged
MikeMcQuaid merged 1 commit into
mainfrom
brew_create_zap
Oct 22, 2026
Merged

MikeMcQuaid merged 1 commit into
mainfrom
brew_create_zap

Conversation

@bevanjkay

@bevanjkay bevanjkay commented Oct 21, 2026 •

Copy link
Copy Markdown
Member
  • New casks now need a zap stanza, which contributors find the most confusing part of a cask. Prefill it by running brew generate-zap on an installed copy of the app.
  • The cask name defaults to the download's file name, e.g. AgentIDE-0.9.11, not the app's, so unpack the download to find the app instead. Use it to fill in app, read its appcast for livecheck and find the installed copy.
  • Only scan an installed copy, so that a generic app name doesn't match unrelated files, and skip suites of apps rather than guess.
  • Unpacking only helps prefill the template, so warn rather than fail when the download can't be unpacked.
  • Have brew generate-zap --name also match the installed app's bundle identifier, which names most preference and cache files.

  • Have you followed our Contributing guidelines?
  • Have you checked for other open Pull Requests for the same change?
  • Have you explained what your changes do? Performance claims (e.g. "this is faster") must include brew benchmark results.
  • Have you explained why you'd like these changes included, not just what they do?
  • For bug fixes, have you given step-by-step brew commands to reproduce the bug?
  • Have you written new tests (excluding integration tests)? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) locally?

  • I did not use AI/LLM to create this PR, or I disclosed the tool/model below and reviewed its output; I did not attribute commits to AI and will answer maintainer questions and review comments myself without AI/LLM.

@bevanjkay
bevanjkay added this pull request to stack #24317 October 21, 2026 10:31
@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8c3ce37f-acfc-4fc6-88c9-e2e855e51ddf
📥 Commits

Reviewing files that changed from the base of the PR and between d2f1788 and 1fd644f.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 10b5a7f8-5885-4756-9fec-27c961cf1b72
📥 Commits

Reviewing files that changed from the base of the PR and between 109f015 and d2f1788.

📒 Files selected for processing: 2
  • Library/Homebrew/dev-cmd/create.rb
  • Library/Homebrew/test/dev-cmd/create_spec.rb

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

📝 Summary

Summary by CodeRabbit

  • New Features

    • brew create --cask can detect apps in downloaded archives and prefill appcast and zap details when available.
    • brew generate-zap --name now also matches installed applications by bundle identifier.
    • Cask creation continues with guidance when apps cannot be unpacked or detection is ambiguous.
  • Documentation

    • Updated command help, shell completions, and cask guidance.
  • Tests

    • Expanded coverage for app detection, archive handling, appcast lookup, and zap generation.

Cask creation now inspects downloaded archives for apps and uses app paths to populate appcast and zap fields. The generate-zap --name option also matches installed apps by bundle identifier. Tests and documentation cover these changes.

Changes: Cask app discovery and zap generation

Layer / File(s) Summary
Match installed apps by name and bundle identifier
Library/Homebrew/dev-cmd/generate-zap.rb, Library/Homebrew/test/dev-cmd/generate-zap_spec.rb, completions/fish/brew.fish, completions/zsh/_brew, docs/Manpage.md, manpages/brew.1
generate-zap --name now derives patterns from the installed app name and, when readable, its bundle identifier. Tests and command descriptions cover the matching behaviour.
Discover apps and populate cask stanzas
Library/Homebrew/dev-cmd/create.rb, Library/Homebrew/test/dev-cmd/create_spec.rb, docs/Cask-Cookbook.md
Cask creation inspects cached downloads for a unique shallowest app and uses app paths to find appcasts and generate zap rules. Tests cover discovery, generated stanzas, and fallback cases. The cookbook documents the zap workflow.

Priority: ⬇️ Low

Merge Risk: 🔵 Low · up to d2f17

A failed zap scan can leave contributors with an empty stanza to complete manually. The PR is mergeable with awareness of this fallback limitation.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title clearly summarises the main change: brew create --cask now prefills the app and zap stanzas.
Description check Passed The description directly explains the cask creation changes, app discovery, zap generation, bundle identifier matching, tests, and validation.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 4


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7310b9b9-508c-47ae-90be-6136f73ed2c1
📥 Commits

Reviewing files that changed from the base of the PR and between 59ef862 and 109f015.

📒 Files selected for processing: 4
  • Library/Homebrew/dev-cmd/create.rb
  • Library/Homebrew/dev-cmd/generate-zap.rb
  • Library/Homebrew/test/dev-cmd/create_spec.rb
  • Library/Homebrew/test/dev-cmd/generate-zap_spec.rb

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

Comment thread Library/Homebrew/dev-cmd/create.rb Resolved
Comment thread Library/Homebrew/dev-cmd/create.rb Resolved
Comment thread Library/Homebrew/dev-cmd/create.rb Resolved

@MikeMcQuaid MikeMcQuaid left a comment

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.

Nice, great work!

@MikeMcQuaid
MikeMcQuaid added this pull request to the merge queue Oct 22, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 22, 2026
Base automatically changed from zap_audit to main October 22, 2026 08:14
- New casks now need a `zap` stanza, which contributors find the most
  confusing part of a cask. Prefill it by running `brew generate-zap`
  on an installed copy of the app.
- Show `brew generate-zap`'s warnings and errors, e.g. a missing Full
  Disk Access permission, so contributors know why nothing was
  prefilled.
- The cask name defaults to the download's file name, e.g.
  `AgentIDE-0.9.11`, not the app's, so unpack the download to find the
  app instead. Use it to fill in `app`, read its appcast for
  `livecheck` and find the installed copy.
- Only scan an installed copy, so that a generic app name doesn't match
  unrelated files, and skip suites of apps rather than guess.
- Unpacking only helps prefill the template, so warn rather than fail
  when the download can't be unpacked.
- Have `brew generate-zap --name` also match the installed app's bundle
  identifier, which names most preference and cache files.
- Without an installed copy, contributors still need to know how to
  generate one, so say in the template exactly what to run and list
  the steps in the Cask Cookbook.
@MikeMcQuaid
MikeMcQuaid enabled stacked auto-merge October 22, 2026 08:22
@MikeMcQuaid
MikeMcQuaid added this pull request to the merge queue Oct 22, 2026
Merged via the queue into main with commit b3ca773 Oct 22, 2026
53 of 54 checks passed
@MikeMcQuaid
MikeMcQuaid deleted the brew_create_zap branch October 22, 2026 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

⌂ 换网址