Page MenuHomeSoftware Heritage

converters: Replace '/' with '_' in directory entries
ClosedPublic

Authored by vlorentz on Oct 25 2022, 6:09 PM.

Details

Summary

'/' is very rare, but it is rejected by swh.model, because it would cause
issues in other places (eg. cannot be accessed via the web UI or web API)

This applies the same transformation that T4644#97834 is going to apply
on the 3 existing trees in the archive.

Depends on D8775

Closes T4660

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

Build is green

Patch application report for D8776 (id=31634)

Could not rebase; Attempt merge onto 7324b60ed1...

Updating 7324b60..44f70a7
Fast-forward
 swh/loader/git/converters.py            |  4 +-
 swh/loader/git/tests/test_converters.py | 91 ++++++++++++++++++++++++++-------
 2 files changed, 75 insertions(+), 20 deletions(-)
Changes applied before test
commit 44f70a704eeeed19a0ce125a2f154abe75046f33
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Tue Oct 25 18:08:20 2022 +0200

    converters: Replace '/' with '_' in directory entries
    
    '/' is very rare, but it is rejected by swh.model, because it would cause
    issues in other places (eg. cannot be accessed via the web UI or web API)

commit 4e501c7ba4ac74b0e4383869205e3474260311f2
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Tue Oct 25 18:06:03 2022 +0200

    test_converters: Rename 'raw_manifest' to 'raw_string'
    
    To avoid any confusion, as raw_manifest contains the git header

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

olasd added a subscriber: olasd.

Great, thanks!

This revision is now accepted and ready to land.Oct 25 2022, 6:14 PM