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.
This PR aligns semantic version handling in automatic updates to coreos/go-semver.
This started from a comment from @espadolini during a review, I postponed the refactoring until the MVP got out. This PR now addresses the tech debt I left.
Why not x/mod/semver?
x/mod/semver uses strings to carry versions. We have to always check that the version is normalized. This ended up in some functions taking versions with the leading "v" and some not. This causes significant cognitive overload each time we deal with version and increases the risk of using the wrong one. In autoupdate we were sometimes removing and adding back the leading "v" 4 times.
Teleport uses a mix of coreos/go-semver and x/mod/semver. I did not change the other semver usages but thing we should use coreos/go-semver more as it offer stronger typing and a more developer-friendly API.