pulp / pulp-cli

https://docs.pulpproject.org/pulp_cli/
GNU General Public License v2.0
36 stars 42 forks source link

Not all x entries were shown. #1068

Closed vkukk closed 2 months ago

vkukk commented 2 months ago

Summary

Each time listing something with pulp cli, it displays message: Not all x entries were shown. where x is integer count of listed items.

For example:

pulp --config secret/cli.toml rpm remote list --name mongo-6|jq -r '.[0]
.url'
Not all 1 entries were shown.
https://repo.mongodb.org/yum/redhat/9/mongodb-org/6.0/x86_64/

It lists all correctly.

Steps to reproduce

Any listing with pulp cli causes this message to be displayed.

pulp --config secret/cli.toml rpm publication list
Not all 5 entries were shown.

Actually it lists all 5 entries.

Expected behavior

No warning/error message about listing is displayed.

Stacktrace/Error log

Pulp and pulp-cli version info

$ pulp --version Pulp3 Command Line Interface, Version 0.28.3 Plugin Versions: common: 0.28.3 Pulp version is latest installed officially by pulp-operator.

vkukk commented 2 months ago

pulp cli 0.28.4 still has the issue For example:

$ pulp --config secret/cli.toml publication list --repository-version /pulp/api/v3/repositories/rpm/rpm/0191fab8-4960-7609-a12f-747441e36f69/versions/1/ --ordering '-pulp_created' --limit 1 --field repository_version
Not all 7 entries were shown.
[
  {
    "repository_version": "/pulp/api/v3/repositories/rpm/rpm/0191fab8-4960-7609-a12f-747441e36f69/versions/1/"
  }
]
mdellweg commented 2 months ago

pulp cli 0.28.4 still has the issue For example:

$ pulp --config secret/cli.toml publication list --repository-version /pulp/api/v3/repositories/rpm/rpm/0191fab8-4960-7609-a12f-747441e36f69/versions/1/ --ordering '-pulp_created' --limit 1 --field repository_version
Not all 7 entries were shown.
[
  {
    "repository_version": "/pulp/api/v3/repositories/rpm/rpm/0191fab8-4960-7609-a12f-747441e36f69/versions/1/"
  }
]

Well now it's correct, because 7 are there and you limit to show one.

vkukk commented 2 months ago

Indeed, you are right.

I find this announcement very annoying and haven't found pulp cli option to silence it.

I'm using pulp cli in shell script and I'm well able to count how many items were returned. No need to print such message without enabling verbose option. When I'm applying some filter, I'm expecting to get a subset of all items.

mdellweg commented 2 months ago

It's separated from the normal output by being pushed to stderr. So a simple 2>/dev/null may help you there.

vkukk commented 2 months ago

It's separated from the normal output by being pushed to stderr. So a simple 2>/dev/null may help you there.

That would supress all the stderr that is not desirable.

mdellweg commented 2 months ago

Thanks for the input I will consider other possibilities. (hooking a grep only on stderr is probably a very bad advice...)