Skip to content

Reject unsupported API casks earlier#22070

Merged
MikeMcQuaid merged 1 commit intomainfrom
fix-gimp-cask-installation-error-on-linux
Apr 23, 2026
Merged

Reject unsupported API casks earlier#22070
MikeMcQuaid merged 1 commit intomainfrom
fix-gimp-cask-installation-error-on-linux

Conversation

@MikeMcQuaid
Copy link
Copy Markdown
Member

  • stop gimp on Linux before source reloads fail
  • avoid queued downloads for unsupported API-backed casks
  • cover fetch and enqueue_downloads with regression tests

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them? Performance claims (e.g. "this is faster") must include Hyperfine benchmarks.
  • Have you written new tests (excluding integration tests) for your changes? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) with your changes locally?

  • AI was used to generate or assist with generating this PR. Please specify below how you used AI to help you, and what steps you have taken to manually verify the changes. Non-maintainers may only have one AI-assisted/generated PR open at a time.

Used OpenAI Codex xhigh with local review.


- stop `gimp` on Linux before source reloads fail
- avoid queued downloads for unsupported API-backed casks
- cover `fetch` and `enqueue_downloads` with regression tests
Copilot AI review requested due to automatic review settings April 23, 2026 18:54
@MikeMcQuaid MikeMcQuaid enabled auto-merge April 23, 2026 18:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 changes cask installation flow to fail fast on unsupported API-backed casks (before attempting API source reloads or queueing downloads), with regression tests covering both fetch and download prefetching.

Changes:

  • Run check_requirements before load_cask_from_source_api! in Cask::Installer#fetch.
  • Run check_requirements at the start of Cask::Installer#enqueue_downloads to prevent queuing downloads for unsupported casks.
  • Add installer specs ensuring API source download paths are not invoked when requirements are unsatisfied.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
Library/Homebrew/cask/installer.rb Reorders/introduces requirement checks to reject unsupported API-backed casks earlier in fetch and enqueue_downloads.
Library/Homebrew/test/cask/installer_spec.rb Adds regression tests asserting requirements are validated before any API source-download work in fetch and before prefetch enqueuing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Apr 23, 2026
Merged via the queue into main with commit 8d859f3 Apr 23, 2026
40 checks passed
@MikeMcQuaid MikeMcQuaid deleted the fix-gimp-cask-installation-error-on-linux branch April 23, 2026 19:32
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.

3 participants