Visitar URL original
Getting an error in filtering by path when listing commits · Issue #3100 · python-gitlab/python-gitlab · GitHub
Skip to content

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

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

Activity

  1. JohnVillalovos commented on Jan 24, 2025

    @JohnVillalovos
    Member

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

    Why all=True?

    Also which one of the three lines of your example has the error?

  2. locked and limited conversation to collaborators on Jan 24, 2025
  3. converted this issue into a discussion #3101 on Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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