Page MenuHomeSoftware Heritage

Write 'original_artifact' metadata to the extrinsic metadata storage.
ClosedPublic

Authored by vlorentz on Aug 14 2020, 6:12 PM.

Details

Summary

In addition to writing them on revisions, for now.

The authority is Software Heritage itself, because hashes and length are
computed by the loader, not the origin of the package.

Depends on D3797.

Diff Detail

Repository
rDLDBASE Generic VCS/Package Loader
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 D3798 (id=13380)

Could not rebase; Attempt merge onto 2423266fbb...

Auto-merging swh/loader/package/loader.py
Merge made by the 'recursive' strategy.
 swh/loader/package/loader.py                     | 74 +++++++++++++++++-------
 swh/loader/package/tests/test_loader_metadata.py | 71 +++++++++++++++++++++--
 2 files changed, 118 insertions(+), 27 deletions(-)
Changes applied before test
commit 80a8a483321e33bb53cfb675d6b99fc07320842a
Merge: 2423266 e45c2dd
Author: Jenkins user <jenkins@localhost>
Date:   Fri Aug 14 16:13:06 2020 +0000

    Merge branch 'diff-target' into HEAD

commit e45c2dde0551ee914c94164a9d7074db756a63d7
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Fri Aug 14 18:12:30 2020 +0200

    Write 'original_artifact' metadata to the extrinsic metadata storage.
    
    In addition to writing them on revisions, for now.
    
    The authority is Software Heritage itself, because hashes and length are
    computed by the loader, not the origin of the package.

commit 7d567d6bb81675fa1829e2635d3c45fc2366da56
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Fri Aug 14 18:10:04 2020 +0200

    Move parts of _load_revision to a new _load_directory method.
    
    It makes the function less big, and a future commit's tests will need to
    override _load_directory to test the rest of _load_revision.

commit 500a42a143d180680e483e5c6a27bebb60a8add1
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Fri Aug 14 17:40:33 2020 +0200

    tests: Don't use naive datetimes.
    
    This is incorrect, and will become an error with the next version of swh-model.

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

anlambert added a subscriber: anlambert.
anlambert added inline comments.
swh/loader/package/loader.py
548

Nitpick, you can use the swh.model.model.REVISION constant instead of literal string here.

This revision is now accepted and ready to land.Aug 17 2020, 12:09 PM
swh/loader/package/loader.py
548

Indeed. but the other calls to SWHID in that files use a literal string so I'll leave it like this for now, for the sake of consistency

Build is green

Patch application report for D3798 (id=13389)

Rebasing onto 504ef6938e...

Current branch diff-target is up to date.
Changes applied before test
commit b0a6dfcbc31cc992c4acb7ba7cbbf74b5f1e503b
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Fri Aug 14 18:12:30 2020 +0200

    Write 'original_artifact' metadata to the extrinsic metadata storage.
    
    In addition to writing them on revisions, for now.
    
    The authority is Software Heritage itself, because hashes and length are
    computed by the loader, not the origin of the package.

commit 5ea22d224fa8b51711e19a9366fc0f51b4d3d35c
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Fri Aug 14 18:10:04 2020 +0200

    Move parts of _load_revision to a new _load_directory method.
    
    It makes the function less big, and a future commit's tests will need to
    override _load_directory to test the rest of _load_revision.

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