Skip to content

Refactor common behavior between ContentLoader and *DirectoryLoader

(only the top-level commit, sharing the same title as this MR, is to be reviewed)

This renames the method fetch_directory introduced in [1] in fetch_artifact and move it in the NodeLoader base class (common mother class of ContentLoader and DirectoryLoader). This adds a new abstract method compute_artifact too which computes the DAG objects out of the artifact_path retrieved in the fetch_artifact method.

This reworks the ContentLoader's fetch_data into a simpler fetch_artifact and add the compute_artifact implementation. This also reworks the DirectoryLoader to drop the fetch_data and just provide the compute_artifact part. Finally, this renames the fetch_directory in TarballDirectoryLoader to fetch_artifact.

There is now no more duplication between all those classes mentioned above.

Thougths?

[1] Depends on !469 (merged)

Refs. swh/meta#4979 (closed)

Merge request reports