Deleting a Repo should delete all Commit Statuses #2848

Closed
opened 2025-11-02 04:51:01 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @jolheiser on GitHub (Feb 1, 2019).

  • Gitea version (or commit ref): current
  • Git version: Any
  • Operating system: All
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

When deleting a repo, currently all commit statuses are being left in the database. Gitea should clean up this table as well when deleting a repo.

Based on the CommitStatus struct having a RepoID here I believe it should be as easy as adding it to the list here

Let me know if this sounds correct and I'd be happy to submit a PR.
I only noticed this when testing the commit status API, there may be more things that can be cleaned up as well.

Originally created by @jolheiser on GitHub (Feb 1, 2019). - Gitea version (or commit ref): current - Git version: Any - Operating system: All - Database (use `[x]`): - [x] PostgreSQL - [x] MySQL - [x] MSSQL - [x] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant - Log gist: ## Description When deleting a repo, currently all commit statuses are being left in the database. Gitea should clean up this table as well when deleting a repo. Based on the CommitStatus struct having a RepoID [here](https://github.com/go-gitea/gitea/blob/80098bd7526fed84cfb4fa48272be71541b37205/models/status.go#L58) I believe it should be as easy as adding it to the list [here](https://github.com/go-gitea/gitea/blob/80098bd7526fed84cfb4fa48272be71541b37205/models/repo.go#L1775) Let me know if this sounds correct and I'd be happy to submit a PR. I only noticed this when testing the commit status API, there may be more things that can be cleaned up as well.
GiteaMirror added the type/bug label 2025-11-02 04:51:01 -06:00
Author
Owner

@zeripath commented on GitHub (Feb 2, 2019):

Yes that would do it.

@zeripath commented on GitHub (Feb 2, 2019): Yes that would do it.
Author
Owner

@zeripath commented on GitHub (Feb 2, 2019):

If you'd like to submit a PR I'd be happy to 👍 it

@zeripath commented on GitHub (Feb 2, 2019): If you'd like to submit a PR I'd be happy to :+1: it
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2848