Page MenuHomeSoftware Heritage

algos.origin: Open origin-get-latest-visit-status function
ClosedPublic

Authored by ardumont on Thu, Jun 18, 1:45 PM.

Details

Summary

This will allow to avoid repeating the same pattern of retrieving the last
visit status for a given origin.

(Allowing to simplify in the process D3301 D3305 D3308 D3306 D3307...)

Note: I also splitted the tests per filter types (type, status, snapshot) for a
better readability [1]

[1] D3311#inline-22849

Related to T2310

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, Jun 18, 1:45 PM

Build is green

Patch application report for D3313 (id=11727)

Could not rebase; Attempt merge onto 822d96b580...

Updating 822d96b..5480b7b
Fast-forward
 swh/storage/algos/origin.py            |  50 ++++++-
 swh/storage/cassandra/storage.py       |   3 +
 swh/storage/db.py                      |  14 +-
 swh/storage/in_memory.py               |   3 +
 swh/storage/interface.py               |   4 +
 swh/storage/storage.py                 |   2 +
 swh/storage/tests/algos/test_origin.py | 237 ++++++++++++++++++++++++++++++++-
 swh/storage/tests/test_storage.py      | 154 +++++++++++++++------
 8 files changed, 422 insertions(+), 45 deletions(-)
Changes applied before test
commit 5480b7b6ca18d8c38158ee54cfb567992461c357
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu Jun 18 13:40:16 2020 +0200

    algos.origin: Open origin-get-latest-visit-status function
    
    This will allow to avoid repeating the same pattern of retrieving the last
    visit status for a given origin.
    
    Related to T2310

commit c49890105e5314500ea0911021088883bf96f0ed
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu Jun 18 10:11:47 2020 +0200

    storage*: Allow origin-visit-get-latest to filter on type

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

olasd accepted this revision.Fri, Jun 19, 10:57 AM
This revision is now accepted and ready to land.Fri, Jun 19, 10:57 AM