You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've spent a good amount of time recently trying to debug issues in goreleaser which uses go-gitlab. What I've found is that error messages go-gitlab returns include URLs which are not the URL that is being invoked. The URL is being unescaped when it shouldn't in go-gitlab's error handling code. This makes debugging difficult as it's sent me down the wrong path multiple times because the calls aren't valid.
Here's a test I'm using. The referenced repos are private and not available to anyone outside our organization. The fileName is an invalid path.
The actual URL invoked is https://gitlab.com/api/v4/projects/shipium-corp%2Fengineering%2Fhomebrew-shipium/repository/files/Formula%2Finvalid%2Er. The issue is the URL unescaping performed by the error handling code when building the error message. The repository name and the file name must be URL encoded to be valid when invoking gitlab's REST API.
There is still a remaining issue in that the query params are not appended. I haven't tackled that yet but I assume the solution is on the same path as what I included above.
The text was updated successfully, but these errors were encountered:
I've spent a good amount of time recently trying to debug issues in goreleaser which uses go-gitlab. What I've found is that error messages go-gitlab returns include URLs which are not the URL that is being invoked. The URL is being unescaped when it shouldn't in go-gitlab's error handling code. This makes debugging difficult as it's sent me down the wrong path multiple times because the calls aren't valid.
Here's a test I'm using. The referenced repos are private and not available to anyone outside our organization. The fileName is an invalid path.
The error that is printed is:
The actual URL invoked is
https://gitlab.com/api/v4/projects/shipium-corp%2Fengineering%2Fhomebrew-shipium/repository/files/Formula%2Finvalid%2Er
. The issue is the URL unescaping performed by the error handling code when building the error message. The repository name and the file name must be URL encoded to be valid when invoking gitlab's REST API.The problematic line is the following at
go-gitlab/gitlab.go
Line 953 in 8f2dbc2
I believe this should be the following instead:
With this update, the error include the appropriate URL in the error message.
There is still a remaining issue in that the query params are not appended. I haven't tackled that yet but I assume the solution is on the same path as what I included above.
The text was updated successfully, but these errors were encountered: