Page MenuHomeSoftware Heritage

storage*: Do not allow unknown visit status in origin_visit*_get_latest
ClosedPublic

Authored by ardumont on Aug 1 2020, 9:13 AM.

Details

Summary

Without this, that made some storage (pg-storage) fail.

As a future plan, make the VISIT_STATUSES an enum (and also most probably make
the OriginVisitStatus.status field an enum as well).

That touches too many clients to change it right now though. I'll do it later.

This also fixes hidden problems on tests which used the in-memory storage
(algos.test_origins).

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

swh/storage/tests/algos/test_origin.py
148

^ those are ignored with pg implem because they end up being the same id (origin, visit, date) as the visit status created by origin-visit-add.

370–371

This endpoint was not the correct one... ¯\_(ツ)_/¯
The new one does not return anything.

Build is green

Patch application report for D3680 (id=12959)

Rebasing onto 92f1183de0...

Current branch diff-target is up to date.
Changes applied before test
commit 87c5ba223508b212ed6939496a6380a771b05e43
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Sat Aug 1 09:07:12 2020 +0200

    storage*: Do not allow unknown visit status in origin_visit*_get_latest
    
    That makes some storage (pg-storage) fail without that filtering.

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

This revision is now accepted and ready to land.Aug 1 2020, 1:25 PM