repository-service-tuf/repository-service-tuf-worker

Task: bump ALL expired delegated roles no matter if they contain artifacts

MVrachev opened this issue · 0 comments

What is the task about?

Currently, when it's time to do an automatic bump of online roles the flow is:

  1. bump_online_roles
    2. _run_online_roles_bump
  2. self._update_snapshot with a list of target files that have expired

There in the execution of self._update_snapshot we call targets_crud.read_roles_joint_files which in return gives a list of joined records between RSTUF target roles and target files.
The problem is that if a bin does not have an artifact (target file) that is responsible for and it wouldn't be returned from targets_crud.read_roles_joint_files.

We should make sure that we bump ALL expired bins no matter if they contain artifacts.

To reproduce:

  1. make sure that only when you call bump_expiry from bootstrap that it will give the bins an expired date
    In all other cases of calling bump_expiry we want the function to behave as usual
  2. change the app.conf.beat_schedule in app.py to run online roles bump each minute so you don't have to wait
  3. run make run-dev
  4. add a few artifacts less than the total number of bins
  5. watch the logs and see that only bins that have targets will be updated

Code of Conduct

  • I agree to follow this project's Code of Conduct