-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Show commit status for releases #29149
Conversation
@@ -5,90 +5,90 @@ | |||
{{template "base/alert" .}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review this file without whitespace diff to spot the changes.
I have a question. Is it necessary for a stable release. |
And I'd say rightfully so. |
This PR now contains also a possible security fix. https://try.gitea.io/KN4CK3R/draft-test/releases hides draft versions |
a little wonder whether this change is necessary enough ? maybe user can add it in the release descraption manually or by ci. |
Why would one manually add a commit status? It does not make sense imho. If the release can be associated with a tag or commit, we should show the associated commit status, which can indicate problems for example when the release process is done by CI. @KN4CK3R I think it's possible for release to not be associated to a commit, in such a case we should not render a status. |
Releases are tag bases and therefore must be associated to a commit. |
Okay, I guess it would still be good to add a check so that we do not break the template rendering if no commit can be determined. |
Where should a check be placed? If there was no commit status found, nothing gets rendered. |
Before the subtemplate |
Maybe it should be hidden if |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks & works great in my tests 👍
If there is any concern about UI we could optionally move the status next to the commit hash so that it's clear it's related to the underlying ref. I'm happy either way.
Fixes go-gitea#29082 ![grafik](https://github.com/go-gitea/gitea/assets/1666336/bb2ccde1-ee99-459d-9e74-0fb8ea79e8b3) (cherry picked from commit 7e8ff70)
…9466) Partially caused by #29149 When use ```go releases, err := getReleaseInfos(ctx, &repo_model.FindReleasesOptions{ ListOptions: db.ListOptions{Page: 1, PageSize: 1}, RepoID: ctx.Repo.Repository.ID, TagNames: []string{ctx.Params("*")}, // only show draft releases for users who can write, read-only users shouldn't see draft releases. IncludeDrafts: writeAccess, }) ``` replace ```go release, err := repo_model.GetRelease(ctx, ctx.Repo.Repository.ID, ctx.Params("*")) ``` It missed `IncludeTags: true,`. That means this bug will be occupied only when the release is a tag. This PR will fix - Get the right tag record when it's not a release - Display correct tag tab but not release tag when it's a tag. - The button will bring the tag name to the new page when it's a single tag page - the new page will automatically hide the release target inputbox when the tag name is pre filled. This should be backport to v1.21.
Fixes #29082