Skip to content

API - releases.create kicking Gitlab 422 error. #2675

Description

@Firav

Description of the problem, including code/CLI snippet

I'm trying to create a release through the python library python-gitlab.
I keep getting an error of "gitlab.exceptions.GitlabHttpError: 422: Ref is not specified", however I'm passing tag_name, name, and description to the function (https://python-gitlab.readthedocs.io/en/latest/gl_objects/releases.html)
I've even tried using the example function listed on that page (project.releases.create({'name':'Demo Release', 'tag_name':'v1.2.3', 'description':'release notes go here'}))
From what I can gather from the GitLab API, the API is kicking back that I need to provide a ref, to which I dont understand because I'm passing tag_name?
https://docs.gitlab.com/ee/api/releases/index.html#create-a-release

Expected Behavior

Issuing the project.releases.create({'name':'Demo Release', 'tag_name':'v1.2.3', 'description':'release notes go here'}) API should create a release on the project object.

Actual Behavior

Issuing the function within API returns "gitlab.exceptions.GitlabHttpError: 422: Ref is not specified"

Specifications

  • python-gitlab version: v3.15.0 on python 3.8.9
  • API version you are using (v3/v4): v4
  • Gitlab server version (or gitlab.com): gitlab.com

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions