Skip to content

formula_versions: allow test-only resources - #24218

Merged
MikeMcQuaid merged 1 commit into
mainfrom
formula-versions-test-resources
Oct 10, 2026
Merged

MikeMcQuaid merged 1 commit into
mainfrom
formula-versions-test-resources

Conversation

@daeho-ro

Copy link
Copy Markdown
Member

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

Homebrew/homebrew-core#317001

From this PR branch,

brew test-bot --testing-formulae=auditwheel --added-formulae= --deleted-formulae= --only-formulae --only-json-tab --skip-dependents

will fail because the type mismatch.

@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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: 929d16ae-2521-463a-a9e1-6f414ccb6f4f

📥 Commits

Reviewing files that changed from the base of the PR and between 16f166d and 0ca18d9.


📒 Files selected for processing (2)
  • Library/Homebrew/formula_versions.rb
  • Library/Homebrew/test/formula_versions_spec.rb

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


📜 Recent review details
⏰ Context from checks skipped due to timeout. (19)
  • GitHub Check: docker (arm64 Ubuntu 24.04)
  • GitHub Check: docker (x86_64 Ubuntu 24.04)
  • GitHub Check: docker (x86_64 Ubuntu 26.04)
  • GitHub Check: docker (arm64 Ubuntu 26.04)
  • GitHub Check: tests (Linux, 2/2)
  • GitHub Check: tests (generic OS, 2/2)
  • GitHub Check: tests (online, 1/2)
  • GitHub Check: tests (load-only macOS)
  • GitHub Check: tests (load-only Linux)
  • GitHub Check: tests (online, 2/2)
  • GitHub Check: tests (macOS, 1/2)
  • GitHub Check: tests (Linux, 1/2)
  • GitHub Check: tests (no Sorbet)
  • GitHub Check: tests (generic OS, 1/2)
  • GitHub Check: tests (macOS, 2/2)
  • GitHub Check: syntax
  • GitHub Check: workflow_syntax
  • GitHub Check: docs
  • GitHub Check: Analyze

🔇 Additional comments (2)
Library/Homebrew/formula_versions.rb (1)

43-43: LGTM!


Library/Homebrew/test/formula_versions_spec.rb (1)

345-364: LGTM!



📝 Summary

Summary by CodeRabbit

  • Bug Fixes
    • Fixed loading of historical formulas that declare resources using the :test option.

Walkthrough

LegacySoftwareSpec#resource now accepts a Symbol as well as a Resource subclass. A regression test checks that loading a historical formula includes its test-only resource in old.resources.

Changes

Historical Formula Resources

Layer / File(s) Summary
Resource compatibility and regression test
Library/Homebrew/formula_versions.rb, Library/Homebrew/test/formula_versions_spec.rb
LegacySoftwareSpec#resource accepts a Symbol for klass. A regression test checks that a test-only resource appears in the resources loaded from a historical formula.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Suggested reviewers: p-linnane


Merge Risk | ⚪ Minimal · up to 0ca18

Merge Risk: ⚪ Minimal · up to 0ca18

Historical formulas can now declare the supported :test resource form, and the regression test checks that it is retained. No actionable merge risk is established.

Security Architecture Review

Security architecture risk: ⚪ Minimal · up to 0ca18

The change aligns historical formula declarations with existing test-resource handling. It does not introduce a new execution or download entrypoint, increase privileges, or bypass resource validation. No material security risk was found introduced or worsened by this PR.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The effective change is confined to historical formula inspection within the invoking Homebrew process. Inspected historical consumers read metadata; no new fetching, installation, service, tenant, or privileged execution boundary was established.

Trust Boundaries and Controls

  • inferred — Historical formula source already crosses into Ruby evaluation through the existing loader. Accepting :test does not create that trust transition or grant additional authority to a source author; it routes a declaration through established validation and registration controls.

Pre-merge checks | Passed 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly states the main change: allowing test-only resources in formula_versions.
Description check Passed The description relates to the changeset by identifying the type mismatch, linking the related pull request, and stating the intended fix.
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

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

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

@MikeMcQuaid
MikeMcQuaid added this pull request to the merge queue Oct 10, 2026
Merged via the queue into main with commit c7c0518 Oct 10, 2026
53 checks passed
@MikeMcQuaid
MikeMcQuaid deleted the formula-versions-test-resources branch October 10, 2026 15:30
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

⌂ 换网址