-
Notifications
You must be signed in to change notification settings - Fork 1
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
Do not treat handlers actions that have not been implemented as a dispatch failure #78
Do not treat handlers actions that have not been implemented as a dispatch failure #78
Conversation
I'd argue that if a webhook was configured to point at some action leading to an I would prefer the other proposed solution that the concrete implementation does an explicit no-op. It could also log that it was a no-op, so there is some traceability of the invoked handlers and actions performed. The |
Alright, I've updated the concrete classes. Let me know what you think. Also: is debug an appropriate log level? |
Oh wow. I didn't realize there were this many still unimplemented.
Mixed answer. I'd say the ones with The ones under The others with Personally, I would leave |
I'll update the log levels to your suggestions.
Ok but I don't know how you can configure this so that Magpie user/delete doesn't trigger when a user is created/deleted. Is it possible to enable a handler only for certain events but not others? If not, then we'll end up with the exact situation that we're trying to avoid... an error is raised every time a user is created or deleted and Magpie thinks that the webhook failed. |
@mishaschwartz |
Yes I can validate that this is the case. From the cowbird logs when a user is created:
|
https://github.com/Ouranosinc/cowbird/tree/2.5.0 is pushed with the merged PR |
## Overview This update fixes an issue where Magpie reports a webhook failure on almost every action. See a full description of the issue in Ouranosinc/cowbird#78. ## Changes **Non-breaking changes** - New component version Cowbird:2.5.0 **Breaking changes** - None ## Related Issue / Discussion ## Additional Information Links to other issues or sources. ## CI Operations <!-- The test suite can be run using a different DACCS config with ``birdhouse_daccs_configs_branch: branch_name`` in the PR description. To globally skip the test suite regardless of the commit message use ``birdhouse_skip_ci`` set to ``true`` in the PR description. Using ``[<cmd>]`` (with the brackets) where ``<cmd> = skip ci`` in the commit message will override ``birdhouse_skip_ci`` from the PR description. Such commit command can be used to override the PR description behavior for a specific commit update. However, a commit message cannot 'force run' a PR which the description turns off the CI. To run the CI, the PR should instead be updated with a ``true`` value, and a running message can be posted in following PR comments to trigger tests once again. --> birdhouse_daccs_configs_branch: master birdhouse_skip_ci: false
If a handler raises a
NotImplementedError
for a given action, Magpie will consider that a webhook failure.This is misleading because the webhook didn't actually fail, there was simply nothing to do since the action isn't implemented.
This PR changes the webhook dispatcher to treat handler actions that raise
NotImplementedError
s as a noop instead of as an error.For example:
Nginx.user_created
handler is triggered, this method raises aNotImplementedError
which is reported to Magpie as a webhook failure.Other possible solutions to this problem:
NotImplementedError
, concrete implementations of theHandler
class can simplypass
insteadNotImplementedError
, abstract methods in theHandler
class can simplypass
instead (all concrete implementations can then optionally override these methods if needed)