Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Validate existing ci yml seems to be not implemented #3260

@gridranger

Description

@gridranger

Description of the problem, including code/CLI snippet

It seems that existing config validation is not implemented (at least I haven't found it in the source code), but the documentation doesn't say it explicitly.

While this curl call works:

$ curl --header "Private-Token: ${MY_CI_TOKEN}" https://${MY_GITLAB_HOST}/api/v4/projects/${MY_PROJECT_ID}/ci/lint?content_ref=${MYREF}

This code doesn't:

from gitlab import Gitlab
g = Gitlab(my_gitlab_host, private_token=my_ci_token)
p = g.projects.get(my_project_id)
p.ci_lint.validate({"content_ref": myref})

Expected Behavior

If I pass only content_ref instead of content, the same GET would be called as in the curl above according to the GitLab documentation.

Actual Behavior

It executes new config validation as specified here, sends a POST call, then throws AttributeError: Missing attributes: content

Specifications

  • python-gitlab version: v6.3.0
  • Gitlab server version (or gitlab.com): v14.7.6

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