gitlab4j-api icon indicating copy to clipboard operation
gitlab4j-api copied to clipboard

Create tag with release notes crashes server

Open juliocbcotta opened this issue 4 years ago • 2 comments

When creating a new tag with a release note, I get

Caused by: org.gitlab4j.api.GitLabApiException: 500 Internal Server Error
	at org.gitlab4j.api.AbstractApi.validate(AbstractApi.java:633)
	at org.gitlab4j.api.AbstractApi.post(AbstractApi.java:286)
	at org.gitlab4j.api.TagsApi.createTag(TagsApi.java:239)

I looked at the implementation and the documentation for tag creation

the parameter release_description is not shown in the documentation and whenever I give it a non empty value I get that exception.

Would you have a workaround for this?

juliocbcotta avatar Jul 28 '21 08:07 juliocbcotta

One work around is to use the release api instead of the tag api. Specifically the Gitlab docs have the following information about tagging which would remove the need for 2 calls:

If a tag specified in tag_name doesn’t exist, the release is created from ref and tagged with tag_name. It can be a commit SHA, another tag name, or a branch name.

Url for this api on Gitlab's docs is https://docs.gitlab.com/ee/api/releases/#create-a-release and looks like it has been included in this library since at least 4.14.9

chrisrohr avatar Jul 29 '21 16:07 chrisrohr

Yeah, I am using the release method, but it took me a while to figure it out. So removing or at least deprecating that tag method seems like a good action from the library part.

juliocbcotta avatar Jul 29 '21 17:07 juliocbcotta