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

Align gomod major version with project major version #734

Merged
merged 11 commits into from
Apr 6, 2024
Merged

Conversation

stgraber
Copy link
Member

@stgraber stgraber commented Apr 5, 2024

This is unfortunately needed because gomod has a very odd behavior when it comes to semver tags. It essentially expects that a major version bump in semver also requires a completely different Go import path.

While this may make sense in projects that are solely a self-contained Go package and where a major version bump indicates an API break of that Go package. It's a lot weirder when dealing with a much more complex project like Incus where our external facing Go API is just a small part of the whole thing and a major version bump of the project may not mean an API break for the users of the Go package.

This is made extra annoying by Go special casing the 0 and 1 major releases as not needing this kind of import name changes, causing the whole thing to break when you exceed that.

For us the consequence was that anyone using @latest was still getting Incus 0.7 rather than 6.0.0. With this change, it should now cause import errors for most people, requiring them to update to github.com/lxc/incus/v6/client to get things working again.

This is annoying and really unneeded but that's how Gomod works...

Signed-off-by: Stéphane Graber <[email protected]>
All its dependencies were already indirect dependencies of Incus itself.
So this will not change anything for users/packagers.

Signed-off-by: Stéphane Graber <[email protected]>
Signed-off-by: Stéphane Graber <[email protected]>
This is a rather annoying Go behavior where even though there is no API
breakage at the Go API level, a major version change at the project
level also requires a Go mod major change.

The impact here is that anyone importing our package will now have to
switch to import /v6 even though there is no Go API breakage for them to
handle...

Signed-off-by: Stéphane Graber <[email protected]>
Signed-off-by: Stéphane Graber <[email protected]>
Signed-off-by: Stéphane Graber <[email protected]>
Signed-off-by: Stéphane Graber <[email protected]>
@github-actions github-actions bot added the API Changes to the REST API label Apr 5, 2024
@github-actions github-actions bot added the Documentation Documentation needs updating label Apr 6, 2024
@tych0 tych0 merged commit ae41ae8 into lxc:main Apr 6, 2024
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Changes to the REST API Documentation Documentation needs updating
Development

Successfully merging this pull request may close these issues.

2 participants