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

Tag protection generates the wrong URL #156

Merged
merged 1 commit into from
Jul 17, 2019
Merged

Tag protection generates the wrong URL #156

merged 1 commit into from
Jul 17, 2019

Conversation

randomswdev
Copy link
Contributor

When protecting a tag containing a wildcard (like v*), the terraform plugin generates an invalid URL and thus fails to protect it.

For example, the Terraform log contains:
2019/06/24 12:28:39 [DEBUG] read gitlab tag protection for project 38, tag v*
2019/06/24 12:28:39 [DEBUG] GitLab API Request Details:
---[ REQUEST ]---------------------------------------
GET /api/v4/projects/38/protected_tags/v%252A HTTP/1.1
Host: 10.164.61.17
User-Agent: go-gitlab
Accept: application/json
Private-Token: nyPXE9zGT9aisyXvpWyG
Accept-Encoding: gzip

This is the REST call that checks if a protected tag has been correctly created, after the creation occurred. The URL is completely broken (it includes a double URL encoding). The GitLab server answers with a 404 return code.

Branches work correctly:
2019/06/24 12:28:39 [DEBUG] read gitlab branch protection for project 38, branch release-*
2019/06/24 12:28:39 [DEBUG] GitLab API Request Details:
---[ REQUEST ]---------------------------------------
GET /api/v4/projects/38/protected_branches/release-* HTTP/1.1
Host: 10.164.61.17
User-Agent: go-gitlab
Accept: application/json
Private-Token: nyPXE9zGT9aisyXvpWyG
Accept-Encoding: gzip

So I aligned the code for protecting tags to the used code for protecting branches, thus removing the URL encoding. I think this issue is now visible because of changes in pull request #130 that made the code fail when the server returns 404.

@ghost ghost added the size/S label Jun 24, 2019
@ghost ghost added size/M and removed size/S labels Jun 24, 2019
@randomswdev
Copy link
Contributor Author

Do you have any feedback about this pull request? Let me know if you think that something has ti be changed.

@roidelapluie roidelapluie merged commit 5eb5651 into gitlabhq:master Jul 17, 2019
@github-actions github-actions bot locked and limited conversation to collaborators Nov 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging this pull request may close these issues.

2 participants