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

In GitLab API, non-GET HTTP methods are not allowed for moved projects #1212

Open
PawelLipski opened this issue Apr 2, 2024 · 0 comments
Open
Labels
gitlab Relates to integration with GitLab minor An annoyance, but not serious usability Relates to user experience, clarity, learning curve, reducing confusion etc.

Comments

@PawelLipski
Copy link
Collaborator

For GitHub, POST/PATCH requests against a renamed repository end up in a 307 redirect, which isn't automatically followed by urllib. Such responses are then handled by extracting the new URL from Location header: see git_machete.github.GitHubClient.__fire_github_api_request.

For GitLab, such requests end up in a HTTP 405 (Method Not Allowed) response with {"message":"Non GET methods are not allowed for moved projects"} body. The new location can't be extracted from this response (no Location header returned); another GET /projects/... request is necessary.

This case is so rare that as for now (PR #1189, initial release of GitLab integration) we're not implementing it yet. We're just adding an error message in code that points to this exact issue. If you ever come it across, pls comment on this issue.

@PawelLipski PawelLipski added minor An annoyance, but not serious usability Relates to user experience, clarity, learning curve, reducing confusion etc. gitlab Relates to integration with GitLab labels Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gitlab Relates to integration with GitLab minor An annoyance, but not serious usability Relates to user experience, clarity, learning curve, reducing confusion etc.
Projects
None yet
Development

No branches or pull requests

1 participant