-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Support annotated tags when using create release API #31840
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
Support annotated tags when using create release API #31840
Conversation
Currently we don't return the tag message in the response. We don't store the tag message in the
I looked to see what the other forges were doing, and it appears that GitLab doesn't expose a similar field in its API response. See here. |
How about reuse |
Done, though the problems I see with this is that:
Not sure if these are potential problems |
Looks like Github API doesn't support to create tag. |
A 500 status code was thrown when passing a non-existent target to the create release API. This snapshot handles this error and instead throws a 404 status code. Discovered while working on #31840.
A 500 status code was thrown when passing a non-existent target to the create release API. This snapshot handles this error and instead throws a 404 status code. Discovered while working on go-gitea#31840.
Backport #31841 by @kemzeb A 500 status code was thrown when passing a non-existent target to the create release API. This snapshot handles this error and instead throws a 404 status code. Discovered while working on #31840. Co-authored-by: Kemal Zebari <[email protected]>
I noticed in web router, the msg := ""
if len(form.Title) > 0 && form.AddTagMsg {
msg = form.Title + "\n\n" + form.Content
} Which has a different implementation between web and this API. |
I'm still not sure if its desirable to have both the tag message and the release description be the same. I also experimented with the GitHub API, and there really doesn't seem to be a way to create an annotated tag with this endpoint (even when specifying the This does look like it has been a sought after feature though. |
TBH, I think the initial approach is right (adds a new field, "tag_message", that represents the message of the annotated tag). The "Note" can't be reused, because the release note might be quite long, it is not the same as the tag's message. |
But that will create a non-compatible API with GH? Looks like GH doesn't have that field. |
Annotated tags can also be quite long(see our tags as an example). Looking at the GH API they are using "body", is that something we could use to ensure our API is similarly compliant? |
Do you mean that GitHub: "use body a release note" and "use body as tag message"? |
@kemzeb any conclusion? |
Looking back at this, I currently see the following approaches:
Not quite sure where we're leaning here but I'm open to other solutions |
I don't use these APIs, while at first glance, the
|
97feabd
to
f91fb9d
Compare
This adds a new field, "tag_message", that represents the message of the annotated tag.
f91fb9d
to
431366c
Compare
* giteaofficial/main: [skip ci] Updated translations via Crowdin Upgrade `gopls` to v0.19.0, add `make fix` (go-gitea#34772) Refactor packages (func name & UI) (go-gitea#34773) Fix remaining issues after `gopls modernize` formatting (go-gitea#34771) Fix some package registry problems (go-gitea#34759) Fix incorrect cli default values and default command (go-gitea#34765) Support annotated tags when using create release API (go-gitea#31840) when using rules to delete packages, remove unclean bugs (go-gitea#34632) Fix readme path and markdown link paste (go-gitea#34755)
This adds a new field, "tag_message", that represents the message of the annotated tag.
Resolves #31835.