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

Validate VERSION will be parsable by semver at runtime #3479

Closed
tjtelan opened this issue Aug 22, 2023 · 3 comments
Closed

Validate VERSION will be parsable by semver at runtime #3479

tjtelan opened this issue Aug 22, 2023 · 3 comments
Assignees
Labels

Comments

@tjtelan
Copy link
Contributor

tjtelan commented Aug 22, 2023

Related: #2949

Due to how we include the platform version number in the CLI, if there is any leading/trailing whitespace, parsing for semver may fail. We handle this case inconsistently.

pub(crate) const VERSION: &str = include_str!("../../../VERSION");


fluvio version can handle whitespace

self.print("Fluvio CLI", crate::VERSION.trim());

But fluvio install/update (and many other places) do not include .trim()

Version::parse(crate::VERSION).expect("Fluvio CLI 'VERSION' should be a valid semver");

There is no known workaround after compilation, but VERSION requirements should also be less strict. We should support basic whitespace trimming and address the root issue.

And rather than handle case-by-case, we should validate that VERSION is valid during buildtime. But the CLI build should fail in cases when VERSION can't be parsed due to actual semver validity.

@tjtelan tjtelan added good first issue Good for newcomers CLI CI Installation DX/GENERAL Developer Experience General labels Aug 22, 2023
@jamrok
Copy link

jamrok commented Aug 22, 2023

Hey @tjtelan, I'd like to work on this. Can you assign it to me?

@tjtelan
Copy link
Contributor Author

tjtelan commented Aug 22, 2023

Hi @jamrok, thanks for the interest! Sure, I can assign to you

@github-actions
Copy link

Stale issue message

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants