From e9d48cf69e0dbe93f917e6f593d31327cd99f917 Mon Sep 17 00:00:00 2001 From: Nejc Habjan Date: Sun, 20 Aug 2023 09:12:33 +0200 Subject: [PATCH] fix(cli): remove deprecated `--all` option in favor of `--get-all` BREAKING CHANGE: The `--all` option is no longer available in the CLI. Use `--get-all` instead. --- docs/faq.rst | 2 +- gitlab/v4/cli.py | 6 ------ gitlab/v4/objects/commits.py | 1 + tests/functional/cli/test_cli_repository.py | 10 +++++++++- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/docs/faq.rst b/docs/faq.rst index cd4734aff..b9ab3bc83 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -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 diff --git a/gitlab/v4/cli.py b/gitlab/v4/cli.py index dbf0eb01c..128bd5bd0 100644 --- a/gitlab/v4/cli.py +++ b/gitlab/v4/cli.py @@ -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: diff --git a/gitlab/v4/objects/commits.py b/gitlab/v4/objects/commits.py index 8558ef9ea..bdabf46d7 100644 --- a/gitlab/v4/objects/commits.py +++ b/gitlab/v4/objects/commits.py @@ -155,6 +155,7 @@ class ProjectCommitManager(RetrieveMixin, CreateMixin, RESTManager): optional=("author_email", "author_name"), ) _list_filters = ( + "all", "ref_name", "since", "until", diff --git a/tests/functional/cli/test_cli_repository.py b/tests/functional/cli/test_cli_repository.py index c8d1b7db1..2726d34ec 100644 --- a/tests/functional/cli/test_cli_repository.py +++ b/tests/functional/cli/test_cli_repository.py @@ -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)