Page MenuHomeSoftware Heritage

RPCServerApp: Add hooks to add behaviors to generated methods
ClosedPublic

Authored by vlorentz on Mar 1 2022, 4:31 PM.

Details

Reviewers
olasd
Group Reviewers
Reviewers
Maniphest Tasks
Restricted Maniphest Task
Commits
rDCOREc98925db248d: RPCServerApp: Add hooks to add behaviors to generated methods
Summary

This will be used by the objstorage (and possibly the storage as well)
to publish metrics to statsd.

Diff Detail

Event Timeline

Build is green

Patch application report for D7271 (id=26331)

Could not rebase; Attempt merge onto 9c9475f769...

Updating 9c9475f..526dc6c
Fast-forward
 swh/core/api/__init__.py                     | 56 ++++++++++++++++++++++++----
 swh/core/api/tests/test_rpc_client_server.py |  2 +-
 2 files changed, 49 insertions(+), 9 deletions(-)
Changes applied before test
commit 526dc6c83c674c40e9ba39e4ea0a8f29e2e68034
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Tue Mar 1 15:52:53 2022 +0100

    RPCServerApp: Add hooks to add behaviors to generated methods
    
    This will be used by the objstorage (and possibly the storage as well)
    to publish metrics to statsd.

commit a2af8c667e32e0523ae371506abc5aa0d11a85f8
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Tue Mar 1 15:04:44 2022 +0100

    RPCClient: Make methods {get,post}{,_stream} protected
    
    I want to make swh-objstorage inherit from RPCClient, but its get() and get_stream()
    methods would class with RPCClient's.

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

olasd added a subscriber: olasd.

Looks useful, thanks.

swh/core/api/__init__.py
455

"applied to all methods generated from the backend class", rather?

This revision is now accepted and ready to land.Mar 1 2022, 4:41 PM
swh/core/api/__init__.py
455

*shrug*

Build is green

Patch application report for D7271 (id=26333)

Could not rebase; Attempt merge onto 9c9475f769...

Updating 9c9475f..c98925d
Fast-forward
 swh/core/api/__init__.py                     | 56 ++++++++++++++++++++++++----
 swh/core/api/tests/test_rpc_client_server.py |  2 +-
 2 files changed, 49 insertions(+), 9 deletions(-)
Changes applied before test
commit c98925db248d56d74d2b9e10569383ee70812c30
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Tue Mar 1 15:52:53 2022 +0100

    RPCServerApp: Add hooks to add behaviors to generated methods
    
    This will be used by the objstorage (and possibly the storage as well)
    to publish metrics to statsd.

commit a2af8c667e32e0523ae371506abc5aa0d11a85f8
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Tue Mar 1 15:04:44 2022 +0100

    RPCClient: Make methods {get,post}{,_stream} protected
    
    I want to make swh-objstorage inherit from RPCClient, but its get() and get_stream()
    methods would class with RPCClient's.

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

vlorentz added a task: Restricted Maniphest Task.Mar 1 2022, 5:26 PM