Page MenuHomeSoftware Heritage

model: Allow unresolved branches when computing Snapshot hash
Needs ReviewPublic

Authored by vlorentz on Fri, Aug 5, 2:23 PM.

Details

Reviewers
None
Group Reviewers
Reviewers
Maniphest Tasks
Restricted Maniphest Task
Summary

This is needed by swh-scrubber when recomputing the hash of such snapshots.

Depends on D8201.

Resolves T4425.

Diff Detail

Repository
rDMOD Data model
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 30658
Build 47936: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 47935: arc lint + arc unit

Event Timeline

Build is green

Patch application report for D8202 (id=29594)

Could not rebase; Attempt merge onto 79ed550546...

Updating 79ed550..3d97db6
Fast-forward
 swh/model/git_objects.py            | 6 ++++--
 swh/model/model.py                  | 4 +++-
 swh/model/tests/test_identifiers.py | 8 +++++++-
 3 files changed, 14 insertions(+), 4 deletions(-)
Changes applied before test
commit 3d97db622ce5bb702f0bd46e8fe3234ae8f8d670
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Fri Aug 5 14:22:58 2022 +0200

    model: Allow unresolved branches when computing Snapshot hash
    
    This is needed by swh-scrubber when recomputing the hash of such snapshots.

commit 525dfeee2af2393c40ceb4b3990bcc6da4668dc0
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Fri Aug 5 14:20:38 2022 +0200

    Add parameter 'ignore_unresolved' to snapshot_git_object
    
    It allows building a snapshot manifest despite some branches being
    unresolved (instead of raising an error).
    
    This feature was removed in 57ae405d312879bec19107d29a20c2c290d7861d
    but in the end, Snapshot.compute_hash() will need to use it so that
    swh-scrubber does not crash when checksum such snapshots.

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