Skip to content

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

@PawelLipski

Description

@PawelLipski

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    gitlabRelates to integration with GitLabminorAn annoyance, but not serioususabilityRelates to user experience, clarity, learning curve, reducing confusion etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions