-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MagpieAdapter request/response hooks #517
Conversation
Codecov Report
@@ Coverage Diff @@
## master #517 +/- ##
==========================================
+ Coverage 80.27% 80.44% +0.17%
==========================================
Files 71 72 +1
Lines 9615 9749 +134
Branches 1323 1348 +25
==========================================
+ Hits 7718 7843 +125
+ Misses 1597 1595 -2
- Partials 300 311 +11
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, some minor comments to check, but that's it!
…tions + load service settings by MagpieAdapter since run on Twitcher side + improve typing
… workspace directory (relates to Ouranosinc/Magpie#517 and bird-house/twitcher#114)
538d13a
to
a6917ce
Compare
Blocked by release pending bird-house/twitcher#114 (comment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks good in that implementation! Very versatile.
As discussed, to be 100% flexible, a new hook should be included in twitcher to literally allow to override the _send_request method which is not really generic.
If you're worried about messing with the current implementation you could literally keep it as is in the default twitcher implementation, but allow MagpieAdapter to define it's own.
Summary
The main purpose is presented here: https://github.com/Ouranosinc/Magpie/pull/517/files#diff-1c805585a74c7c16218b333063aed89c528c90d8ec5aa76257a1e248eda0a10fR139-R155
Using this config, pointing at file https://github.com/Ouranosinc/Magpie/blob/request-hooks/tests/hooks/request_hooks.py,
MagpieAdapter
would add theX-WPS-Output-Context
header in the request sent during job creation toward Weaver using the requesting user ID, effectively producing the WPS-outputs in its user directory.Changes
Service
configuration (providers.cfg
).hooks
section under eachService
definition of theproviders.cfg
or combined configurationfile that allows pre/post request/response processing operations using plugin Python scripts.
Service
configuration inmagpie.services
settings for later access tohooks
definitionsby the
MagpieAdapter
.webhooks
section stored in settings tomagpie.webhooks
to avoid possible name clashes.References
WIP
hooks