Skip to content

model: Add new classes to improve interface typing

I started working on Release a Bulk On-demand Archival feature roadmap item and got my head back into swh-scheduler code to analyze how the feature could be implemented.

I noticed that many methods from the scheduler interface were missing typing information which makes the code hard to read.

So I took some time to add these missing typing info.

As I did not want to break other SWH packages using the related scheduler API (deposit, vault, web), I decided to use TypedDict classes instead of attr.s ones. The migration from TypedDict to attr.s can still be done later.

As with other scheduler models, the newly introduced ones are based on the use of the attr package. It introduces some breaking API changes as methods modified in interface now return objects instead of dicts so all SWH packages client of these methods should also be updated, this has been done in the following MRs:

The docker tests have also been executed with all the changes above by pushing docker!23 and they still pass.

Edited by Antoine Lambert

Merge request reports