katello icon indicating copy to clipboard operation
katello copied to clipboard

Fixes #32104 - Retain tasks used for errata reporting for longer time

Open adamruzicka opened this issue 2 years ago • 3 comments

What are the changes introduced in this pull request?

Erratum::ApplicableErrataInstall and Erratum::Install tasks are kept around for 90 days instead of 30.

Considerations taken when implementing this change?

This is a workaround and as such has a few hairy bits:

Foreman-tasks has a configuration file where this can be configured, however currently the configuration file comes straight from the packages (no installer involved), in packaging we take the example config file without making any changes to it. On update people would (maybe) still need to deal with .rpmnew files.

If we changed the defaults in the config file, we would shipping configuration for other plugins, which may not be enabled. This would cause warnings to appear in output when running the cleanup rake task without katello or remote_execution.

Alternatively we could make the installer manage that configuration file, but that could get out of hand really quickly.

Of course the right solution would be to consider tasks ephemeral and store the important bits elsewhere, but here we are.

What are the testing steps for this pull request?

  1. Have errata applications older than 1 month but younger than 3 months
  2. Run rake foreman_tasks:cleanup

Alternatively just run rake foreman_tasks:cleanup with SQL logging enabled and watch the queries it does.

adamruzicka avatar May 09 '22 09:05 adamruzicka

Issues: #32104

theforeman-bot avatar May 09 '22 09:05 theforeman-bot

Now requires https://github.com/theforeman/foreman-tasks/pull/687

adamruzicka avatar Jun 16 '22 14:06 adamruzicka

Rebased and bumped dependency on tasks

adamruzicka avatar Aug 05 '22 14:08 adamruzicka

It was decided this should not be hardcoded and left to the user to configure. Closing

adamruzicka avatar Aug 23 '22 11:08 adamruzicka