-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
resolve_latest_keg
should return the latest HEAD keg when no stable kegs exist
#11824
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I included the
source_modified_time
code here directly since it is so brief. If you think this should be encapsulated elsewhere for use inresolve_latest_keg
andlatest_head_version
, I'm happy to make changes. @Rylan12There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cnnrmnn I think this is fine. I'm not sure it really makes much sense to extract what's essentially
#source_modified_time
to its own method.Just making sure, the
revision
secondary sort fromFormula#latest_head_version
isn't necessary here, right?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that the
revision
secondary sort is needed anywhere we're dealing exclusively withHEAD
versions. If you check out the parsing function forPkgVersion
, you'll see that it parses the revision using a regex.HEAD
paths (e.g.,HEAD-6974ce8
) matched to that regex will always setrevision
to nil. AnyHEAD
version should have a revision equal to0
sinceto_i
is called on the parsednil
revision
.Am I missing anything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha makes sense. So it could probably be removed from
latest_head_version
too, right? Probably not worth doing but just curious if there's a difference.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, should be fine to remove. I can do that in a quick PR as to not confuse anyone dealing with that code in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You definitely don't need to but it probably wouldn't hurt. Plus it will expose more maintainers to it in case anyone knows something we're missing and it turns out it is necessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Rylan12 Did some quick digging, and found a spec that tests
HEAD
versions with revisions. Do you know if there's any scenario where aHEAD
version would actually have a revision?I would think so given that the above test exists, but I'm still curious. If you don't know, I can do a little more digging and restore the secondary sort here if appropriate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good call. If you do
brew install --HEAD
on a formula that's specified arevision
it will show up asHEAD-6974ce8_3
(which means there will be a revision), so I think it does need to be added here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha, will push a fix shortly.