Page MenuHomeSoftware Heritage

to_disk: raise an AssertionError if content has an unexpected status.
ClosedPublic

Authored by vlorentz on Fri, Sep 4, 10:29 AM.

Details

Summary

Although that will be fixed in the next version of swh-storage (D3874),
the current one returns a None status for skipped content, which
causes surprising behavior from the cooker (as it reuse the content
of the previous file in place of the current one).

Additionally, even though it shouldn't happen, if a content is
missing completely (ie. neither know nor skipped), it's still
possible to have a None status.

Diff Detail

Repository
rDVAU Software Heritage Vault
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.Fri, Sep 4, 10:29 AM

Build is green

Patch application report for D3882 (id=13688)

Rebasing onto ff8e6c8c14...

Current branch diff-target is up to date.
Changes applied before test
commit d64687d9c948db9d9b59a2858c3f50d1a9936042
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Fri Sep 4 10:26:59 2020 +0200

    to_disk: raise an AssertionError if content has an unexpected status.
    
    Although that will be fixed in the next version of swh-storage,
    the current one returns a None status for skipped content, which
    causes surprising behavior from the cooker (as it reuse the content
    of the previous file in place of the current one).
    
    Additionally, even though it shouldn't happen, if a content is
    missing completely (ie. neither know nor skipped), it's still
    possible to have a None status.

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

fine.

But don't you require to add test alongside usually?

vlorentz updated this revision to Diff 13690.Fri, Sep 4, 11:10 AM

add tests

Build is green

Patch application report for D3882 (id=13690)

Rebasing onto ff8e6c8c14...

Current branch diff-target is up to date.
Changes applied before test
commit a14907ccb93944570fb59c841ab3a499ee0faba3
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Fri Sep 4 10:26:59 2020 +0200

    to_disk: raise an AssertionError if content has an unexpected status.
    
    Although that will be fixed in the next version of swh-storage,
    the current one returns a None status for skipped content, which
    causes surprising behavior from the cooker (as it reuse the content
    of the previous file in place of the current one).
    
    Additionally, even though it shouldn't happen, if a content is
    missing completely (ie. neither know nor skipped), it's still
    possible to have a None status.

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

ardumont accepted this revision.Fri, Sep 4, 11:32 AM
This revision is now accepted and ready to land.Fri, Sep 4, 11:32 AM