Skip to content
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

Deleted branch still visible in branch list and 404 on access #31018

Closed
MrTypename opened this issue May 19, 2024 · 5 comments
Closed

Deleted branch still visible in branch list and 404 on access #31018

MrTypename opened this issue May 19, 2024 · 5 comments
Labels
issue/not-a-bug The reported issue is the intended behavior or the problem is not inside Gitea

Comments

@MrTypename
Copy link

Description

When I delete a branch by web interface or by 'git push' the branch is listed as deleted within the repo branch overview. Following the branch link I get a 404 error. Is this behaviour intended ? Note that after a 'restore' the branch is accessible again. How can I remove a deleted branch completely ?

Note: try.gitea.io is currently not accessible ?!

Gitea Version

1.21.11

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

c0
c1

Git Version

2.40.1

Operating System

Ubuntu 22.04.4

How are you running Gitea?

Docker image:
https://hub.docker.com/layers/gitea/gitea/1.21.11/images/sha256-0abba6432e37944cd13b47aa0c6ffb958e1a22d7b3795c723267ac92163b774f?context=explore

Database

MySQL/MariaDB

@kemzeb
Copy link
Contributor

kemzeb commented May 19, 2024

Thanks for the bug report!

When you delete a branch, we do keep it around in the DB until this cron job goes ahead and removes it and any other deleted branches. From reading the associated code it looks like it is done every midnight for branches that were deleted at least a day ago.

@kemzeb
Copy link
Contributor

kemzeb commented May 19, 2024

From looking around a bit further, you can even configure this particular cron task, see here for more details. For some reason I can't find it in the web documentation so I may file an issue for that.

@kemzeb
Copy link
Contributor

kemzeb commented May 20, 2024

Created #31022 to add web docs for deleted branch cleanup. Let me know if you have any further questions.

@kemzeb kemzeb added the issue/not-a-bug The reported issue is the intended behavior or the problem is not inside Gitea label May 20, 2024
@lunny
Copy link
Member

lunny commented May 20, 2024

We can remove the link of the branch name.

@MrTypename
Copy link
Author

Thanks for your fast response. The cron task for this job was disabled. The issue is now solved.

@lunny lunny removed the type/bug label May 20, 2024
lunny pushed a commit that referenced this issue May 21, 2024
From
#31018 (comment).

This commit removes the link to a deleted branch name because it returns
a 404 while it is in this deleted state. GitHub also throws a 404 when
navigating to a branch link that was just deleted, but this deleted
branch is removed from the branch list after a page refresh. Since with
Gitea this deleted branch would be kept around for quite some time
(well, until the "cleanup deleted branches" cron job begins), it makes
sense to not have this as a link that users can navigate to.
GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue May 21, 2024
…31028)

From
go-gitea#31018 (comment).

This commit removes the link to a deleted branch name because it returns
a 404 while it is in this deleted state. GitHub also throws a 404 when
navigating to a branch link that was just deleted, but this deleted
branch is removed from the branch list after a page refresh. Since with
Gitea this deleted branch would be kept around for quite some time
(well, until the "cleanup deleted branches" cron job begins), it makes
sense to not have this as a link that users can navigate to.
lunny pushed a commit that referenced this issue May 21, 2024
…31032)

Backport #31028 by @kemzeb

From
#31018 (comment).

This commit removes the link to a deleted branch name because it returns
a 404 while it is in this deleted state. GitHub also throws a 404 when
navigating to a branch link that was just deleted, but this deleted
branch is removed from the branch list after a page refresh. Since with
Gitea this deleted branch would be kept around for quite some time
(well, until the "cleanup deleted branches" cron job begins), it makes
sense to not have this as a link that users can navigate to.

Co-authored-by: Kemal Zebari <60799661+kemzeb@users.noreply.github.com>
DennisRasey pushed a commit to DennisRasey/forgejo that referenced this issue May 28, 2024
From
go-gitea/gitea#31018 (comment).

This commit removes the link to a deleted branch name because it returns
a 404 while it is in this deleted state. GitHub also throws a 404 when
navigating to a branch link that was just deleted, but this deleted
branch is removed from the branch list after a page refresh. Since with
Gitea this deleted branch would be kept around for quite some time
(well, until the "cleanup deleted branches" cron job begins), it makes
sense to not have this as a link that users can navigate to.

(cherry picked from commit 1007ce764ea80b48120b796175d7d1210cbb6f74)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue/not-a-bug The reported issue is the intended behavior or the problem is not inside Gitea
Projects
None yet
Development

No branches or pull requests

3 participants