Skip to content

Commit

Permalink
fix(cli): remove deprecated --all option in favor of --get-all
Browse files Browse the repository at this point in the history
BREAKING CHANGE: The `--all` option is no longer available in the CLI. Use `--get-all` instead.
  • Loading branch information
nejch authored and JohnVillalovos committed Aug 20, 2023
1 parent d054917 commit e9d48cf
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/faq.rst
Expand Up @@ -42,7 +42,7 @@ Example::
Not all items are returned from the API
"""""""""""""""""""""""""""""""""""""""

If you've passed ``all=True`` (or ``--all`` via the CLI) to the API and still cannot see all items returned,
If you've passed ``all=True`` to the API and still cannot see all items returned,
use ``get_all=True`` (or ``--get-all`` via the CLI) instead. See :ref:`pagination` for more details.

Common errors
Expand Down
6 changes: 0 additions & 6 deletions gitlab/v4/cli.py
Expand Up @@ -236,12 +236,6 @@ def _populate_sub_parser_by_class(
action="store_true",
help="Return all items from the server, without pagination.",
)
sub_parser_action.add_argument(
"--all",
required=False,
action="store_true",
help="Deprecated. Use --get-all instead.",
)

if action_name == "delete":
if cls._id_attr is not None:
Expand Down
1 change: 1 addition & 0 deletions gitlab/v4/objects/commits.py
Expand Up @@ -155,6 +155,7 @@ class ProjectCommitManager(RetrieveMixin, CreateMixin, RESTManager):
optional=("author_email", "author_name"),
)
_list_filters = (
"all",
"ref_name",
"since",
"until",
Expand Down
10 changes: 9 additions & 1 deletion tests/functional/cli/test_cli_repository.py
Expand Up @@ -43,7 +43,15 @@ def test_list_all_commits(gitlab_cli, project):
assert commit.id not in ret.stdout

# Listing commits on other branches requires `all` parameter passed to the API
cmd = ["project-commit", "list", "--project-id", project.id, "--get-all", "--all"]
cmd = [
"project-commit",
"list",
"--project-id",
project.id,
"--get-all",
"--all",
"true",
]
ret_all = gitlab_cli(cmd)
assert commit.id in ret_all.stdout
assert len(ret_all.stdout) > len(ret.stdout)
Expand Down

0 comments on commit e9d48cf

Please sign in to comment.