Page MenuHomeSoftware Heritage

common/utils: Wrap deposits list retrieval in a function
ClosedPublic

Authored by anlambert on Jul 19 2021, 5:29 PM.

Details

Summary

It will enable to exploit those data in the archive coverage widget
implementation to get deposit counts by origins type.

Related to T3127

Diff Detail

Repository
rDWAPPS Web applications
Branch
deposits-list-function
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 22661
Build 35335: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 35334: arc lint + arc unit

Event Timeline

Build is green

Patch application report for D6007 (id=21692)

Rebasing onto f667a87aa9...

Current branch diff-target is up to date.
Changes applied before test
commit c5d441b1a8ec425b995ac72ab2c76c66a496ca1b
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Mon Jul 19 17:18:31 2021 +0200

    common/utils: Wrap deposits list retrieval in a function
    
    It will enable to exploit those data in the archive coverage widget
    implementation to get deposit counts by origins type.
    
    Related to T3127

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

ardumont added a subscriber: ardumont.

lgtm.

Nice, more coverage even!

swh/web/common/utils.py
384

.o0(food for thought)

Seeing this code again, i can't help but think that we need to make that "private" [1] deposit api part a rpc server as we did for all the other modules we have... (as val already pointed out and maybe david before him...)

[1] maybe all the deposit api?

This revision is now accepted and ready to land.Jul 20 2021, 10:21 AM
swh/web/common/utils.py
384

We could expose the private deposit API as an internal RPC service yes, this would remove the use of HTTP basic auth and requests module.
Not a top priority at the moment but this will harmonize with other swh services for sure.