Page MenuHomeSoftware Heritage

Unify factory to use keyword 'postgresql' over deprecated 'local'
ClosedPublic

Authored by ardumont on May 30 2022, 3:18 PM.

Details

Summary

We deprecated the use of "local" everywhere.

And that's preventing the use of other tools which depend on that new convention:

swhworker@scrubber0:~$ swh db --config-file /etc/softwareheritage/scrubber/postgres.yml upgrade scrubber --to-version=2
Usage: swh db upgrade [OPTIONS] MODULE

Error: Invalid value: Configuration cls must be set to 'postgresql' for this command.

I've notified about this in a diff a while back too ¯\_(ツ)_/¯.

Related to T4228

Diff Detail

Repository
rDSCRUB Datastore Scrubber
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Build is green

Patch application report for D7905 (id=28504)

Could not rebase; Attempt merge onto e8935e816b...

Updating e8935e8..d23609d
Fast-forward
 swh/scrubber/__init__.py       |  6 ++++--
 swh/scrubber/db.py             |  2 +-
 swh/scrubber/tests/test_cli.py | 10 +++++-----
 3 files changed, 10 insertions(+), 8 deletions(-)
Changes applied before test
commit d23609deeda215a0cb5dd740fea89e909928326e
Author: Antoine R. Dumont (@ardumont) <antoine.romain.dumont@gmail.com>
Date:   Mon May 30 15:16:37 2022 +0200

    Use postgresql for factory
    
    We deprecated the use of "local" everywhere.
    
    Related to T4228

commit 8f6409eb0e49fba23e5c477b1cd7095600b57a59
Author: Antoine R. Dumont (@ardumont) <antoine.romain.dumont@gmail.com>
Date:   Mon May 30 15:11:26 2022 +0200

    db: Bump to version 2
    
    Related to T4228

See https://jenkins.softwareheritage.org/job/DSCRUB/job/tests-on-diff/41/ for more details.

This revision is now accepted and ready to land.May 30 2022, 3:30 PM
ardumont retitled this revision from Use postgresql for factory to Unify factory to use keyword 'postgresql' over deprecated 'local'.May 30 2022, 3:39 PM

Add tests over the factory change

Build is green

Patch application report for D7905 (id=28505)

Could not rebase; Attempt merge onto e8935e816b...

Updating e8935e8..f21145a
Fast-forward
 swh/scrubber/__init__.py        | 10 ++++++----
 swh/scrubber/db.py              |  2 +-
 swh/scrubber/tests/test_cli.py  | 10 +++++-----
 swh/scrubber/tests/test_init.py | 33 +++++++++++++++++++++++++++++++++
 4 files changed, 45 insertions(+), 10 deletions(-)
 create mode 100644 swh/scrubber/tests/test_init.py
Changes applied before test
commit f21145a901aa2f86f8e4deb331089024b08b0ccc
Author: Antoine R. Dumont (@ardumont) <antoine.romain.dumont@gmail.com>
Date:   Mon May 30 15:16:37 2022 +0200

    Unify factory to use keyword 'postgresql' over deprecated 'local'
    
    We migrated away from "local" a while back.
    
    Related to T4228

commit 8f6409eb0e49fba23e5c477b1cd7095600b57a59
Author: Antoine R. Dumont (@ardumont) <antoine.romain.dumont@gmail.com>
Date:   Mon May 30 15:11:26 2022 +0200

    db: Bump to version 2
    
    Related to T4228

See https://jenkins.softwareheritage.org/job/DSCRUB/job/tests-on-diff/42/ for more details.