Page MenuHomeSoftware Heritage

Make metadata translation warnings reference revisions/content ids instead of dumping the content itself.
ClosedPublic

Authored by vlorentz on Jan 24 2019, 4:34 PM.

Diff Detail

Repository
rDCIDX Object indexer
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

vlorentz created this revision.Jan 24 2019, 4:34 PM
vlorentz retitled this revision from Make metadata translation warning reference revisions/content ids instead of dumping the content itself. to Make metadata translation warnings reference revisions/content ids instead of dumping the content itself..
ardumont accepted this revision.Jan 25 2019, 2:52 PM
ardumont added a subscriber: ardumont.
ardumont added inline comments.
swh/indexer/metadata.py
68

why does the call change here (reading more carefully the rest of the diff)?
...

ok, it's not the call that changes, it's the initialization of the mapping class.
That instantiation is now done at each index method call.
As the init method allows to pass along a log_suffix now for the edge case failures, you can now log more information.

swh/indexer/tests/test_metadata.py
172

can't you extract that in the test setup (where it makes sense)?

self.npm_mapping = MAPPINGS["NpmMapping"]()
This revision is now accepted and ready to land.Jan 25 2019, 2:52 PM
vlorentz marked an inline comment as done.Jan 25 2019, 2:54 PM
vlorentz added inline comments.
swh/indexer/tests/test_metadata.py
172

What's the difference?

ardumont added inline comments.Jan 25 2019, 3:09 PM
swh/indexer/tests/test_metadata.py
172

you stop the duplication all over the tests?

vlorentz marked an inline comment as done.Jan 25 2019, 3:40 PM
vlorentz added inline comments.
swh/indexer/tests/test_metadata.py
172

That's only a small expression

vlorentz updated this revision to Diff 3200.Jan 25 2019, 3:48 PM
  • Deduplicate mapping instantiation.
This revision was automatically updated to reflect the committed changes.