Skip to content

Deleting a tag for a release breaks the release #32427

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

Closed
s-hamann opened this issue Nov 5, 2024 · 0 comments · Fixed by #32435
Closed

Deleting a tag for a release breaks the release #32427

s-hamann opened this issue Nov 5, 2024 · 0 comments · Fixed by #32435
Labels

Comments

@s-hamann
Copy link
Contributor

s-hamann commented 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

@lunny lunny closed this as completed in 35bcd66 Nov 8, 2024
GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue Nov 8, 2024
techknowlogick pushed a commit that referenced this issue Nov 10, 2024
Backport #32435 by @Zettat123

Fix #32427

---------

Co-authored-by: Zettat123 <[email protected]>
Co-authored-by: Lunny Xiao <[email protected]>
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Feb 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant