[API] Add an delete tag option to DELETE releases #6067

Closed
opened 2025-11-02 06:44:10 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @sigma-frossignol on GitHub (Sep 29, 2020).

When the release is deleted via the web interface the tag is deleted
When the release is deleted via the API the tag is not deleted

The DeleteReleaseByID function already has an argument to either delete or not the tag.

that argument is set to true when called from the web interface
3878e985b6/routers/repo/release.go (L353)

and to false when called from the API
3878e985b6/routers/api/v1/repo/release.go (L333)

that'd be nice we could decide wether or not we want to delete the tag whith the API call

Thanks in advance

Originally created by @sigma-frossignol on GitHub (Sep 29, 2020). When the release is deleted via the web interface the tag is deleted When the release is deleted via the API the tag is not deleted The DeleteReleaseByID function already has an argument to either delete or not the tag. that argument is set to true when called from the web interface https://github.com/go-gitea/gitea/blob/3878e985b66cc6d4cb4d2b0e7406d5cf91af6191/routers/repo/release.go#L353 and to false when called from the API https://github.com/go-gitea/gitea/blob/3878e985b66cc6d4cb4d2b0e7406d5cf91af6191/routers/api/v1/repo/release.go#L333 that'd be nice we could decide wether or not we want to delete the tag whith the API call Thanks in advance
GiteaMirror added the type/enhancementmodifies/api labels 2025-11-02 06:44:10 -06:00
Author
Owner

@6543 commented on GitHub (Sep 29, 2020):

related to #12913

@6543 commented on GitHub (Sep 29, 2020): related to #12913
Author
Owner

@6543 commented on GitHub (Sep 30, 2020):

I think this can be done as in query option?
or should we start sending a json in body ... ?

github does not have this option so we are free to invent one

@6543 commented on GitHub (Sep 30, 2020): I think this can be done as in query option? or should we start sending a json in body ... ? github does not have this option so we are free to invent one
Author
Owner

@jolheiser commented on GitHub (Oct 29, 2020):

From what I can tell, there isn't really a defined standard. You can send query parameters and you can send a body with a DELETE request, however it is not in the spec (from what I could tell) and so it would be somewhat undefined territory.

I think, unfortunately, this should probably be delegated to #12913 and will require two API calls to completely remove a release and tag.
When this is implemented in the SDK, we could possibly add a convenience parameter so that it can remove the tag at the same time as the release.

On another note, the UI should also provide the option to retain the tag, for some of the reasons mentioned below relating to git.


I think this is fine when considering git has no concept of a release (it as a construct made up by services like ourselves and GH).

Releases are tied to tags, thus creating a release means creating the required tag as well.
However, deleting a release does not inherently mean the tag should be deleted, because tags can be created via git itself.

@jolheiser commented on GitHub (Oct 29, 2020): From what I can tell, there isn't really a defined standard. You _can_ send query parameters and you _can_ send a body with a DELETE request, however it is not in the spec (from what I could tell) and so it would be somewhat undefined territory. I think, unfortunately, this should probably be delegated to #12913 and will require two API calls to completely remove a release and tag. When this is implemented in the SDK, we could possibly add a convenience parameter so that it can remove the tag at the same time as the release. On another note, the UI should also provide the option to retain the tag, for some of the reasons mentioned below relating to git. ----- I think this is fine when considering git has no concept of a release (it as a construct made up by services like ourselves and GH). Releases are tied to tags, thus creating a release means creating the required tag as well. However, deleting a release does not inherently mean the tag should be deleted, because tags can be created via git itself.
Author
Owner

@jolheiser commented on GitHub (Nov 6, 2020):

Resolved with #13358

@jolheiser commented on GitHub (Nov 6, 2020): Resolved with #13358
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#6067