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

Missing vX.Y.Z tags cause wrong version report #1688

Open
krouma opened this issue Feb 19, 2024 · 10 comments
Open

Missing vX.Y.Z tags cause wrong version report #1688

krouma opened this issue Feb 19, 2024 · 10 comments
Labels
lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness.

Comments

@krouma
Copy link

krouma commented Feb 19, 2024

Hi, I successfully built the oc tool from source, but when I run oc version it reports Client Version: v4.2.0-alpha.0-1997-g0c63f9d. However, I am at the tag openshift-clients-4.14.0-202310201027.

I looked for the cause and found that during make oc, the command git describe --long --tags --abbrev=7 --match 'v[0-9]*' || echo 'v0.0.0-unknown-$(SOURCE_GIT_COMMIT)' is run. It looks for the latest tag in v<version> format. However, the last tag, that satisfies this format, is v4.2.0-alpha.0.

I know I can get around this by setting SOURCE_GIT_TAG or OS_GIT_VERSION to v4.14.0, but for me the correct solution seems to be adding appropriate tags to make the auto-detection work.

@codespearhead
Copy link

I noticed that problem in a series of issues in the OKD repository, but I'm not familiar with tags, so I'm unable to properly troubleshoot what commit introduced this bug.

Are you @krouma ?

@krouma
Copy link
Author

krouma commented Apr 10, 2024

This is not a problem of the code, so there's no commit to pinpoint. The tags probably exist only in private repos and are not synchronized here.

@codespearhead
Copy link

Do you mean these tags?

@krouma
Copy link
Author

krouma commented Apr 10, 2024

Yes, but those that are present have wrong format.

@codespearhead
Copy link

codespearhead commented Apr 10, 2024

Then will this solve the issue?

-SOURCE_GIT_TAG ?=$(shell git describe --long --tags --abbrev=7 --match 'v[0-9]*' || echo 'v0.0.0-unknown-$(SOURCE_GIT_COMMIT)')
+SOURCE_GIT_TAG ?=$(shell git describe --long --tags --abbrev=7 --match 'openshift-clients-*' | sed 's/openshift-clients-/v/g' || echo 'v0.0.0-unknown-$(SOURCE_GIT_COMMIT)')

# Input: openshift-clients-4.15.0-202402082307
# Output: v4.15.0-202402082307

@krouma
Copy link
Author

krouma commented Apr 10, 2024

I guess it would

codespearhead added a commit to codespearhead/oc that referenced this issue Apr 10, 2024
Update `SOURCE_GIT_TAG` parsing logic to correctly identify the new tag format: `openshift-clients-<version>`. It fixes openshift#1688, openshift#744, openshift#740. Previously, it incorrectly returned `v4.2.0-alpha.0` for all releases.
codespearhead added a commit to codespearhead/oc that referenced this issue Apr 10, 2024
Update `SOURCE_GIT_TAG` parsing logic to correctly identify the new tag format: `openshift-clients-<version>`. It fixes openshift#1688, openshift#744, openshift#740. Previously, it incorrectly returned `v4.2.0-alpha.0` for all releases.
codespearhead added a commit to codespearhead/oc that referenced this issue Apr 10, 2024
Update `SOURCE_GIT_TAG` parsing logic to correctly identify the new tag format: `openshift-clients-<version>`. It fixes openshift#1688, openshift#744, openshift#740. Previously, it incorrectly returned `v4.2.0-alpha.0` for all releases.
@codespearhead
Copy link

I've just created a PR.

Do you have the bandwidth to check if that branch fixes this problem? I'm confused as to how to build it from source to do so myself.

If so, a PR review will be appreciated.

@Bengrunt
Copy link

Thank you so much for taking a look at this @codespearhead 👍

codespearhead added a commit to codespearhead/oc that referenced this issue May 3, 2024
Update `SOURCE_GIT_TAG` parsing logic to correctly identify the new tag format: `openshift-clients-<version>`. It fixes openshift#1688, openshift#744, openshift#740. Previously, it incorrectly returned `v4.2.0-alpha.0` for all releases.
@openshift-bot
Copy link
Contributor

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci openshift-ci bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 10, 2024
@codespearhead
Copy link

/lifecycle frozen

@openshift-ci openshift-ci bot added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants