codechecker icon indicating copy to clipboard operation
codechecker copied to clipboard

Implement Decaying Runs in CodeChecker

Open gamesh411 opened this issue 4 months ago • 0 comments

Is your feature request related to a problem? Please describe.

There is a problem with CodeChecker runs accumulating and consuming excessive space on the server. For example, when using a Jenkins job to analyze a set of OpenSource projects, every build creates a new run in the CodeChecker server. These runs are not automatically cleaned up, leading to server storage issues over time.

Describe the solution you would like

Implement a "decaying runs" feature in CodeChecker with the following characteristics:

  1. Allow users to specify a lifetime for runs during the storage phase.
  2. Implement a backend mechanism that periodically cleans up runs older than their specified lifetime.
  3. Maintain backward compatibility by keeping runs indefinitely by default.
  4. Provide ways to view and modify the remaining time until deletion for runs in both the CLI and CodeChecker web UI.

Describe alternatives you have considered

  • Manual deletion of old runs: This requires constant monitoring and manual intervention, which is not scalable.
  • Fixed deletion schedule: This doesn't allow for flexibility in retention times for different types of runs.

Additional context

This feature would greatly improve the management of storage resources for CodeChecker servers, especially in CI/CD environments where new runs are frequently created.

Implementation details to consider:

  • Add a new parameter to the storage command to specify run lifetime.
  • Implement a background job in the server to check and delete expired runs.
  • Extend the database schema to include lifetime and expiration information for runs.
  • Update the CLI and web UI to display and allow modification of run lifetimes.
  • Ensure proper documentation of the new feature in the CodeChecker documentation.
  • Make sure to test the backend, the interaction with the web app and the CLI as well.

gamesh411 avatar Oct 17 '24 10:10 gamesh411