Skip to content

Conversation

@janaknat
Copy link
Contributor

There is a bug in the report generation if the user collected record data with a run name containing .. In such cases, the report generator, since it was using file_stem(), would incorrectly create the report directory and tarball with different names.

To prevent this, use file_name() and a check to remove '.tar.gz' suffix. Also, move to using file_name() instead of file_stem() wherever needed.

2dots.in.name.tar.gz

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@janaknat janaknat requested a review from a team as a code owner February 17, 2025 19:05
Comment on lines 49 to 53
let mut file_name = pbuf.file_name().unwrap().to_str().unwrap().to_string();
if file_name.ends_with(".tar.gz") {
file_name = file_name.strip_suffix(".tar.gz").unwrap().to_string();
}
Ok(file_name)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't this delegate to notargz_string_name here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. Will change it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to include an integration test. We don't want this to break.

There is a bug in the report generation if the user collected record
data with a run name containing '.'. In such cases, the report
generator, since it was using file_stem(), would incorrectly create the
report directory and tarball with different names.

To prevent this, use file_name() and a check to remove '.tar.gz' suffix.
Also, move to using file_name() instead of file_stem() wherever needed.

Add an integration test to check with a run name containing a '.'.
@janaknat janaknat merged commit 8374a62 into aws:main Feb 18, 2025
6 checks passed
@janaknat janaknat deleted the dotfix branch February 27, 2025 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants