Page MenuHomeSoftware Heritage

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

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



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

Test Plan


Diff Detail

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

Event Timeline

ardumont created this revision.Aug 1 2020, 9:13 AM
ardumont added inline comments.Aug 1 2020, 9:16 AM

^ 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.


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) <>
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 for more details.

ardumont edited the summary of this revision. (Show Details)Aug 1 2020, 9:38 AM
vlorentz accepted this revision.Aug 1 2020, 1:25 PM
This revision is now accepted and ready to land.Aug 1 2020, 1:25 PM