Add checks when open/close issue #11327

Closed
opened 2025-11-02 09:34:29 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @yp05327 on GitHub (Jul 25, 2023).

Description

We have no checks for whether we can open or close an issue which causes some bugs like #25883.
I notice that #25883 is not enough to fix this problem, as we also have api of changing issue status
and not only merged PRs but also PRs with deleted branch.

You can see that I reopened this PR but the branch is already deleted here:
https://try.gitea.io/yp05327/testrepo/pulls/7
image

Normally we can not open it in the PR view page, but you can do it in the issue list(select one, then click open/close button)
https://try.gitea.io/yp05327/testrepo/pulls/9
image

If you created a new branch with the same branch name, the Commits and Files Changed will be broken:
https://try.gitea.io/yp05327/testrepo/pulls/8
image
But you can access Files Changed page, and get a strange block here:
image

Maybe we should discuss a summary about when we should not open/close an issue at first, and then fix it.

Gitea Version

latest

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

build

Database

None

Originally created by @yp05327 on GitHub (Jul 25, 2023). ### Description We have no checks for whether we can open or close an issue which causes some bugs like #25883. I notice that #25883 is not enough to fix this problem, as we also have api of changing issue status and not only merged PRs but also PRs with deleted branch. You can see that I reopened this PR but the branch is already deleted here: https://try.gitea.io/yp05327/testrepo/pulls/7 ![image](https://github.com/go-gitea/gitea/assets/18380374/4d140b1a-fdbb-4a7f-9ed1-d239ca6f25d3) Normally we can not open it in the PR view page, but you can do it in the issue list(select one, then click open/close button) https://try.gitea.io/yp05327/testrepo/pulls/9 ![image](https://github.com/go-gitea/gitea/assets/18380374/74734c3b-f0a8-4cbe-8069-118a885d431a) If you created a new branch with the same branch name, the `Commits` and `Files Changed` will be broken: https://try.gitea.io/yp05327/testrepo/pulls/8 ![image](https://github.com/go-gitea/gitea/assets/18380374/2be6844d-b54e-4282-bd21-deadd20416bc) But you can access `Files Changed` page, and get a strange block here: ![image](https://github.com/go-gitea/gitea/assets/18380374/abc085a2-87d1-49c7-aaa3-98928c1959f5) Maybe we should discuss a summary about when we should not open/close an issue at first, and then fix it. ### Gitea Version latest ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? build ### Database None
GiteaMirror added the type/bug label 2025-11-02 09:34:29 -06:00
Author
Owner

@lunny commented on GitHub (May 1, 2025):

I think this has been resolved.

@lunny commented on GitHub (May 1, 2025): I think this has been resolved.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#11327