Skip to content

Migrate cask callers to explicit source APIs - #24441

Merged
MikeMcQuaid merged 1 commit into
mainfrom
migrate-cask-source-loads
Nov 3, 2026
Merged

MikeMcQuaid merged 1 commit into
mainfrom
migrate-cask-source-loads

Conversation

@MikeMcQuaid

Copy link
Copy Markdown
Member
  • Select cask paths and content explicitly in audits, CI, API generation and installed metadata workflows.
  • Migrate cask fixtures and shared command coverage so bundle and cask operations are ready for name-only default loading.
  • Leave default selection and legacy deprecations for the final change in the stack.

  • 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.

Codex with GPT 6 Astra at High effort, with local review and testing.


@MikeMcQuaid
MikeMcQuaid added this pull request to stack #24440 November 2, 2026 08:52
@coderabbitai

coderabbitai Bot commented Nov 2, 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: 3194645c-7ba8-47b6-ad10-a641bb81d911
Commits

Reviewing files that changed from the base of the PR and between 13fe985 and 074427b.

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.

Summary

Summary by CodeRabbit

  • Bug Fixes
    • Casks are handled more consistently when commands load them by name, file path or content, supporting reliable installation, auditing, updates, downloads and other workflows.
    • Auditing can continue to process installed casks even when their original tap source is unavailable.
    • Commands that inspect or validate casks now handle tap-based cask paths more consistently across platform-specific checks.
  • New Features
    • Generating zap instructions now supports selecting a cask directly from a tap source.

Cask loading call sites now use entry points that distinguish names, tap paths, file paths, installed caskfiles, and in-memory content. The corresponding specs and command tests update their setup or inputs. The generate-zap command adds tap-source loading.

Changes: Cask loader migration

Layer / File(s) Summary
Production cask loading
Library/Homebrew/cask/*, Library/Homebrew/cmd/fetch.rb, Library/Homebrew/dev-cmd/*, Library/Homebrew/readall.rb, Library/Homebrew/livecheck/strategy/extract_plist.rb
Cask loading call sites now select loader methods according to input type. Audit reloads support metadata-backed casks and unavailable tap sources.
Zap tap-source loading
Library/Homebrew/cask/ci/zap_check.rb, Library/Homebrew/dev-cmd/generate-zap.rb, Library/Homebrew/sorbet/rbi/dsl/homebrew/dev_cmd/generate_zap.rbi, Library/Homebrew/test/cask/ci/zap_check_spec.rb, Library/Homebrew/test/dev-cmd/generate-zap_spec.rb
ZapCheck passes .rb paths with --tap-source. generate-zap loads that source with from_tap_path.
Loader and behaviour specs
Library/Homebrew/test/cask/*, Library/Homebrew/test/*dependents*, Library/Homebrew/test/uninstall_spec.rb, Library/Homebrew/test/utils/autoremove_spec.rb
Tests use from_path for file fixtures and from_content for inline definitions. Loader doubles and expectations use the updated APIs.
Command test inputs
Library/Homebrew/test/cmd/*, Library/Homebrew/test/dev-cmd/*, Library/Homebrew/test/livecheck*
Command tests use cask names where applicable. Related path, output, and fixture expectations are updated.
Merge Risk: Moderate · previous review 13fe9

Auditing installed casks may still fail when their original tap source is unavailable, so this path should be verified before merging.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: migrating cask callers to explicit source APIs.
Description check Passed The description is directly related to the changeset and explains the migration scope, intended preparation, and remaining work.
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.

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

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
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: ca7c613a-66e3-481b-b8a9-5ff55df4ef74
Commits

Reviewing files that changed from the base of the PR and between ddc8658 and 13fe985.

Files selected for processing: 2
  • Library/Homebrew/test/dev-cmd/audit_spec.rb
  • Library/Homebrew/test/livecheck/livecheck_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.

Comment thread Library/Homebrew/cask/ci/zap_check.rb Resolved
Comment thread Library/Homebrew/dev-cmd/audit.rb Resolved
@MikeMcQuaid
MikeMcQuaid force-pushed the migrate-cask-source-loads branch from 199d042 to fd16281 Compare November 2, 2026 13:24
@MikeMcQuaid
MikeMcQuaid force-pushed the migrate-cask-source-loads branch from fd16281 to 3716984 Compare November 2, 2026 14:56
@MikeMcQuaid
MikeMcQuaid force-pushed the migrate-cask-source-loads branch from 3716984 to 486adf6 Compare November 2, 2026 15:22
@MikeMcQuaid
MikeMcQuaid force-pushed the migrate-cask-source-loads branch from 486adf6 to 2f758d0 Compare November 2, 2026 15:56
@MikeMcQuaid
MikeMcQuaid force-pushed the migrate-cask-source-loads branch from 2f758d0 to 705fee5 Compare November 2, 2026 16:49
@MikeMcQuaid
MikeMcQuaid force-pushed the migrate-cask-source-loads branch from 705fee5 to ddc8658 Compare November 2, 2026 18:55
@MikeMcQuaid
MikeMcQuaid force-pushed the migrate-cask-source-loads branch from ddc8658 to 13fe985 Compare November 3, 2026 10:29
- Select cask paths and content explicitly in audits, CI, API
  generation and installed metadata workflows.
- Reuse registered tap selections without repeated path scans and
  preserve installed metadata when auditing removed casks.
- Pass the selected tap source to zap generation so API loading
  cannot replace the cask being tested.
- Migrate fixtures and command coverage before tightening defaults.
@MikeMcQuaid
MikeMcQuaid force-pushed the migrate-cask-source-loads branch from 13fe985 to 074427b Compare November 3, 2026 11:00
@MikeMcQuaid
MikeMcQuaid added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit d944230 Nov 3, 2026
55 checks passed
Base automatically changed from migrate-formula-source-loads to main November 3, 2026 11:48
@MikeMcQuaid
MikeMcQuaid deleted the migrate-cask-source-loads branch November 3, 2026 11:48
bevanjkay added a commit to Homebrew/homebrew-cask that referenced this pull request Nov 3, 2026
- Homebrew/brew#24441 made `brew cask-ci` load `.rb` paths only from a
  registered tap. Linux jobs run in a container where the workspace is
  a separate checkout, so `./Casks/...` is rejected with "Not a
  registered tap source file".
- Resolve the path inside the tap once in `Gather cask information`
  and reuse it for `zap-check` and `check`.
- Homebrew/brew#24442 limits `brew fetch`, `install` and `uninstall`
  to cask names, so pass `matrix.cask.token` to them as `audit` does.
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

⌂ 换网址