Page MenuHomeSoftware Heritage

Adapt fill_storage for swh.storage 0.40
ClosedPublic

Authored by olasd on Tue, Nov 23, 3:48 PM.

Details

Summary

process_replay_objects now expects ModelObjects.

Diff Detail

Repository
rDPROV Provenance database
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Build is green

Patch application report for D6674 (id=24245)

Rebasing onto 30d8899bcf...

Current branch diff-target is up to date.
Changes applied before test
commit 94baaab052b9364bc74a9c563cc88808ccdb8bdc
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Tue Nov 23 15:30:39 2021 +0100

    Adapt fill_storage for swh.storage 0.40

See https://jenkins.softwareheritage.org/job/DPROV/job/tests-on-diff/481/ for more details.

olasd requested review of this revision.Tue, Nov 23, 3:51 PM
aeviso added inline comments.
swh/provenance/tests/conftest.py
107

I've realized thanks to this fix that the type here can actually be refined to Dict[str, List[Any]]. Also in the declaration of fill_storage

122

And this function should have been removed before

126

I did almost the same but also considered

if object_type in OBJECT_FIXERS:
        dict_repr = OBJECT_FIXERS[object_type](dict_repr)

from ModelObjectDeserializer.convert. Hence, I wrote this in a separate function object_from_dict
Not sure if it is really relevant

I forgot the action in the previous submit. I'm good with the revision.
I can add the implement my comments later in another diff anyway.

This revision is now accepted and ready to land.Tue, Nov 23, 4:02 PM
This revision was automatically updated to reflect the committed changes.
swh/provenance/tests/conftest.py
126

Yeah, the serialized data can be regenerated at will, so the fixers aren't really critical. I guess adding them is probably the safest way to go though.