-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Align semver libs #52795
base: master
Are you sure you want to change the base?
Align semver libs #52795
Conversation
ead34e4
to
d4b9b87
Compare
d4b9b87
to
e6f64be
Compare
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.
How many uses of x/mod/semver
are left? If it's not too many you could add it to depguard and add lint exceptions for the existing places where we still use it, to prevent it from spreading further.
About 10 or 15 files. I'll ask the file owners before if they are comfortable with this. |
cfc2b5d
to
5033505
Compare
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.