RFR: 1186: Backport command stopped working on Gitlab

Kevin Rushforth kcr at openjdk.java.net
Tue Oct 5 17:56:46 UTC 2021

On Tue, 5 Oct 2021 11:19:05 GMT, Magnus Ihse Bursie <ihse at openjdk.org> wrote:

> Our POST request to `<api-entry>/members` to add collaborators fails with status code 415 (Unsupported Media Type) on recent versions of Gitlab.
> This is the only place in our Gitlab code where we do not send REST parameters as json, but as `&`-concatted raw data. I can't find any indication in the Gitlab API documentation that this is no longer supported, but otoh there is no reason to continue handling this method different from all other REST calls.
> So I am fairly certain that this patch solves the problem (which makes sure we use json parameters here as everywhere else). However, I have not been able to test this. We have no tests that run on live instances of Gitlab, and the adhoc testing setup that I have used to not have a repo where backports are enabled (and I'm also a bit uncertain on how to properly configure that).
> I believe the patch is likely to be low risk to accept it nevertheless, but I'd like input from Kevin or Erik on this assessment.

This looks fine to me.

forge/src/main/java/org/openjdk/skara/forge/gitlab/GitLabRepository.java line 584:

> 582:         request.post("members")
> 583:                 .body("user_id", user.id())
> 584:                 .body("access_level", accessLevel)

Minor: indentation looks off by 1.


Marked as reviewed by kcr (Reviewer).

PR: https://git.openjdk.java.net/skara/pull/1229

More information about the skara-dev mailing list