Page MenuHomeSoftware Heritage

Fix the inmemory journal writer
ClosedPublic

Authored by douardda on Apr 7 2020, 4:38 PM.

Details

Summary

InMemoryJournalWriter.write_addition() is expected to receive a (frozen) model
entity (not a dict) so it makes no sense any more to deepcopy it.

It's not a required fix for the journal by itself, but is necessary for
the storage (in which there is the non-copiable LazyContent model object).

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

Build is green

Patch application report for D2968 (id=10560)

Rebasing onto 17d64ff61b...

Current branch diff-target is up to date.
Changes applied before test
commit d5ba7cf4b35bc0e9d7def34ac7051255efdba3d7
Author: David Douard <david.douard@sdfa3.org>
Date:   Tue Apr 7 11:46:01 2020 +0200

    Fix the inmemory journal writer
    
    InMemoryJournalWriter.write_addition() is expected to receive a (frozen) model
    entity (not a dict) so it makes no sense any more to deepcopy it.

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

anlambert added a subscriber: anlambert.

Looks good to me.

This revision is now accepted and ready to land.Apr 7 2020, 4:44 PM

Could you improve the first line of commit message before merging? (eg. Remove useless copy)

This revision was landed with ongoing or failed builds.Apr 8 2020, 2:00 PM
This revision was automatically updated to reflect the committed changes.

Build is green

Patch application report for D2968 (id=10589)

Rebasing onto 17d64ff61b...

Current branch diff-target is up to date.
Changes applied before test
commit a68e800622b23274492987d950dcaf807fa7f88c
Author: David Douard <david.douard@sdfa3.org>
Date:   Tue Apr 7 11:46:01 2020 +0200

    Remove useless deepcopy in the inmemory journal writer
    
    InMemoryJournalWriter.write_addition() is expected to receive a (frozen) model
    entity (not a dict) so it makes no sense any more to deepcopy it.

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