Skip to content

fix(cli): generate UserWarning if list does not return all entries#2901

Merged
nejch merged 3 commits into
mainfrom
jlvillal/cli_warn
Jul 4, 2024
Merged

fix(cli): generate UserWarning if list does not return all entries#2901
nejch merged 3 commits into
mainfrom
jlvillal/cli_warn

Conversation

@JohnVillalovos

Copy link
Copy Markdown
Member

Previously in the CLI, calls to list() would have get_all=False by
default. Therefore hiding the fact that not all items are being
returned if there were more than 20 items.

Added --no-get-all option to list actions. Along with the already
existing --get-all.

Closes: #2900

@JohnVillalovos JohnVillalovos requested a review from nejch June 22, 2024 00:49
@JohnVillalovos JohnVillalovos force-pushed the jlvillal/cli_warn branch 3 times, most recently from 05c0c70 to 09b9205 Compare July 1, 2024 16:05

@nejch nejch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

THanks a lot @JohnVillalovos, I've been thinking about this one for a bit because we reintroduce more CLI logic into the API client, and I wonder if there's a more generic way. Just a tiny idea below 🙇

Comment thread gitlab/client.py Outdated
This allows us to not add the caller's location to the UserWarning
message.
Previously in the CLI, calls to `list()` would have `get_all=False` by
default. Therefore hiding the fact that not all items are being
returned if there were more than 20 items.

Added `--no-get-all` option to `list` actions. Along with the already
existing `--get-all`.

Closes: #2900
@JohnVillalovos

Copy link
Copy Markdown
Member Author

THanks a lot @JohnVillalovos, I've been thinking about this one for a bit because we reintroduce more CLI logic into the API client, and I wonder if there's a more generic way. Just a tiny idea below 🙇

@nejch thanks for the review. I have updated it to pass in a WarnMessageData object. So I think it will do what you want.

@JohnVillalovos JohnVillalovos requested a review from nejch July 3, 2024 23:51
@nejch nejch merged commit e5a4379 into main Jul 4, 2024
@nejch nejch deleted the jlvillal/cli_warn branch July 4, 2024 08:53
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.

CLI: For list actions the CLI defaults to get_all=False

2 participants