Page MenuHomeSoftware Heritage

replayer: factor out legacy objects fixers
ClosedPublic

Authored by seirl on Mar 23 2020, 6:00 PM.

Details

Summary

This will allow other journal clients to use the fixers, instead of this
being solely a replayer feature.

One could also imagine integrating the fixer directly in the journal so
that the fixes happen transparently for all the users without having to
call the fixer explicitely, and this diff is a first step in this
direction.

Test Plan

tox passes the unit tests and mypy is happy

Diff Detail

Repository
rDJNL Journal infrastructure
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

olasd added a subscriber: olasd.

Looks good to me, save from one inline comment.

The tests failure is a silly doctest dict key order thing. Even if it's a bit overkill, might I suggest turning the doctests into actual tests that wouldn't exhibit such an issue (in a followup diff)?

swh/journal/replay.py
128–129

You can switch this to use the object_converter_fn fallthrough now, I guess.

This revision is now accepted and ready to land.Mar 23 2020, 6:11 PM

use fallback for revision

This revision was automatically updated to reflect the committed changes.