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

[cmd] Add --anywhere-on-report-path flag to CLI #4255

Merged
merged 1 commit into from
Jun 7, 2024

Conversation

bruntib
Copy link
Contributor

@bruntib bruntib commented Jun 4, 2024

The "anywhere on report path" feature exists in the web GUI. This feature controls --component and --file filters in order to return reports of which the report path not only ends in, but goes through them.
In this commit this feature is added to the CLI, too.

@bruntib bruntib added enhancement 🌟 CLI 💻 Related to the command-line interface, such as the cmd, store, etc. commands labels Jun 4, 2024
@bruntib bruntib added this to the release 6.24.0 milestone Jun 4, 2024
@bruntib bruntib requested a review from cservakt June 4, 2024 23:19
@bruntib bruntib requested review from dkrupp and vodorok as code owners June 4, 2024 23:19
Comment on lines 475 to 478
report_filter.fileMatchesAnyPoint = args.anywhere_on_report_path
report_filter.componentMatchesAnyPoint = args.anywhere_on_report_path

Copy link
Collaborator

Choose a reason for hiding this comment

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

I am not sure it is the best way to complement the report filter. Would it be better to add a new if statement to the parse_report_filter_offline() function where we can check the existence of the anywhere_on_report_path argument? Should we validate if the --file or --component are given first?

Copy link
Contributor Author

@bruntib bruntib Jun 5, 2024

Choose a reason for hiding this comment

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

Personally, I'm not a fan of double checking all arguments like this: if 'flag' in args and args.flag: do_something(). I would say that the command line arguments should be preprocessed at the very beginning, possibly through argparse actions in the long terms. We shouldn't even check/parse/transform them in lower layers of the code.

Checking if --file or --component exists is a good idea. Perhaps a warning log would do?

@bruntib bruntib force-pushed the anywhere_in_cli branch 3 times, most recently from 09fc1e6 to f51a9ea Compare June 7, 2024 09:46
The "anywhere on report path" feature exists in the web GUI. This
feature controls --component and --file filters in order to return
reports of which the report path not only ends in, but goes through
them.
In this commit this feature is added to the CLI, too.
@bruntib bruntib force-pushed the anywhere_in_cli branch from f51a9ea to f3447b9 Compare June 7, 2024 10:06
Copy link
Collaborator

@cservakt cservakt left a comment

Choose a reason for hiding this comment

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

LGTM

@bruntib bruntib merged commit 686213a into Ericsson:master Jun 7, 2024
7 of 8 checks passed
@bruntib bruntib deleted the anywhere_in_cli branch June 7, 2024 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI 💻 Related to the command-line interface, such as the cmd, store, etc. commands enhancement 🌟
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants