Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

livecheck: split cask versions into sub-versions #10376

Merged

Conversation

SeekingMeaning
Copy link
Contributor

@SeekingMeaning SeekingMeaning commented Jan 20, 2021

  • 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 style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?
  • Have you successfully run brew man locally and committed any changes?

Follow-up to #10348

Livecheck now correctly reports 15.0.1,9 as newer than 15,36, but now 15.0.1,9.1 is reported as equal to 15.0.1,9

This PR adds the LivecheckVersion class that compares the individual sub-versions of a formula/cask version, similar to how the Version class compares version tokens.

When comparing 15.0.1,9 and 15,36:

  1. 15.0.1 > 15
  2. Therefore, 15.0.1,9 > 15,36

When comparing 15.0.1,9.1 and 15.0.1,9:

  1. 15.0.1 == 15.0.1
  2. 9.1 > 9
  3. Therefore, 15.0.1,9.1 > 15.0.1,9

Related: Homebrew/homebrew-cask#98130

@BrewTestBot
Copy link
Member

Review period will end on 2021-01-21 at 17:31:33 UTC.

@BrewTestBot BrewTestBot added the waiting for feedback Merging is blocked until sufficient time has passed for review label Jan 20, 2021
@BrewTestBot BrewTestBot removed the waiting for feedback Merging is blocked until sufficient time has passed for review label Jan 21, 2021
@BrewTestBot
Copy link
Member

Review period ended.

when Formula
[version]
when Cask::Cask
version.to_s.split(/[,:]/).map { |s| Version.new(s) }
Copy link
Member

Choose a reason for hiding this comment

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

Not blocking but if there's a chance for tests for any of this that might be nice?

Copy link
Member

Choose a reason for hiding this comment

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

We’re considering getting rid of : in version. Pointing that out so there’s something to link to from the other issue, and we can revisit this code when the time comes.

# A formula or cask version, split into its component sub-versions.
#
# @api private
class LivecheckVersion
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
class LivecheckVersion
class Version

or rename the file livecheck_version.rb maybe?

@SeekingMeaning SeekingMeaning merged commit a308c6d into Homebrew:master Jan 25, 2021
@BrewTestBot BrewTestBot added the outdated PR was locked due to age label Feb 25, 2021
@Homebrew Homebrew locked as resolved and limited conversation to collaborators Feb 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants