db.BaseDb: Propose default get_current_version method implementation
This:
- documents what this method is about in the code (only in documentation so far)
- adds a missing test on the cli
swh db version
to check this behaves appropriately - will allow to clean up duplicated code in existing backends (storage, indexer) [2] [3]
- will allow to fix the backends which are missing the appropriate methods (scheduler
- [4], scrubber, vault, see [1]'s description for details...)
Related to swh/infra/sysadm-environment#4228 (closed) Depends on !326 (closed) (revert of [1]) This is the proper fix instead of [1].
-
[1] !324 (closed)
-
[3] https://forge.softwareheritage.org/source/swh-indexer/browse/master/swh/indexer/storage/init.py$155-157
-
[4] https://forge.softwareheritage.org/source/swh-scheduler/browse/master/swh/scheduler/backend.py$76-78
Migrated from D7949 (view on Phabricator)