Improve the config-id parameter support
It seems there is something wrong with the config-id
support on the cli.
For example, in production:
swh-scrubber=> select * from datastore;
id | package | class | instance
------+---------+------------+-------------------------------------------------------------------------------------------------------
1 | storage | postgresql | user=xxx password=xxx dbname=softwareheritage host=db.internal.softwareheritage.org port=5432
4997 | storage | postgresql | user=xxx password=xxx dbname=softwareheritage host=somerset.internal.softwareheritage.org port=5432
(2 rows)
swh-scrubber=> select * from check_config where name ='check-config-directory';
id | datastore | object_type | nb_partitions | name | comment
----+-----------+-------------+---------------+------------------------+---------
9 | 1 | directory | 16384 | check-config-directory |
13 | 4997 | directory | 16384 | check-config-directory |
(2 rows)
When a config-id is not provided in the command line the scrubber will silently choose the first datastore in cli.py and fail after the first call to get_datastore. It seems the integrity is very weak.
Is this config-id really mandatory or couldn't we always use the datastore instance connection string as an "entrypoint" of the configuration?