Skip to content

Getting an error in filtering by path when listing commits #3100

@ahmetdd

Description

@ahmetdd

Description of the problem, including code/CLI snippet

I want to get a commit list according to a specific folder in a branch, but I can't do this with the python module and I get an error.
This is provided by rest api but python module gets error with same parameters.
I run these commands respectively.

gitlab_api = Gitlab(url=args.gitlab_url, private_token=args.gitlab_token)

gitlab_project = gitlab_api.projects.get(id=args.gitlab_project_id, all=True)

gitlab_project.commits.list(ref_name='main', path='deployemnt/v1.31')

when I run Rest API I get results and no errors,

/api/v4/projects/4021212/repository/commits?ref_name=main&path=deployemnt/v1.31

Expected Behavior

Image

Actual Behavior

Details

gitlab.exceptions.GitlabHttpError: 404: 404 API Version Not Found

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "c:\Users\y79988\AppData\Local\pypoetry\Cache\virtualenvs\project-mLexHskk-py3.10\lib\site-packages\gitlab\exceptions.py", line 346, in wrapped_f
    raise error(e.error_message, e.response_code, e.response_body) from e
gitlab.exceptions.GitlabListError: **404: 404 API Version Not Found**

## Specifications
  • python-gitlab version: "5.0.0"
  • Gitlab server version (or gitlab.com):v17.7.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions