Skip to content
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

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

Closed
sigma-frossignol opened this issue Sep 29, 2020 · 4 comments
Closed

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

sigma-frossignol opened this issue Sep 29, 2020 · 4 comments
Labels
modifies/api This PR adds API routes or modifies them type/enhancement An improvement of existing functionality

Comments

@sigma-frossignol
Copy link

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

if err := releaseservice.DeleteReleaseByID(ctx.QueryInt64("id"), ctx.User, true); err != nil {

and to false when called from the API

if err := releaseservice.DeleteReleaseByID(id, ctx.User, false); err != nil {

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

Thanks in advance

@6543 6543 added modifies/api This PR adds API routes or modifies them type/proposal The new feature has not been accepted yet but needs to be discussed first. type/enhancement An improvement of existing functionality and removed type/proposal The new feature has not been accepted yet but needs to be discussed first. labels Sep 29, 2020
@6543
Copy link
Member

6543 commented Sep 29, 2020

related to #12913

@6543
Copy link
Member

6543 commented 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

@jolheiser
Copy link
Member

jolheiser commented 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
Copy link
Member

Resolved with #13358

@go-gitea go-gitea locked and limited conversation to collaborators Dec 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
modifies/api This PR adds API routes or modifies them type/enhancement An improvement of existing functionality
Projects
None yet
Development

No branches or pull requests

3 participants