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

Submodules are not tagged correctly. #517

Open
HappyHacker123 opened this issue Sep 3, 2024 · 8 comments
Open

Submodules are not tagged correctly. #517

HappyHacker123 opened this issue Sep 3, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@HappyHacker123
Copy link

What version of GraphJin are you using? graphjin version

v3.0.1

Have you tried reproducing the issue with the latest release?

Yes.

Steps to reproduce the issue.

Run go get github.com/dosco/graphjin/core/v3 v3.0.31

Expected behaviour and actual result.

It seems that current graphjin has mutliple submodules with their own go.mod, for example, core and cmd.
However, it seems that the submodules are not properly tagged. According to Go Modules standard , submodule should be tagged like relative-path-to-root/vX.X.X.
At now, when trying to import package github.com/dosco/graphjin/core, downstream project would have to depend on pseudo-version of it and cannot get a valid tag version.

	github.com/dosco/graphjin/core/v3 v3.0.0-20240713020306-3fb8338c363e 

To address this, i think it's better to tag submodules properly according to Go standard, for example, releasing a tag `core/v3.0.31``, so that downstream project can use tag version to import the submodule in go.mod.

@HappyHacker123 HappyHacker123 added the bug Something isn't working label Sep 3, 2024
@HappyHacker123
Copy link
Author

Could you please take a look at this issue @dosco ? Many thanks :)

@dosco
Copy link
Owner

dosco commented Sep 5, 2024

i can't seem to get go to use go.work also where did you read that relative paths are allows they don't seem to be. I switched to using github.com/dosco/graphjin/core/v3 v3.0.31 in the various go.mod files but i get github.com/dosco/graphjin/core/v3: reading github.com/dosco/graphjin/core/go.mod at revision core/v3.0.31: unknown revision core/v3.0.31

@dosco
Copy link
Owner

dosco commented Sep 6, 2024

i tried some ideas to fix the issue even upgraded a ton of packages and go versions but not luck

/tmp/test > go get github.com/dosco/graphjin/core/v3
go: added github.com/dosco/graphjin/core/v3 v3.0.0-20240906013641-429f6f3f68d1
go: added github.com/hashicorp/golang-lru v0.5.4
go: added golang.org/x/sync v0.8.0
/tmp/test > go get github.com/dosco/graphjin/core/[email protected]
go: downloading github.com/dosco/graphjin v3.0.33+incompatible
go: module github.com/dosco/[email protected] found (v3.0.33+incompatible), but does not contain package github.com/dosco/graphjin/core/v3

@dosco
Copy link
Owner

dosco commented Sep 6, 2024

wonder if we need to restructure the repo to make this work?

@HappyHacker123
Copy link
Author

HappyHacker123 commented Sep 6, 2024

@dosco Thanks so much for your response! Sorry for the late reply.

i can't seem to get go to use go.work also where did you read that relative paths are allows they don't seem to be. I switched to using github.com/dosco/graphjin/core/v3 v3.0.31 in the various go.mod files but i get github.com/dosco/graphjin/core/v3: reading github.com/dosco/graphjin/core/go.mod at revision core/v3.0.31: unknown revision core/v3.0.31

The problem lies in you haven't released a tag version for github.com/dosco/graphjin/core. Since core has its own go.mod file, it requires its own version tag. Currently, the existing versions apply to dosco/graphjin, but not specifically to dosco/graphjin/core/. So the v3.0.31 tag released now is for github.com/dosco/graphjin not for github.com/dosco/graphjin/core .

wonder if we need to restructure the repo to make this work?

There's no need to alter the project structure; you just need to release a tag for core, such as core/v3.0.31. This will allow Go Modules to recognize the version as belonging to core.

@HappyHacker123
Copy link
Author

You can refer to this link

@dosco
Copy link
Owner

dosco commented Sep 6, 2024

thanks spent hours did not find this doc. i'll try this so will release a /vVersion tag per package. i ended up removing go.work and switched to using replace will go back and try using go.work

@HappyHacker123
Copy link
Author

Thanks for your effort!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants