'Commits since this release' link broken for API created releases #10664

Closed
opened 2025-11-02 09:14:49 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @oliverpool on GitHub (Apr 15, 2023).

Description

When a release is created via the API with an empty target, the release page is a bit broken: https://codeberg.org/forgejo-contrib/forgejo-helm/releases/tag/v0.6.1

13 commits to since this release

The branch bame name is missing between "to" and "since" and the 0 commits link points to a 404 (eg https://codeberg.org/forgejo-contrib/forgejo-helm/compare/v0.3.3...).


This is related to #18226, which was fixed in #18252. The same "broken" logic is happening 50 lines below (.Target is an empy string):

<a href="{{$.RepoLink}}/compare/{{.TagName | PathEscapeSegments}}...{{.Target | PathEscapeSegments}}">

The same solution as in #18252 could be applied (stripping the ... from the href).

However I think it would be more useful to fall back to the repository default branch in such case (empty target field).

I would be willing to make a PR for such a "default branch fallback" solution.


Moreover the count of commits is different between the release list and the single release (tag v0.5.0 for instance):
https://codeberg.org/forgejo-contrib/forgejo-helm/releases
https://codeberg.org/forgejo-contrib/forgejo-helm/releases/tag/v0.5.0

=> commit count fixed in #24148


Original report: https://codeberg.org/Codeberg/Community/issues/967
Related fix for a woodpecker plugin: https://codeberg.org/woodpecker-plugins/gitea-release/pulls/9

Gitea Version

1.19 and 1.20

Can you reproduce the bug on the Gitea demo site?

Yes

How are you running Gitea?

On codeberg

contributed in the context of @forgejo

Originally created by @oliverpool on GitHub (Apr 15, 2023). ### Description When a release is created via the API with an empty `target`, the release page is a bit broken: https://codeberg.org/forgejo-contrib/forgejo-helm/releases/tag/v0.6.1 > 13 commits to since this release The branch bame name is missing between "to" and "since" and the `0 commits` link points to a 404 (eg `https://codeberg.org/forgejo-contrib/forgejo-helm/compare/v0.3.3...`). --- This is related to #18226, which was fixed in #18252. The same "broken" logic is happening 50 lines below (`.Target` is an empy string): ``` <a href="{{$.RepoLink}}/compare/{{.TagName | PathEscapeSegments}}...{{.Target | PathEscapeSegments}}"> ``` The same solution as in #18252 could be applied (stripping the `...` from the `href`). However I think it would be more useful to fall back to the repository default branch in such case (empty `target` field). I would be willing to make a PR for such a "default branch fallback" solution. --- ~Moreover the count of commits is different between the release list and the single release (tag `v0.5.0` for instance): https://codeberg.org/forgejo-contrib/forgejo-helm/releases https://codeberg.org/forgejo-contrib/forgejo-helm/releases/tag/v0.5.0~ => commit count fixed in #24148 --- Original report: https://codeberg.org/Codeberg/Community/issues/967 Related fix for a woodpecker plugin: https://codeberg.org/woodpecker-plugins/gitea-release/pulls/9 ### Gitea Version 1.19 and 1.20 ### Can you reproduce the bug on the Gitea demo site? Yes ### How are you running Gitea? On codeberg _contributed in the context of @forgejo_
GiteaMirror added the type/bug label 2025-11-02 09:14:49 -06:00
Author
Owner

@viceice commented on GitHub (Apr 28, 2023):

Isn't this fixed by https://github.com/go-gitea/gitea/pull/24197 ?

@viceice commented on GitHub (Apr 28, 2023): Isn't this fixed by https://github.com/go-gitea/gitea/pull/24197 ?
Author
Owner

@oliverpool commented on GitHub (Apr 28, 2023):

No. Both bug are related to the releases page counting commits, but have different reasons:

  • #24148 (backported in #24197) is about a different commit count on the index and the detailed page
  • This issue is about a release with an empty target field, which always shows 0 commits to since this release (notice the lack of branch name between to and since).
@oliverpool commented on GitHub (Apr 28, 2023): No. Both bug are related to the releases page counting commits, but have different reasons: - #24148 (backported in #24197) is about a different commit count on the index and the detailed page - This issue is about a release with an empty `target` field, which always shows `0 commits to since this release` (notice the lack of branch name between `to` and `since`).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#10664