Skip to content

Fix doctor deleting orphaned issues attachments #34142

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

lunny
Copy link
Member

@lunny lunny commented Apr 7, 2025

Fix the bug when deleting orphaned issues attachments. The attachments maybe stored on other storages service rather than disk.

@lunny lunny added type/bug backport/v1.23 This PR should be backported to Gitea 1.23 labels Apr 7, 2025
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 7, 2025
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label Apr 7, 2025
@lunny lunny requested a review from wxiaoguang April 7, 2025 16:56
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Apr 10, 2025
@lunny lunny added the backport/v1.24 This PR should be backported to Gitea 1.24 label Apr 30, 2025
@@ -323,3 +323,32 @@ func deleteIssue(ctx context.Context, issue *issues_model.Issue) error {

return committer.Commit()
}

// DeleteOrphanedIssues delete issues without a repo
func DeleteOrphanedIssues(ctx context.Context) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can some codes above be used in this function?
e.g. also remove issue actions, other things which is assigned to the orphaned issue?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it could be. But that will need much more changes. This PR will only fix the bug when deleting attachments. That could be another PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/v1.23 This PR should be backported to Gitea 1.23 backport/v1.24 This PR should be backported to Gitea 1.24 lgtm/need 1 This PR needs approval from one additional maintainer to be merged. modifies/go Pull requests that update Go code type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants