Skip to content

Invalidate bottle cache for local patches - #23597

Merged
MikeMcQuaid merged 2 commits into
mainfrom
testbot-local-patch-cache
Aug 21, 2026
Merged

Invalidate bottle cache for local patches#23597
MikeMcQuaid merged 2 commits into
mainfrom
testbot-local-patch-cache

Conversation

@MikeMcQuaid

Copy link
Copy Markdown
Member
  • Include local patch paths when checking formula changes.
  • Prevent stale bottles when a patch changes without its formula.
  • Cover the cache decision with a regression test.

Fixes #23588


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

OpenAI Codex 5.6 Sol xhigh with local review and (unit) testing.


- Include local patch paths when checking formula changes.
- Prevent stale bottles when a patch changes without its formula.
- Cover the cache decision with a regression test.
Copilot AI lite review requested due to automatic review settings August 21, 2026 08:22
@MikeMcQuaid
MikeMcQuaid enabled auto-merge August 21, 2026 08:22

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.

Pull request overview

This PR updates Homebrew鈥檚 test-bot bottle-cache invalidation logic so that a cached bottle is considered invalid not only when the formula file changes, but also when any local patch file referenced by the formula changes. This addresses stale-bottle reuse when only a local patch has been modified.

Changes:

  • Extend no_diff? to include local patch file paths (from formula.patchlist) in the git diff pathspec used to decide cache validity.
  • Add a regression spec ensuring artifact_cache_valid? rejects a cached bottle when only a local patch file has changed.

Reviewed changes

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

File Description
Library/Homebrew/test_bot/test_formulae.rb Include local patch paths in the git diff check that underpins bottle-cache validity decisions.
Library/Homebrew/test/test_bot/test_formulae_spec.rb Add regression coverage for invalidating the artifact cache when a local patch changes without the formula changing.

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

@MikeMcQuaid
MikeMcQuaid added this pull request to the merge queue Aug 21, 2026
Merged via the queue into main with commit b62af44 Aug 21, 2026
45 checks passed
@MikeMcQuaid
MikeMcQuaid deleted the testbot-local-patch-cache branch August 21, 2026 11:13
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.

brew testbot uses bottle cache, even when patch has changed

3 participants