Deleting a tag for a release breaks the release #13676

Closed
opened 2025-11-02 10:49:59 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @s-hamann on GitHub (Nov 5, 2024).

Description

The web UI does not allow deleting tags that are associated with an existing release. However, it can be done via the git client. Doing so turns the release into a draft release. Pushing the tag again does not fix the release.

Steps to reproduce

  1. Create a repository with some content and clone it locally
  2. Add a tag: git tag test
  3. Push the tag: git push origin test
  4. Create a release for the tag
  5. Delete the tag on the server: git push origin --delete test
  6. Observe that the release is now a "draft"
  7. Push the tag again: git push origin test
  8. Observer that the release is still a "draft"

Observations

When pushing the tag a second time, the following message is logged:

2024/11/05 17:48:34 ...s/repository/push.go:40:handler() [E] pushUpdate[user/example-repo] failed: PushUpdateAddDeleteTags: Insert: pq: duplicate key value violates unique constraint "UQE_release_n"

I can't provide more detailed logs at the moment. I can set up a test environment, though, if necessary.

This is a regression. We upgraded from 1.21.x, which did not show this behaviour. Unfortunately, I did not make note which exact version we used before.

Use case

I realise deleting are re-creating tags from the command line seems like an odd thing to do. We do it as part of a nightly build pipe line, which builds binaries and attaches them to a moving tag and release named latest.

Gitea Version

1.22.3

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

2.39.2

Operating System

Debian GNU/Linux

How are you running Gitea?

Official release binary, started via systemd

Database

PostgreSQL

Originally created by @s-hamann on GitHub (Nov 5, 2024). ### Description The web UI does not allow deleting tags that are associated with an existing release. However, it can be done via the git client. Doing so turns the release into a draft release. Pushing the tag again does not fix the release. ### Steps to reproduce 1. Create a repository with some content and clone it locally 2. Add a tag: `git tag test` 3. Push the tag: `git push origin test` 4. Create a release for the tag 5. Delete the tag on the server: `git push origin --delete test` 6. Observe that the release is now a "draft" 7. Push the tag again: `git push origin test` 8. Observer that the release is still a "draft" ### Observations When pushing the tag a second time, the following message is logged: ``` 2024/11/05 17:48:34 ...s/repository/push.go:40:handler() [E] pushUpdate[user/example-repo] failed: PushUpdateAddDeleteTags: Insert: pq: duplicate key value violates unique constraint "UQE_release_n" ``` I can't provide more detailed logs at the moment. I can set up a test environment, though, if necessary. This is a regression. We upgraded from 1.21.x, which did not show this behaviour. Unfortunately, I did not make note which exact version we used before. ### Use case I realise deleting are re-creating tags from the command line seems like an odd thing to do. We do it as part of a nightly build pipe line, which builds binaries and attaches them to a moving tag and release named `latest`. ### Gitea Version 1.22.3 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version 2.39.2 ### Operating System Debian GNU/Linux ### How are you running Gitea? Official release binary, started via systemd ### Database PostgreSQL
GiteaMirror added the type/bug label 2025-11-02 10:49:59 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#13676