Page MenuHomeSoftware Heritage

loader: Do not raise error when reloading a repo not fully ingested
ClosedPublic

Authored by anlambert on Dec 7 2021, 6:00 PM.

Details

Summary

When a subversion repository did not get fully ingested during a first
load (an error occurred when processing a revision that stopped the
loading), trying to reloading it again will raise a ValueError instead
of generating the same snapshot as the previous visit.

So ensure to initialize the _snapshot and _last_revision class member
of the loader to the latest loaded snapshot and revision if they exist
to avoid raising an error and generate an uneventful visit.

Fixes SWH-LOADER-SVN-1P.

Diff Detail

Repository
rDLDSVN Subversion (SVN) 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 D6778 (id=24598)

Rebasing onto d8c5e8095f...

Current branch diff-target is up to date.
Changes applied before test
commit fffd2c45ec4fdff6b3dbc1dfc07d071ea0c75144
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Tue Dec 7 17:51:30 2021 +0100

    loader: Do not raise error when reloading a repo not fully ingested
    
    When a subversion repository did not get fully ingested during a first
    load (an error occurred when processing a revision that stopped the
    loading), trying to reloading it again will raise a ValueError instead
    of generating the same snapshot as the previous visit.
    
    So ensure to initialize the _snapshot and _last_revision class member
    of the loader to the latest loaded snapshot and revision if they exist
    to avoid raising an error and generate an uneventful visit.

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

ardumont added a subscriber: ardumont.

That makes more sense indeed.

Thanks.

This revision is now accepted and ready to land.Dec 7 2021, 6:05 PM