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

Leapp CLI multiple filters broken #505

Open
Pat-Ayres opened this issue Dec 11, 2023 · 1 comment
Open

Leapp CLI multiple filters broken #505

Pat-Ayres opened this issue Dec 11, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@Pat-Ayres
Copy link

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:

  1. set up multiple leapp sessions with the same name and different roles
  2. try to list sessions using multiple filters
  3. 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 Pat-Ayres added the bug Something isn't working label Dec 11, 2023
@ericvilla
Copy link
Contributor

@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

@ericvilla ericvilla added enhancement New feature or request and removed bug Something isn't working labels Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants