Skip to content

Add checks when open/close issue #26106

Closed
@yp05327

Description

@yp05327

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions