Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for deleting old/unused modules/versions #112

Open
dylan-bourque opened this issue Sep 20, 2023 · 0 comments
Open

Add support for deleting old/unused modules/versions #112

dylan-bourque opened this issue Sep 20, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@dylan-bourque
Copy link

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:

perseus delete [module glob pattern] --prerelease-only --if-older-than [date/time]

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.

@dylan-bourque dylan-bourque added the enhancement New feature or request label Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant