Skip to content

Refactor code in PruneOldEventsWorker & PruneWebHookLogsWorker

Manoj M J [On PTO] requested to merge prune-workers-refactoring into master

What does this MR do?

This is an extension to the work done in !23854 (merged).

This involves:

  • Moving delete_with_limit to a concern, so that it can be reused in 3 different places now.
  • Refactor code in PruneOldEventsWorker & PruneWebHookLogsWorker to make use of the new DeleteWithLimit concern.
  • Also make use of the created_before method already available in CreatedAtFilterable, so that we can completely get rid of disabling the CodeReuse/ActiveRecord cop 👮

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Manoj M J [On PTO]

Merge request reports