WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@MikeMcQuaid
Copy link
Member

@MikeMcQuaid MikeMcQuaid commented Oct 24, 2025

Add a new audit method to check if the revision and compatibility_version are consistent with each other.

This ensures that when a formula's compatibility_version is increased, the revision of dependent formulas was also increased.

Inversely, when a formula's revision is increased in the same PR as one of its dependencies, the compatibility_version of dependent formulae must be increased by 1.

While we're here, DRY things up and improve some naming to be more readable/obvious.

@MikeMcQuaid MikeMcQuaid force-pushed the audit_revision_and_compatibility_version_relationships branch from d7bae0f to 21b5d67 Compare October 28, 2025 17:40
@MikeMcQuaid MikeMcQuaid marked this pull request as ready for review October 28, 2025 17:40
Copilot AI review requested due to automatic review settings October 28, 2025 17:40
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

This PR adds support for auditing compatibility_version changes in formulae and extends the existing revision audit to validate dependency relationships.

  • Introduces a new audit_compatibility_version method that ensures compatibility versions don't decrease and only increment by 1, and that dependent formulae bump their revisions accordingly
  • Extends audit_revision to validate that when a formula's revision increases, changed dependencies must have their compatibility_version incremented by 1
  • Refactors version info caching and adds a changed_formulae_paths helper method to identify changed formulae in a tap

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
Library/Homebrew/formula_auditor.rb Adds audit_compatibility_version method, extends audit_revision with dependency validation, adds changed_formulae_paths helper, and refactors version info caching to support multiple formulae
Library/Homebrew/test/formula_auditor_spec.rb Adds comprehensive test coverage for both compatibility_version audits and revision-dependency relationship validation, including new test helper methods for formula creation and stubbing

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

Copy link
Member

@Rylan12 Rylan12 left a comment

Choose a reason for hiding this comment

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

I think this approach looks good! I do think there's a few places where the wrong output from committed_version_info is being used, though.

It's possible that I'm misunderstanding, though, so feel free to correct me if I'm wrong here

@MikeMcQuaid MikeMcQuaid force-pushed the audit_revision_and_compatibility_version_relationships branch from 4c7716e to 5c0782d Compare October 29, 2025 09:20
@MikeMcQuaid MikeMcQuaid requested a review from Copilot October 29, 2025 09:30
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

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


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

@MikeMcQuaid MikeMcQuaid force-pushed the audit_revision_and_compatibility_version_relationships branch from 5c0782d to 99ccfd7 Compare October 31, 2025 14:36
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

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


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

@MikeMcQuaid MikeMcQuaid force-pushed the audit_revision_and_compatibility_version_relationships branch from 99ccfd7 to 3871cc0 Compare October 31, 2025 14:46
@MikeMcQuaid MikeMcQuaid requested a review from Copilot October 31, 2025 14:46
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

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.


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

Copy link
Member

@Rylan12 Rylan12 left a comment

Choose a reason for hiding this comment

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

Looks great, I love the naming! Thanks for sticking through my nits 😅

One final set of comments, I still think there's a small edge case that's not handled, but I think it's unlikely (and potentially impossible) to get to this situation, so feel free to ignore

Copilot AI review requested due to automatic review settings November 6, 2025 15:10
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

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


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

@MikeMcQuaid MikeMcQuaid force-pushed the audit_revision_and_compatibility_version_relationships branch from 200c827 to 2e994a9 Compare November 12, 2025 16:23
Copy link
Member

@Rylan12 Rylan12 left a comment

Choose a reason for hiding this comment

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

Looks good! I caught one more small thing, but good to merge without re-reviews

Copilot AI review requested due to automatic review settings November 14, 2025 08:54
Copilot finished reviewing on behalf of MikeMcQuaid November 14, 2025 08:58
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

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


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

@MikeMcQuaid MikeMcQuaid force-pushed the audit_revision_and_compatibility_version_relationships branch from 2cd8da4 to 338f8dd Compare November 14, 2025 15:43
@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Dec 2, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 2, 2025
@MikeMcQuaid MikeMcQuaid force-pushed the audit_revision_and_compatibility_version_relationships branch from 338f8dd to 0e57103 Compare December 2, 2025 10:08
Add a new audit method to check if the `revision` and
`compatibility_version` are consistent with each other.

This ensures that when a formula's `compatibility_version` is
increased, the `revision` of dependent formulas was also increased.

Inversely, when a formula's `revision` is increased in the same PR as
one of its dependencies, the `compatibility_version` of dependent
formulae must be increased by 1.

While we're here, DRY things up and improve some naming to me more
readable/obvious.

Co-authored-by: Rylan Polster <[email protected]>
@MikeMcQuaid MikeMcQuaid force-pushed the audit_revision_and_compatibility_version_relationships branch from 0e57103 to 1cecd7a Compare December 2, 2025 12:44
@MikeMcQuaid MikeMcQuaid enabled auto-merge December 2, 2025 12:44
@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Dec 2, 2025
Merged via the queue into main with commit 9142da7 Dec 2, 2025
35 checks passed
@MikeMcQuaid MikeMcQuaid deleted the audit_revision_and_compatibility_version_relationships branch December 2, 2025 13:24
@scpeters
Copy link
Contributor

scpeters commented Dec 4, 2025

Inversely, when a formula's revision is increased in the same PR as one of its dependencies, the compatibility_version of dependent formulae must be increased by 1.

I just ran into this new audit in osrf/homebrew-simulation#3272 (comment), which bumps the revision for two formulae to rebuild against the new libwebsockets upgraded in Homebrew/homebrew-core#256449, and it recommends that one of the formula needs a compatibility_version bump as well.

For a formula with multiple levels of recursive dependents that require revision bumps for each minor upgrade (such as the protobuf upgrade in Homebrew/homebrew-core#254203), would this also require compatibility_version to be incremented for some of these dependent formulae?

@MikeMcQuaid
Copy link
Member Author

@scpeters You are bottling in your tap, yes? It occurred to me if you weren't then this check is somewhat redundant and should perhaps be skipped. Would accept a PR for that.

For a formula with multiple levels of recursive dependents that require revision bumps for each minor upgrade (such as the protobuf upgrade in Homebrew/homebrew-core#254203), would this also require compatibility_version to be incremented for some of these dependent formulae?

In a case like that PR, only protobuf should need to have a bump. It may be there's unspecified direct dependencies on protobuf that should be declared if e.g. linkage is broken without a revision bump.

@p-linnane remind me: we now track this sort of thing better now, right? I remember historically we treated direct and indirect dependencies similarly for linkage tracking and now we don't, right?

@p-linnane
Copy link
Member

Earlier this year we started warning about indirect dependencies with linkage in an effort to fix instances of that. It's not a hard error IIRC. Up next on my list is to start warning about instances of no_linkage.

@MikeMcQuaid
Copy link
Member Author

@p-linnane thanks! Yeh, I think it might be good to start making it a hard error in homebrew/core at least 🤔

@scpeters
Copy link
Contributor

scpeters commented Dec 6, 2025

@scpeters You are bottling in your tap, yes? It occurred to me if you weren't then this check is somewhat redundant and should perhaps be skipped. Would accept a PR for that.

We are bottling in the osrf/simulation tap, but I'll open a PR to disable the audit that fails in osrf/homebrew-simulation#3272 and we can continue discussion there.

@scpeters
Copy link
Contributor

scpeters commented Dec 6, 2025

I'll open a PR to disable the audit that fails in osrf/homebrew-simulation#3272 and we can continue discussion there.

I opened #21184

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.

5 participants