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

Fix empty filename case #204

Merged
merged 3 commits into from
Mar 10, 2024
Merged

Conversation

PaDarochek
Copy link
Member

No description provided.

Copy link

codecov bot commented Mar 6, 2024

Codecov Report

Attention: Patch coverage is 71.42857% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 62.36%. Comparing base (c2ce4c8) to head (f1c99b8).

❗ Current head f1c99b8 differs from pull request most recent head 6a706c8. Consider uploading reports for the commit 6a706c8 to get more accurate results

Files Patch % Lines
casr/src/bin/casr-cli.rs 71.42% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #204      +/-   ##
==========================================
- Coverage   62.37%   62.36%   -0.02%     
==========================================
  Files          32       32              
  Lines        5292     5301       +9     
==========================================
+ Hits         3301     3306       +5     
- Misses       1991     1995       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

let filename = if let Some(cl_filename) = cluster.file_name() {
cl_filename.to_str().unwrap()
} else {
cluster.to_str().unwrap()
Copy link
Collaborator

@SweetVishnya SweetVishnya Mar 6, 2024

Choose a reason for hiding this comment

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

why should we use full path here?

Copy link
Member Author

Choose a reason for hiding this comment

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

If the filename is empty it means that it ends with '.' or is '/' and we couldn't canonicalize it. Then we have no other options besides using this path as is.

Copy link
Collaborator

Choose a reason for hiding this comment

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

If the filename is empty it means that it ends with '.' or is '/' and we couldn't canonicalize it. Then we have no other options besides using this path as is.

Could you provide some use cases, when and why this situation happens?
It seems to me, that this code filter directories.

Copy link
Member Author

@PaDarochek PaDarochek Mar 7, 2024

Choose a reason for hiding this comment

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

The case is when casr-cli is called with an argument of directory name, and that directory contains raw casreps. For example, if casreps are located in root directory (a poked-out case, but still), or in cwd '.' and we couldn't canonicalize it for some reason. The bug was detected when calling casr-cli on cwd with raw reports.
This code adds directory to clusters if it contains raw reports.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we add a comment in code stating this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

Copy link
Collaborator

@SweetVishnya SweetVishnya left a comment

Choose a reason for hiding this comment

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

Just needs some comments and ready to merge

@SweetVishnya SweetVishnya merged commit 932e96a into ispras:master Mar 10, 2024
8 checks passed
@PaDarochek PaDarochek deleted the fix-casr-cli branch March 10, 2024 10:48
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.

5 participants