[WIP] Prune reports that match a specific status
This is a rebase of the PR #311 so we have a new working branch to test and discuss the new feature. I also squashed the changes into one single commit.
THIS WORK IN PROGRESS! This PR is not tested and should not be merged currently.
Two defects of the original PR, I never voiced my concerns though:
-
The SQL changes effectively make these arguments mandatory. That's a non-starter; leaving out these arguments needs to function in the old behavior of nuking all reports past the given age. Clearing all reports beyond a given age would require at least two invocations in the current version of the code.
-
I'm not a fan of the assembly of two arguments. I'd prefer a single argument, even if it's something like
status=is-unchangedorstatus=not-pendingthat requires further parsing. That said, the pattern was set byuptoandunitwhich assemble two arguments into the older-than date. I had always wanted to change this to something likeage=30dorolder-than=2mfor example, but it's not exactly a high-value win to clarify these arguments.
Yeah this should better not be merged before we have some tests around the tasks to ensure the old behavior is still working. I added it to milestone 3.2 where I put all the other task related stuff. Maybe we can just use this as an inspiration or feature request when reworking the tasks so I leave it open for now.