archweb icon indicating copy to clipboard operation
archweb copied to clipboard

Clean up signoffs when package is moved

Open jelly opened this issue 7 years ago • 5 comments

When a package is no longer in [testing] clean up the related signoffs for this package or periodically prune old signoffs.

Both the packages_signoffspecification and packages_signoff tables

jelly avatar Feb 14 '19 19:02 jelly

Although the dataset is very small, old signoffs can be removed similar too https://github.com/archlinux/archweb/commit/7d162a095333b0e2c31a96940e5915848caf4d5c when a package is no longer in the repository.

This fixes a different case then the original ticket describes.

jelly avatar Mar 23 '19 14:03 jelly

Hmm, seems that the current signoff mechanism was explicitly made so that they won't be deleted when packages are removed from testing:

    '''
    A signoff for a package (by pkgbase) at a given point in time. These are
    not keyed directly to a Package object so they don't ever get deleted when
    Packages come and go from testing repositories.
    '''

Might be so that you have some kind of history available? But since there's no UI for viewing them after the package has been moved, I'm not sure if there's any point in keeping them.

I guess the simplest way to change it would be to replace the pkgbase, pkgver, pkgrel, and epoch with a ForeignKey to a Package with on_delete=models.CASCADE.

kyrias avatar Oct 04 '19 18:10 kyrias

Which, thinking about it, we might want to do with FlagRequest as well?

kyrias avatar Oct 04 '19 18:10 kyrias

We wanted to clean up the Signoffs since we never look at them after the package has been moved. Since we have the GDPR now too, we also want to store as little user related data as possible.

jelly avatar Oct 09 '19 09:10 jelly

Yeah. Can you think of any reason for not just adding a on_delete.models.CASCADE to both Signoff and FlagRequest? I can't think of any downsides at the moment, and it would remove logic from reporead.

kyrias avatar Oct 09 '19 17:10 kyrias