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

Incorrect api version is generated from "go get github.com/devfile/api/v2@main" command #599

Closed
kim-tsao opened this issue Aug 26, 2021 · 2 comments
Assignees
Labels
area/api Enhancement or issue related to the api/devfile specification kind/bug Something isn't working

Comments

@kim-tsao
Copy link
Contributor

/kind bug

Which area this bug is related to?

/area api

Bug Summary

Describe the bug:

When consumers pick up the latest api package that's under development, they typically run a go get command to update their go.mod file but the version that gets generated is v2.0.0-<timestamp of last commit>. This looks out of date because it implies changes to the v2.0.0 spec when v2.1.0 is our latest. This can cause confusion since the underlying code is actually the latest.

Expected behavior

We should ensure the version reflects the latest version that's under development

Additional context

v2.0.0 is being generated because the main branch does not have any tags (these are associated with our release branches), so go get generates a pseudo version that's based on the version specified in the module path (v2).

Any workaround?

Suggestion on how to fix the bug

Based on how pseudo-versions work, we may be able to correct this by adding pre-release tags to the api repo: https://golang.org/ref/mod#pseudo-versions

@openshift-ci openshift-ci bot added kind/bug Something isn't working area/api Enhancement or issue related to the api/devfile specification labels Aug 26, 2021
@kim-tsao kim-tsao self-assigned this Aug 26, 2021
@yangcao77
Copy link
Contributor

This issue affects pull in latest devfile/api to devfile/library. since library has dependency to registry-library, and registry-library currently uses devfile v2.2.0. when pull in devfile/api/v2@main, the version went back to 2.0.0-<timestamp>, and go will think it's a downgrade, and will remove the registry-library module.

$ go get github.com/devfile/api/v2@main
go: downgraded github.com/devfile/api/v2 v2.2.0 => v2.0.0-20230413012049-a6c32fca0dbd
go: removed github.com/devfile/registry-support/index/generator v0.0.0-20221018203505-df96d34d4273
go: removed github.com/devfile/registry-support/registry-library v0.0.0-20221018213054-47b3ffaeadba

I have created a pre-release tag:v2.2.1-alpha, and the versioning functions well now.

go get github.com/devfile/api/v2@a6c32fca0dbdcb61454e7bb7ff5b5ef525bbbe86
go: downloading github.com/devfile/api/v2 v2.2.1-alpha.0.20230413012049-a6c32fca0dbd
go: upgraded github.com/devfile/api/v2 v2.2.0 => v2.2.1-alpha.0.20230413012049-a6c32fca0dbd

we should continue this practice in future as well.

@kim-tsao
Copy link
Contributor Author

This issue affects pull in latest devfile/api to devfile/library. since library has dependency to registry-library, and registry-library currently uses devfile v2.2.0. when pull in devfile/api/v2@main, the version went back to 2.0.0-<timestamp>, and go will think it's a downgrade, and will remove the registry-library module.

$ go get github.com/devfile/api/v2@main
go: downgraded github.com/devfile/api/v2 v2.2.0 => v2.0.0-20230413012049-a6c32fca0dbd
go: removed github.com/devfile/registry-support/index/generator v0.0.0-20221018203505-df96d34d4273
go: removed github.com/devfile/registry-support/registry-library v0.0.0-20221018213054-47b3ffaeadba

I have created a pre-release tag:v2.2.1-alpha, and the versioning functions well now.

go get github.com/devfile/api/v2@a6c32fca0dbdcb61454e7bb7ff5b5ef525bbbe86
go: downloading github.com/devfile/api/v2 v2.2.1-alpha.0.20230413012049-a6c32fca0dbd
go: upgraded github.com/devfile/api/v2 v2.2.0 => v2.2.1-alpha.0.20230413012049-a6c32fca0dbd

we should continue this practice in future as well.

@yangcao77 thanks for confirming the use of pre-release tags. I'll get this added to our RELEASE notes and add a comment to our scripts

@johnmcollier johnmcollier moved this to To Do 📝 in Devfile Project Apr 20, 2023
@kim-tsao kim-tsao moved this from To Do 📝 to In Progress 🚧 in Devfile Project Apr 24, 2023
@kim-tsao kim-tsao moved this from In Progress 🚧 to To Do 📝 in Devfile Project Apr 24, 2023
@kim-tsao kim-tsao mentioned this issue Apr 24, 2023
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api Enhancement or issue related to the api/devfile specification kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants