-
Notifications
You must be signed in to change notification settings - Fork 28
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
[tech] Add a precise git_version to transit-model #754
Conversation
usefull for workflows depending directly of the git repository
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that I see this PR, I realize that it might just be doing something wrong. gtfs2ntfs --version
should output 1.1.0
, not the version of transit_model
. And ntfs2netexfr
should output 1.0.0
, not the version of transit_model
.
My point is that the output should probably be something like the following (output the version of the binary and of one of the main dependency).
gtfs2ntfs --version
v1.1.0 (transit_model: v0.34.0-3-g3f518f2-modified)
grumpf, thus this is quite more verbose 😜 but now: ❯ cargo build --all && ./target/debug/ntfs2netexfr --version
ntfs2netexfr 1.0.0 (transit_model = v0.34.0-3-g0847a0b-modified) I'm off next week, you can continue on this PR if you want (or we can wait one week) |
the ci seems not to have git at all steps, add a fallback
I don't know how to factorize it between binaries, if I put the function in the lib, I get the lib |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 elegant way to track versions (not sure about the final use of it for docker-packaged binaries though)
pub fn binary_full_version(binary_version: &str) -> String { | ||
format!("{} (transit_model = {})", binary_version, GIT_VERSION) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be able to track more than one deps (and reuse it in binaries using libs that depends on tm), should we already do something like:
pub fn binary_full_version(binary_version: &str) -> String { | |
format!("{} (transit_model = {})", binary_version, GIT_VERSION) | |
} | |
pub fn binary_full_version(binary_version: &str, other_deps_versions: &str) -> String { | |
format!("{} ({} transit_model = {})", binary_version, other_deps_versions, GIT_VERSION) | |
} |
The deps-separating ,
could be handled via an option on other_deps_versions
, or just asked-for into this other_deps_versions
(like this suggestion).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hum don't you think the other dependency will have it's own way of tracking the version? i don't really think it's the right place to put it but maybe we can talk about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, so the plan in binaries-that-depends-on-lib-depending-on-TM is to pass GIT_VERSION
of the lib-depending-on-TM into binary_version
(and forget about CARGO_PKG_VERSION
of binaries).
usefull for workflows depending directly of the git repository
seems to handle well the incremental compilation:
do_not_merge
is there because we want to use that PR to test our CI (internal webhooks), let's wait until 2021/03/25 max on that 🙏