Skip to content

Conversation

@Jay-Lokhande
Copy link

@Jay-Lokhande Jay-Lokhande commented Dec 25, 2025

…sion is bumped.

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

Added remove_with_version_bump! method to Resource::Patch class and Exposed the method through ExternalPatch for querying patch removal flags
Modified bump-formula-pr to automatically detect and remove marked patches when version changes
Added audit check to warn maintainers about patches marked for removal

Fixes #21240

Jay-Lokhande and others added 5 commits December 25, 2025 18:02
…d remove_with_version_bump_issue_ref from Resource::Patch to ExternalPatch so patches can be queried for removal flags.
… maintainers they should be removed when the formula version is bumped.
When bumping a formula version, automatically detect and remove
patches that are marked with remove_with_version_bump!. This helps
maintainers by removing patches that are no longer needed after
version updates
@Jay-Lokhande Jay-Lokhande marked this pull request as ready for review December 26, 2025 08:37
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.

As mentioned in #21240 (comment) I think we need a solution to the "when should this patch be removed" question first.

@Jay-Lokhande
Copy link
Author

Jay-Lokhande commented Dec 27, 2025

As mentioned in #21240 (comment) I think we need a solution to the "when should this patch be removed" question first.

@MikeMcQuaid Thanks for the feedback. I understand the concern about when patches should be removed.
Proposed solution: Add an optional until_version parameter to specify the target version:

patch do
  url "..."
  sha256 "..."
  remove_with_version_bump! until_version: "2.0"  # Remove when version >= 2.0
end

If until_version is not specified, it defaults to removing on the next version bump (current behavior). This covers both cases

  1. remove on next bump (no parameter)
  2. remove when reaching a target version

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.

DSL for automatic patch removal after version bump

2 participants