Delete unreferenced packages when deleting a package version#20977
Merged
Conversation
zeripath
reviewed
Aug 27, 2022
Contributor
There was a problem hiding this comment.
Isn't this is essentially doing a lot of the work that is in cleanup on every delete? i.e. it's tantamount to calling CleanUp for every delete?
Cant we use the information in pv to limit our unreferenced check to that particular package?
Member
Author
There was a problem hiding this comment.
It's not really much work. In the best case it's 1 sql query, average case is 1+2 queries and the worst case is 1+n*2 queries.
Anyway I just changed the definition of HasOwnerPackages, so no additional work to do.
Member
|
But it would still leave invalid user id referenced as owner? |
Member
Author
|
Yes and they get cleaned up the next time the job runs. |
zeripath
approved these changes
Sep 3, 2022
lunny
approved these changes
Sep 3, 2022
delvh
approved these changes
Sep 3, 2022
Co-authored-by: delvh <dev.lh@web.de>
Contributor
|
Please send backport |
zeripath
pushed a commit
to zeripath/gitea
that referenced
this pull request
Sep 4, 2022
…a#20977) Backport go-gitea#20977 Delete a package if its last version got deleted. Otherwise removing the owner works only after the clean up job ran. Fix go-gitea#20969
techknowlogick
pushed a commit
that referenced
this pull request
Sep 4, 2022
zjjhot
added a commit
to zjjhot/gitea
that referenced
this pull request
Sep 5, 2022
* upstream/main: (22 commits) [skip ci] Updated translations via Crowdin Webhook for Wiki changes (go-gitea#20219) test: use `T.TempDir` to create temporary test directory (go-gitea#21043) Set uploadpack.allowFilter etc on gitea serv to enable partial clones with ssh (go-gitea#20902) Fix 500 on time tracking in timeline API (go-gitea#21052) Add more checks in migration code (go-gitea#21011) Fill the specified ref in webhook test payload (go-gitea#20961) [skip ci] Updated licenses and gitignores Add go licenses to licenses.txt (go-gitea#21034) Added docs for agit-setup (go-gitea#21027) Add another index for Action table on postgres (go-gitea#21033) Delete unreferenced packages when deleting a package version (go-gitea#20977) Improve arc-green code theme (go-gitea#21039) Add down key check has tribute container (go-gitea#21016) Do not add links to Posters or Assignees with ID < 0 (go-gitea#20577) [skip ci] Updated translations via Crowdin Show language name on hover (go-gitea#20923) fix: PackageMetadataVersion deps (go-gitea#21017) Fix the quick-submit for pending review comment (go-gitea#20992) Kd/ci playwright go test (go-gitea#20123) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Delete a package if its last version got deleted. Otherwise removing the owner works only after the clean up job ran.
Fix #20969