-
Notifications
You must be signed in to change notification settings - Fork 337
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 version
in greptime_app_version
#4533
Comments
Maybe I can give it a try. |
@leaf-potato it's yours. Have fun. Feel free to ask if anything needs to be clarified. |
The version uses the greptimedb/src/common/version/src/lib.rs Lines 127 to 129 in 93be81c
Therefore, fix it by using commit id directly when the branch is empty. |
I'm confused with Can we just return pub const fn branch_and_short_commit() -> (&'static str, &'static str) {
(BUILD_INFO.branch, BUILD_INFO.commit_short)
} IMO,
|
Mabey it's a bug. When calling the greptimedb/src/cmd/src/flownode.rs Lines 218 to 220 in 2c3fccb
However, inside the function Lines 31 to 34 in 93be81c
Lines 79 to 86 in 93be81c
The simple solution is to swap the current assignment operation. |
@leaf-potato It's unusual that "branch" is empty. I was digging into the "shadow-rs"(that find the git info) one time, and suspect the incorrectness was origin from its usage of "git2". Maybe you can disable the "git2" feature and give it a try? |
Two version labels still confuse the user. The user has to understand(or we assume the user knows) the format of |
+1 |
@MichaelScofield Maybe not. Disabling git2 in shadow-rs also has the same problem: #before:
shadow-rs = "0.31"
#after:
shadow-rs = { version = "0.31", default-features = false}
You can reproduce the problem by following the steps below: git checkout HEAD^
git branch --show-current |
Got it! |
@leaf-potato If you do git checkout like that, it's in the "detached" mode, there's no branch. A walkaround might be |
You also need to filter out HEAD: |
@leaf-potato Wait...On second thought, do we really need the "branch" info? "commit id" is sufficient to uniquely locate the codes revision. The way to find branch in detached mode is kind of magic, you can try to fire an issue in shardow-rs. |
Hi, if this is not completed yet, can I give it a try? |
@raju130404 It's already resolved in #4572. |
What type of bug is this?
Other
What subsystems are affected?
Other
Minimal reproduce step
Access the
/metrics
endpoint when the DB is ready:The
version
should befe1cfbf2
, not-fe1cfbf2
.What did you expect to see?
We should get the correct version without the prefix
-
.What did you see instead?
Get the
version
with prefix-
.What operating system did you use?
Linux
What version of GreptimeDB did you use?
v0.9.1
Relevant log output and stack trace
No response
The text was updated successfully, but these errors were encountered: