Leapp CLI multiple filters broken
Describe the bug
Using multiple filters with Leapp CLI commands e.g. leapp session list --filter="Foo=Foo" --filter="Bar=Bar"... should apply all filters to the search. This does not work on the latest version of the cli for me. Instead it only uses the query of the final --filter param.
In my case, we have the AWS SSO Integration turned on which creates sessions with non-unique names if you have mutliple sso roles for an AWS account. In order to pick the correct session, I have tried filtering on the session name and role in combination. However, instead of using both filters, it only uses the last filter and I get either all of the Sessions with the shared session name or all of the sessions using the same Role name depending on how I order the filters.
leapp session list --filter="Session Name=example" --filter="Role=reader"
Leapp Version
@noovolari/leapp-cli/0.1.49 darwin-arm64 node-v20.9.0
To Reproduce Steps to reproduce the behavior:
- set up multiple leapp sessions with the same name and different roles
- try to list sessions using multiple filters
- observe multiple results are returned based only on the final filter
Expected behavior Based on this comment I expected that using multiple filters in this way would apply all filters and correctly return only a single session, given enough filters to provide a unique query.
Desktop (please complete the following information):
- OS: MacOS
- OS Version 13.6
- Leapp Version 0.22.2
@Pat-Ayres thanks for reporting! We haven't conceived the --filter flag to accept multiple criteria, thus you can filter a single property per command. Therefore, this issue should be considered as an enhancement, as the --filter flag works as expected with a single criteria. To make the CLI accept multiple filter criteria, we should intervene at the Oclif level, in particular when the flag parsing logic happens