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

[release-tooling] Fix version regex. #2364

Merged
merged 1 commit into from
Feb 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub async fn subcommand_upgrade_runtime_crates_version(
let fs = Fs::Real;
let gradle_properties = read_gradle_properties(fs, &args.gradle_properties_path).await?;
let version_regex =
Regex::new(r"(?P<field>smithy\.rs\.runtime\.crate\.version=)(?P<version>\d+\.\d+\.\d+-.*)")
Regex::new(r"(?P<field>smithy\.rs\.runtime\.crate\.version=)(?P<version>\d+\.\d+\.\d+.*)")
Copy link
Contributor

Choose a reason for hiding this comment

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

I am wondering if we should be stricter here and just accept only -smithy-rs-head rather than everything after the version..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could, but fundamentally we never touch this file directly given the current automation, so I opted to keep the regex a bit simpler here.

Copy link
Contributor Author

@LukeMathWalker LukeMathWalker Feb 14, 2023

Choose a reason for hiding this comment

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

The alternative would be \d+\.\d+\.\d+(:?-smithy-rs-head){0,1}\s*$ if my regex-fu holds.

.unwrap();
let current_version = version_regex.captures(&gradle_properties).ok_or_else(|| {
anyhow!(
Expand Down