Page MenuHomeSoftware Heritage

Use dulwich instead of shelling out to git in the basic git loader tests
ClosedPublic

Authored by olasd on May 27 2020, 5:23 PM.

Details

Summary

Depends on D3182.

Test Plan

tox tests updated

Diff Detail

Repository
rDLDG Git loader
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

olasd created this revision.May 27 2020, 5:23 PM

Build is green

Patch application report for D3183 (id=11317)

Could not rebase; Attempt merge onto b96849a6a2...

Updating b96849a..8e35f63
Fast-forward
 swh/loader/git/loader.py               | 394 +++++++++++++++------------------
 swh/loader/git/tests/test_from_disk.py |  90 +++++---
 2 files changed, 239 insertions(+), 245 deletions(-)
Changes applied before test
commit 8e35f633df6590296b87e75c4cb2b990d9dc1658
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed May 27 17:03:02 2020 +0200

    Use dulwich instead of shelling out to git in the basic git loader tests

commit 966f98c38fc223e64f357ef30ec5a3d325ec12d7
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed May 27 15:15:24 2020 +0200

    Add type annotations to swh.loader.git.loader

commit 6605ee3f047796c4b3f4b418348229fbd6beac9c
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed May 27 14:58:15 2020 +0200

    Only use the previous (base) snapshot as reference for incremental loads
    
    The old behavior would find any object with a matching sha1_git from the archive
    to use as a reference point in the generated snapshot. While there's no known
    sha1_git collisions in the wild, this behavior is inconsistent with other
    loaders.
    
    This removes the only reason to keep the `object_find_by_sha1_git` api in storage.

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

ardumont accepted this revision.May 27 2020, 5:47 PM
This revision is now accepted and ready to land.May 27 2020, 5:47 PM