Page MenuHomeSoftware Heritage

Add type annotations to swh.loader.git.loader
ClosedPublic

Authored by olasd on May 27 2020, 3:18 PM.

Details

Summary

Depends on D3181.

Test Plan

mypy happiness

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, 3:18 PM

Build is green

Patch application report for D3182 (id=11315)

Could not rebase; Attempt merge onto b96849a6a2...

Updating b96849a..c9ef304
Fast-forward
 swh/loader/git/loader.py | 367 ++++++++++++++++++++---------------------------
 1 file changed, 156 insertions(+), 211 deletions(-)
Changes applied before test
commit c9ef3041a370268f54dca9a73b3c8a722714e27d
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed May 27 15:15:24 2020 +0200

    Add type annotations to swh.loader.git.loader

commit 6d0711f562c68fc503cc4d332a8653a67921ddb4
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/7/ for more details.

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

Build is green

Patch application report for D3182 (id=11316)

Could not rebase; Attempt merge onto b96849a6a2...

Updating b96849a..966f98c
Fast-forward
 swh/loader/git/loader.py | 394 ++++++++++++++++++++++-------------------------
 1 file changed, 182 insertions(+), 212 deletions(-)
Changes applied before test
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/8/ for more details.

This revision was automatically updated to reflect the committed changes.