Page MenuHomeSoftware Heritage

loader: Compute contents diff when detecting trees divergence
ClosedPublic

Authored by anlambert on Dec 5 2022, 1:33 PM.

Details

Summary

In debug mode, when a hash tree computation divergence is detected after
replaying a revision, compute and display the diff between contents to
facilitate debugging of those type of issues.

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 D8913 (id=32121)

Rebasing onto e35f800a42...

Current branch diff-target is up to date.
Changes applied before test
commit 2b80484b8b70ce9cdc5d5b8fc607c97e44667862
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Mon Dec 5 13:28:53 2022 +0100

    loader: Compute contents diff when detecting trees divergence
    
    In debug mode, when a hash tree computation divergence is detected after
    replaying a revision, compute and display the diff between contents to
    facilitate debugging of those type of issues.

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

ardumont requested changes to this revision.Dec 5 2022, 2:37 PM
ardumont added a subscriber: ardumont.

Good idea but you need to update that conditional.

swh/loader/svn/loader.py
335

Given the following instructions seem expensive (svn export, diff computation, ...) you probably want to check the logging level against debug too (in the conditional).

Otherwise, you the diff computation ends up being unused.

This revision now requires changes to proceed.Dec 5 2022, 2:37 PM
swh/loader/svn/loader.py
335

I think that's ^

swh/loader/svn/loader.py
335

That code path is only executed when setting the debug parameter of the loader to True so we are good here.

This revision is now accepted and ready to land.Dec 5 2022, 3:43 PM