You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should have support for deleting old/unused modules so that the database doesn't grow without bound
Description
Currently, there is no way to remove modules/versions from the database, which means the backing PostgreSQL database will grow infinitely. There should be an API endpoint, and associated CLI sub-command, for deleting, preferably with an "if older than" watermark parameter.
The module pattern would be a glob string like example.com/foo/* specifying which modules to delete. The optional --prerelease-only flag would indicate to only delete pre-release versions and --if-older-than, if specified, would only delete module versions that were added before that date.
We should probably also consider:
a --dry-run parameter that outputs information about what would have been removed without actually doing so.
another pattern for matching versions to be deleted
Additional Info
The database foreign keys are set up for ON DELETE CASCADE but we would need to add an additional column to capture and store a creation date so that we have something to compare the --if-older-than value against.
The anticipated use case is something like a cron job that trims "old" and unused pre-release versions by running perseus delete github.com/someorg/* --prerelease --if-older-than $(date -v '90 days ago'). We do not want to add an internal "job scheduler" to the Perseus service, though.
The text was updated successfully, but these errors were encountered:
TItle
We should have support for deleting old/unused modules so that the database doesn't grow without bound
Description
Currently, there is no way to remove modules/versions from the database, which means the backing PostgreSQL database will grow infinitely. There should be an API endpoint, and associated CLI sub-command, for deleting, preferably with an "if older than" watermark parameter.
An initial proposal for the CLI command:
The module pattern would be a glob string like
example.com/foo/*
specifying which modules to delete. The optional--prerelease-only
flag would indicate to only delete pre-release versions and--if-older-than
, if specified, would only delete module versions that were added before that date.We should probably also consider:
--dry-run
parameter that outputs information about what would have been removed without actually doing so.Additional Info
The database foreign keys are set up for
ON DELETE CASCADE
but we would need to add an additional column to capture and store a creation date so that we have something to compare the--if-older-than
value against.The anticipated use case is something like a cron job that trims "old" and unused pre-release versions by running
perseus delete github.com/someorg/* --prerelease --if-older-than $(date -v '90 days ago')
. We do not want to add an internal "job scheduler" to the Perseus service, though.The text was updated successfully, but these errors were encountered: