Skip to content

Move bottle CI workflow helpers into brew - #23852

Merged
p-linnane merged 1 commit into
mainfrom
core-workflow-helpers
Sep 6, 2026
Merged

Move bottle CI workflow helpers into brew#23852
p-linnane merged 1 commit into
mainfrom
core-workflow-helpers

Conversation

@p-linnane

@p-linnane p-linnane commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

This adds brew generate-bottle-ci-matrix, which builds the dispatch-build-bottle runner matrix and rejects runners whose bottle already exists, and brew update-portable-ruby --print-target-version, which prints the revision-aware pkg_version without writing anything. Both replace github-script and brew ruby steps in homebrew-core so the logic is typed and tested here.

The matrix matches the removed JavaScript. The bottle check fixes two gaps in the inline Ruby: linux-arm64 was checked as x86_64_linux, and minor macOS versions such as 15.4-arm64 were never checked. Existing bottles surface as error annotations via ofail with a non-zero exit. The homebrew-core side is Homebrew/homebrew-core#302687 and lands after this.


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

Claude Code (Fable 5.1) drafted the implementation and tests; I reviewed the diff, verified the new tests fail without the change and pass with it, and ran brew lgtm --online plus targeted specs.


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

Thanks!

Copilot AI 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.

馃煛 Changes recommended

The new single-use helper methods violate the repository鈥檚 explicit inlining convention.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds typed, tested brew commands to replace inline workflow scripting in homebrew-core.

Changes:

  • Generates bottle CI runner matrices and detects existing bottles.
  • Adds a read-only portable Ruby target-version option.
  • Updates tests, RBI files and generated completions.
File summaries
File Description
Library/Homebrew/dev-cmd/generate-bottle-ci-matrix.rb Implements matrix generation and bottle checks.
Library/Homebrew/dev-cmd/update-portable-ruby.rb Adds target-version output mode.
Library/Homebrew/test/dev-cmd/generate-bottle-ci-matrix_spec.rb Tests runner mapping and failures.
Library/Homebrew/test/dev-cmd/update-portable-ruby_spec.rb Tests version output.
Library/Homebrew/sorbet/rbi/dsl/homebrew/dev_cmd/generate_bottle_ci_matrix.rbi Adds generated argument types.
Library/Homebrew/sorbet/rbi/dsl/homebrew/dev_cmd/update_portable_ruby.rbi Types the new switch.
completions/bash/brew Adds Bash completions.
completions/fish/brew.fish Adds fish completions.
completions/zsh/_brew Adds zsh completions.
Review details

Files not reviewed (2)

  • Library/Homebrew/sorbet/rbi/dsl/homebrew/dev_cmd/generate_bottle_ci_matrix.rbi: File type not supported
  • Library/Homebrew/sorbet/rbi/dsl/homebrew/dev_cmd/update_portable_ruby.rbi: File type not supported

Suppressed comments (1)

Library/Homebrew/dev-cmd/generate-bottle-ci-matrix.rb:77

  • This helper is likewise called only once and is not needed for direct unit testing. To comply with AGENTS.md:5, inline the matrix-entry construction into the runners.map block.
      def runner_spec(runner, github_run_id)
  • Files reviewed: 7/9 changed files
  • Comments generated: 1
  • Review effort level: Balanced

馃挕 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread Library/Homebrew/dev-cmd/generate-bottle-ci-matrix.rb Outdated
- Add `brew generate-bottle-ci-matrix` to build the dispatched bottle
  runner matrix and reject runners whose bottle already exists,
  replacing the `github-script` and `brew ruby` steps in homebrew-core.
- Check self-hosted `linux-arm64` runners as `arm64_linux` rather than
  `x86_64_linux` and check minor macOS versions such as `15.4-arm64`.
- Add `brew update-portable-ruby --print-target-version` so workflows
  can read the revision-aware `pkg_version` without `brew ruby`.

Signed-off-by: Patrick Linnane <patrick@linnane.io>
@p-linnane
p-linnane force-pushed the core-workflow-helpers branch from a04cb21 to 52a621c Compare September 6, 2026 20:20
@p-linnane
p-linnane enabled auto-merge September 6, 2026 20:21
@p-linnane
p-linnane added this pull request to the merge queue Sep 6, 2026
Merged via the queue into main with commit b00ee18 Sep 6, 2026
82 of 83 checks passed
@p-linnane
p-linnane deleted the core-workflow-helpers branch September 6, 2026 20:49
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