Clean up signoffs when package is moved
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
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.
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.
Which, thinking about it, we might want to do with FlagRequest as well?
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.
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.