Page MenuHomeSoftware Heritage

storage*: Adapt origin_list(...) -> PagedResult[Origin]
ClosedPublic

Authored by ardumont on Thu, Jul 30, 2:32 PM.

Details

Summary

Type, unify and simplify the code.

Related to T645

Test Plan

tox

Diff Detail

Repository
rDSTO Storage manager
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

ardumont created this revision.Thu, Jul 30, 2:32 PM

Build is green

Patch application report for D3650 (id=12856)

Could not rebase; Attempt merge onto b81f928fa7...

Updating b81f928f..4d52fc1d
Fast-forward
 swh/storage/algos/origin.py              | 34 ++++++++++-
 swh/storage/algos/snapshot.py            | 47 ++++++++++++++-
 swh/storage/cassandra/storage.py         | 29 ++++++----
 swh/storage/db.py                        |  7 ++-
 swh/storage/in_memory.py                 | 28 ++++-----
 swh/storage/interface.py                 | 13 ++---
 swh/storage/storage.py                   | 33 +++++------
 swh/storage/tests/algos/test_origin.py   | 98 +++++++++++++++++++++++++++++++-
 swh/storage/tests/algos/test_snapshot.py | 64 ++++++++++++++++++++-
 swh/storage/tests/test_storage.py        | 13 ++---
 10 files changed, 304 insertions(+), 62 deletions(-)
Changes applied before test
commit 4d52fc1d076f26ba8aa6c4da7e4e30008a368df0
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu Jul 30 14:32:20 2020 +0200

    storage*: Adapt origin_list(...) -> PagedResult[Origin]
    
    Related to T645

commit 7beba93a970231e044d48b21491d7c0dbbd43116
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu Jul 30 09:58:40 2020 +0200

    algos.snapshot: Open snapshot_id_get_from_revision
    
    This leverages the latest change in origin_visit_get and
    origin_visit_status_get to iterate over visit and visit status to detect a
    snapshot targetting a revision.
    
    This algo got used recently in the deposit. It may serve again.
    
    Related to T645

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

vlorentz accepted this revision.Thu, Jul 30, 3:42 PM
This revision is now accepted and ready to land.Thu, Jul 30, 3:42 PM