Page MenuHomeSoftware Heritage

config: Clarify configuration setup client code
ClosedPublic

Authored by ardumont on Tue, Sep 15, 6:36 PM.

Details

Summary

Second part of getting rid of the SWHConfig mixin.
Related to client code now

Related to T1532

Test Plan

tox

Diff Detail

Repository
rDDEP Push deposit
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

ardumont created this revision.Tue, Sep 15, 6:36 PM

Build is green

Patch application report for D3957 (id=13936)

Could not rebase; Attempt merge onto f41a5a6c06...

Updating f41a5a6c..05a4a5f9
Fast-forward
 requirements-swh.txt                           |  2 +-
 swh/deposit/client.py                          | 17 ++-----
 swh/deposit/config.py                          | 47 ++++++++-----------
 swh/deposit/loader/checker.py                  | 26 ++++-------
 swh/deposit/tests/api/test_deposit_schedule.py | 18 +++-----
 swh/deposit/tests/conftest.py                  | 64 +++++++++++++-------------
 swh/deposit/tests/loader/conftest.py           | 37 ++++-----------
 swh/deposit/tests/loader/test_checker.py       |  8 ++--
 swh/deposit/tests/loader/test_tasks.py         | 12 ++---
 9 files changed, 91 insertions(+), 140 deletions(-)
Changes applied before test
commit 05a4a5f9685ec157e7d6aa54e5591d56b3450044
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Sep 15 18:34:38 2020 +0200

    config: Clarify configuration setup client code
    
    Related to T1532

commit fbd84db9424b8f8b2ea102c5f84ef04b78d90b8c
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Sep 15 10:51:37 2020 +0200

    config: Clarify configuration setup for server code
    
    Mixin SWHConfig is deprecated. This unplugs the inheritance to that class which
    has becomes too much complicated to follow.
    
    Related to T1532

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

vlorentz added inline comments.
swh/deposit/tests/loader/conftest.py
24–25

how does the deposit know how to connect to pg in tests, now?

ardumont added inline comments.Wed, Sep 16, 4:16 PM
swh/deposit/tests/loader/conftest.py
24–25

The tests in the "loader" folder don't connect to the db.
Thus why they pass here.

They are passing through the request_mock_datadir fixture and other mocker things.

Note: Historically called "loader/" but it used to be a loader in here, remains only the checker now.

vlorentz accepted this revision.Wed, Sep 16, 4:23 PM
This revision is now accepted and ready to land.Wed, Sep 16, 4:23 PM
ardumont updated this revision to Diff 13991.Wed, Sep 16, 6:50 PM

Rework commit message

Build is green

Patch application report for D3957 (id=13991)

Could not rebase; Attempt merge onto f41a5a6c06...

Updating f41a5a6c..e5eacbbf
Fast-forward
 requirements-swh.txt                           |  2 +-
 swh/deposit/api/private/deposit_read.py        | 24 ----------
 swh/deposit/client.py                          | 17 ++-----
 swh/deposit/config.py                          | 47 ++++++++-----------
 swh/deposit/loader/checker.py                  | 26 ++++-------
 swh/deposit/tests/api/test_deposit_schedule.py | 18 +++-----
 swh/deposit/tests/conftest.py                  | 64 +++++++++++++-------------
 swh/deposit/tests/loader/conftest.py           | 37 ++++-----------
 swh/deposit/tests/loader/test_checker.py       |  8 ++--
 swh/deposit/tests/loader/test_tasks.py         | 12 ++---
 10 files changed, 91 insertions(+), 164 deletions(-)
Changes applied before test
commit e5eacbbf8b3a12def6edb41f3ca4be20e1ba52e6
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Sep 15 18:34:38 2020 +0200

    config: Clarify configuration setup path for the client code
    
    Related to T1532

commit 7f5241191352fcb170ced98bed745827cde63cbd
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Sep 15 10:51:37 2020 +0200

    config: Clarify the configuration setup path for the server part
    
    Mixin SWHConfig is deprecated.
    
    Related to T1532

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