Skip to content

Ambiguity if a branch and tag have the same name #17

Description

@JonathonReinhart

@xanarin pointed out that Git allows a tag and a branch to have the same name. So the fix in #16 introduces a potential ambiguity, by no longer allowing tags/v1.2.3.

The problem is that the GitLab list project pipelines API just says ref, and I've proven that you cannot pass tags/foo:

>>> p.pipelines.list(ref='v8.4.8-1')
[<ProjectPipeline id:20692>, <ProjectPipeline id:20685>, <ProjectPipeline id:20639>, <ProjectPipeline id:20638>, <ProjectPipeline id:20478>]
>>> p.pipelines.list(ref='tags/v8.4.8-1')
[]

The API does however provide scope:

Attribute Type Required Description
scope string no The scope of pipelines, one of: running, pending, finished, branches, tags

So perhaps we could look at the ref to see if tags/ is present, and if so, strip it, and then pass scope=tags.

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions