Skip to content

github_runner_matrix: skip newer intel CI unless exact tag#21620

Open
cho-m wants to merge 1 commit intomainfrom
skip-intel-unless-exact-tag
Open

github_runner_matrix: skip newer intel CI unless exact tag#21620
cho-m wants to merge 1 commit intomainfrom
skip-intel-unless-exact-tag

Conversation

@cho-m
Copy link
Member

@cho-m cho-m commented Feb 24, 2026

  • 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?
  • Have you written new 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.

Skips extra Intel CI runners for :all bottle formulae. Original all bottles were created without these runners.

Running CI on these formulae have higher chance of unexpected setup failures and also propagate bottles when run in same PR as other formulae. For latter part, really should improve handling and maybe add an explicit exception list for bottling (or skip bottling unless an existing bottle exists, with bottle creation restricted to dispatch workflow).

Certifi (all bottle) example:

  • Before:
    ❯ brew determine-test-runners certifi | tail -n+2 | jq '.[].name'
    "Linux x86_64"
    "Linux arm64"
    "macOS 26-arm64"
    "macOS 26-x86_64"
    "macOS 15-arm64"
    "macOS 15-x86_64"
    "macOS 14-arm64"
    "macOS 14-x86_64"
    
  • After:
    ❯ brew determine-test-runners certifi | tail -n+2 | jq '.[].name'
    "Linux x86_64"
    "Linux arm64"
    "macOS 26-arm64"
    "macOS 15-arm64"
    "macOS 14-arm64"
    "macOS 14-x86_64"
    

GCC (Sequoia/Tahoe bottle) example, both before and after same:

❯ brew determine-test-runners gcc | tail -n+2 | jq '.[].name'
"Linux x86_64"
"Linux arm64"
"macOS 26-arm64"
"macOS 26-x86_64"
"macOS 15-arm64"
"macOS 15-x86_64"
"macOS 14-arm64"
"macOS 14-x86_64"

no_older_versions: true is mainly to get same output when run on macOS for verification purposes. CI runs command on Linux so it has no impact.

Can see difference by running brew determine-test-runners ruby on Linux vs macOS without PR changes

Copilot AI review requested due to automatic review settings February 24, 2026 17:56
Copy link
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

Updates GitHubRunnerMatrix runner generation to avoid scheduling newer Intel macOS runners for formulae bottled as :all, only keeping those newer Intel runners when an exact macOS bottle tag exists.

Changes:

  • Refines Intel-runner skipping logic for macOS versions newer than NEWEST_HOMEBREW_CORE_INTEL_MACOS_RUNNER by excluding :all bottles from qualifying as “tagged”.
  • Uses no_older_versions: true in bottle tag checks to require exact tag matches (no older-compatible fallback).

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

Comment on lines 231 to 236
skip_intel_runner = !@all_supported && macos_version > NEWEST_HOMEBREW_CORE_INTEL_MACOS_RUNNER
skip_intel_runner &&= @dependent_matrix || @testing_formulae.none? do |testing_formula|
testing_formula.formula.bottle_specification.tag?(Utils::Bottles.tag(macos_version.to_sym))
bottle_spec = testing_formula.formula.bottle_specification
bottle_spec.tag?(Utils::Bottles.tag(macos_version.to_sym), no_older_versions: true) &&
!bottle_spec.tag?(Utils::Bottles.tag(:all), no_older_versions: true)
end
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change alters runner selection for formulae with :all bottles (and for newer macOS versions beyond NEWEST_HOMEBREW_CORE_INTEL_MACOS_RUNNER), but there doesn’t appear to be spec coverage for this branch in Library/Homebrew/test/github_runner_matrix_spec.rb. Please add tests that (1) assert newer Intel runners are skipped for an :all bottle and (2) assert they are still included when an exact macOS tag bottle exists.

Copilot uses AI. Check for mistakes.
Comment on lines +233 to +235
bottle_spec = testing_formula.formula.bottle_specification
bottle_spec.tag?(Utils::Bottles.tag(macos_version.to_sym), no_older_versions: true) &&
!bottle_spec.tag?(Utils::Bottles.tag(:all), no_older_versions: true)
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Utils::Bottles.tag(...) creates new Utils::Bottles::Tag objects; calling it twice per formula per macOS version here adds avoidable allocations. Consider precomputing the macos_tag (once per macos_version) and the all_tag (once outside the loop) and reusing them inside the none? block.

Copilot uses AI. Check for mistakes.
Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me, thanks @cho-m!

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