Skip to content

Add Maintenance Operation to Garbage Collect Orphaned Attachments #34947

Open
@smartYSC

Description

@smartYSC

Feature Description

Over time, orphaned attachments can accumulate in Gitea. Attachments can become orphaned e.g. when a user starts creating a PR/issue/comment/release, uploads an attachment and then decided to not post it, see #16783.

In our case we have a bot which posts build results to PRs. It overwrites existing comments to avoid clutter. We do this by deleting the existing comment and creating a new one. However, the attachments of that comment are not cleaned up.

It would be nice if Gitea would either automatically delete those unreferenced attachments or to add a Maintenance Operation which checks the attachments table and removes all which have no reference.

Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/needs-feedbackFor bugs, we need more details. For features, the feature must be described in more detailtype/proposalThe new feature has not been accepted yet but needs to be discussed first.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions