Skip to content

detect Cask updates parsed with "!=" operator#5157

Merged
Gabriel Dufresne (GabrielDuf) merged 2 commits into
mainfrom
fix/homebrew-cask-updates-5127
Jul 20, 2026
Merged

detect Cask updates parsed with "!=" operator#5157
Gabriel Dufresne (GabrielDuf) merged 2 commits into
mainfrom
fix/homebrew-cask-updates-5127

Conversation

@GabrielDuf

@GabrielDuf Gabriel Dufresne (GabrielDuf) commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

This pull request improves the handling and testing of Homebrew package updates, specifically ensuring that both Formula and Cask updates are detected correctly. The main changes include updating the outdated package parsing logic to support multiple comparison operators, refactoring the parser for testability, and adding regression tests to prevent similar issues in the future.

Homebrew update detection improvements:

  • Updated the outdated package parsing logic in Homebrew.cs to accept both < (Formula) and != (Cask) operators, ensuring that updates for both types are detected and processed. Previously, only < was accepted, causing Cask updates to be silently dropped.
  • Refactored the parsing logic into a new internal method ParseAvailableUpdates, making it easier to unit test and maintain.

Testing and test infrastructure:

  • Added a regression test in HomebrewManagerTests.cs to verify that both Formula and Cask updates are detected, preventing future regressions.
  • Added a test fixture file outdated-verbose.txt containing sample output for both Formula and Cask updates.
  • Updated the test project references and added InternalsVisibleTo for test access to internal members.

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

Adds Homebrew Cask update detection while preserving Formula support.

Changes:

  • Parses both < and != update operators.
  • Extracts parsing into a testable internal method.
  • Adds regression coverage and fixtures.

Reviewed changes

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

Show a summary per file
File Description
UniGetUI.PackageEngine.Tests.csproj References the Homebrew manager.
HomebrewManagerTests.cs Tests Formula and Cask updates.
Fixtures/Homebrew/outdated-verbose.txt Provides representative output.
InternalsVisibleTo.cs Exposes internals to tests.
Homebrew.cs Supports Cask update syntax and refactors parsing.

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

Comment thread src/UniGetUI.PackageEngine.Managers.Homebrew/Homebrew.cs Outdated
@GabrielDuf
Gabriel Dufresne (GabrielDuf) merged commit 668c805 into main Jul 20, 2026
8 of 9 checks passed
@GabrielDuf
Gabriel Dufresne (GabrielDuf) deleted the fix/homebrew-cask-updates-5127 branch July 20, 2026 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Homebrew Cask updates are not detected because the outdated parser only matches “<”

3 participants