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

Issue-3479: Refactor: Fetch Platform Version #3485

Closed

Conversation

jamrok
Copy link

@jamrok jamrok commented Aug 23, 2023

Hey @tjtelan,

I added a common library (fluvio-common) to parse the VERSION file and made all relevant crates refer to it. I saw that there was fluvio-cli-common, but It seemed more specific to fluvio-cli versus being a light dependency that can be used by all.

Please let me know if there's another place that you recommend that the change be made.

Thanks


Resolves #3479

@jamrok jamrok force-pushed the issue-3479-refactor-platform-version branch from 9f18d0d to 0406871 Compare August 23, 2023 13:12
@tjtelan
Copy link
Contributor

tjtelan commented Aug 23, 2023

@jamrok Thanks for the quick turnaround!

I think there are 2 points of feedback:

  1. Your implementation looks good, however not quite the direction I had in mind. The desired outcome is that compilation should be prevented upon discovering errors with parsing VERSION, instead of allowing the condition to be found in runtime. I think validation of VERSION should be implemented within a build.rs build script, in a similar fashion to how we include the current git sha of builds.

  2. FLUVIO_PLATFORM_VERSION should live in the fluvio-types crate for the purposes of sharing with other crates

@jamrok jamrok force-pushed the issue-3479-refactor-platform-version branch from 0406871 to fe52f61 Compare August 23, 2023 20:49
@jamrok
Copy link
Author

jamrok commented Aug 23, 2023

Thanks for the feedback @tjtelan!

  1. Updated as requested. Please also confirm that the build.rs for fluvio-test-util is done as expected.
    • I moved the compile time check for the optional FLUVIO_VERSION_SUFFIX env var to build.rs and set a different ENV variable (FLUVIO_PLATFORM_TEST_VERSION) so it doesn't conflict with the FLUVIO_PLATFORM_VERSION variable.
  2. Updated as requested. I originally had FLUVIO_PLATFORM_VERSION in fluvio-types, but then moved it because fluvio-types was published and I was thinking that "types" didn't seem like the right place to put it.
    • Are there any implications with it being published?
    • Should it be placed in fluvio_types::defaults and exported at the crate level (fluvio_types::FLUVIO_PLATFORM_VERSION), or placed somewhere else?

Please let me know if you have any other suggestions.

Thanks

@jamrok jamrok force-pushed the issue-3479-refactor-platform-version branch from fe52f61 to 3d0961c Compare October 3, 2023 23:09
@jamrok jamrok force-pushed the issue-3479-refactor-platform-version branch from 3d0961c to c6174c5 Compare October 4, 2023 13:38
@jamrok
Copy link
Author

jamrok commented Oct 4, 2023

Hey @tjtelan, just checking on this. I had a couple questions in my last comment.

I also rebased and resolved the merge conflicts.

println!("cargo:rerun-if-changed=build.rs");

// Parse the Fluvio Platform Version
let version = include_str!("../../VERSION").trim();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why parsing this again? This won't work since it is public crate

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is my bad. At the time of my feedback I didn't consider that this was a public crate

Copy link

github-actions bot commented Dec 4, 2023

Stale pull request message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validate VERSION will be parsable by semver at runtime
3 participants