storage: origin_visit_add: Type and make origin_visit_add return an OriginVisit object
origin_visit_add: Adapt endpoint signature to return OriginVisit
Prior to this commit, there was:
- no signature in the method
- discrepancy between checks on the different backend
origin_visit_add endpoint is now typed
def origin_visit_add(
self, origin_url: str,
date: Union[str, datetime.datetime], type: str) -> OriginVisit:
This also:
- renames appropriately the origin_url parameter (removing 1 FIXME)
- align backend implementations' check which were different
Impacts:
- swh-loader-core!378 (closed): swh-loader-core (runtime)
- swh-loader-svn!195 (closed): swh-loader-svn (runtime)
- swh-web!1000 (closed): swh-web (tests)
- swh-indexer!448 (closed): swh-indexer (tests)
Test Plan
tox
Migrated from D2820 (view on Phabricator)