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

Ensure user filter is applied to json and non-json list output #2

Merged
merged 5 commits into from
Oct 24, 2024

Conversation

nkpart
Copy link
Contributor

@nkpart nkpart commented Oct 24, 2024

I hit a bug where when running workstation list --json the filtering behaviour was different to the non-json version

  • non-json: output for current user
  • --json: output all workstations

I've made it consistent, and then refactored the code a little so we only loop once, filter once, and then either present it as json or the tree.

@gracevivi523
Copy link
Collaborator

gracevivi523 commented Oct 24, 2024

Thank you for the PR, makes sense to keep --json and non-json output consistent.

Also I think we shouldn't see everyone else workstation on the list unless the person who run the command has admin privilege to the gcp project, but this is not relevant to this PR.

I will stamp once you fix the tests.

Copy link
Collaborator

@gracevivi523 gracevivi523 left a comment

Choose a reason for hiding this comment

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

LGTM

@gracevivi523 gracevivi523 merged commit c4a618a into square:main Oct 24, 2024
5 checks passed
@nkpart nkpart deleted the nkpart.fix-list-json branch October 24, 2024 02:37
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