Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
JonathonReinhart opened this issue May 28, 2020 · 1 comment
Open

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

JonathonReinhart opened this issue May 28, 2020 · 1 comment

Comments

@JonathonReinhart
Copy link
Collaborator

@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.

@JonathonReinhart
Copy link
Collaborator Author

JonathonReinhart commented May 28, 2020

Actually, there appears to be a bug in GitLab!

If you push a branch that has the same name as an existing tag, then GitLab will run a pipeline for the correct commit, but incorrectly thinks the pipeline is for "a tag" (the tag attribute on the returned pipeline object is true).

Even more confusing, scope='tags' returns an incorrect list in this case.

I opened this issue with gitlab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant