docker: handle versions generated with git describe --tags --long
#3541
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.
In #3539 I noted that I wanted to be able to upgrade docker version tags formatted with
git describe --tags --long
. The format for this is<latest tag>-<number of commits since tag>-g<commit sha>
, meaning the first two parts are sortable and the last part should be ignored.The docker updater has special handling for commit shas, but it doesn't seem to be needed. To make my case work, I removed the line that filters out tags with commit shas:
reject { |tag| commit_sha_suffix?(tag) }
. Surprisingly, this didn't break any test cases. Please review this thoroughly!numeric_from_version()
discards commit shas before comparison, so it's safe to leave tags with commits shas in thecandidate_tags
set:In this PR, I've changed the
comparable_tags_from_registry
to select tags that look like a commit sha, since they will be discarded later bynumeric_from_version
. This adds support for upgrading from tags likev3.9.0-177-ged5bcde
tov3.10.0-169-gfe040d3
.Fixes #3539