Skip to content

Move deprecated endpoint snapshot_get_latest from api endpoint to algos

This allows to avoid repeating the same pattern of retrieving the last snapshot for a given origin.

Note that this also makes the new function return a Snapshot model object as well.

Impacts only swh-web which I'll deal with [1]

(.../swh-environment) $ grep snapshot_get_latest */swh/**/*.py | grep -v "\btest" | grep -v "swh-storage/swh"
swh-web/swh/web/common/service.py:    snapshot = storage.snapshot_get_latest(origin, allowed_statuses)

Related to T2310

Test Plan

tox


Migrated from D3314 (view on Phabricator)

Merge request reports