go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
44.08k stars 5.41k forks source link

Creating a tag using the web route will use the time it was created rather than commit time #31789

Open kemzeb opened 1 month ago

kemzeb commented 1 month ago

Description

Discovered while trying to resolve #30971. When creating a lightweight tag and pushing using the git CLI (i.e. git push --tags, the tag list in the web UI will use the time that the commit was made.

Creating a lightweight tag using the web UI, however, will use the time that the tag was created. This is inconsistent and I believe we should use the commit's creation time instead.

We also appear to be storing these times in created_unix within the release table. I am not sure if it makes sense to store it in this column given its name (maybe store this value in a separate column?).

I haven't tested this in the demo site yet.

Screenshots

Creating tag LIGHT-CLI via the git CLI:

Screenshot 2024-08-06 at 9 44 08 PM

Creating tag LIGHT-WEBUI via the web UI:

Screenshot 2024-08-06 at 9 45 36 PM

Note that both tags point to the same commit.

Gitea Version

1.21.5

Can you reproduce the bug on the Gitea demo site?

No

Operating System

MacOS

Browser Version

Brave v1.68.134

kemzeb commented 1 month ago

Hmm, this is more of a backend problem now that I think about it.