-
Notifications
You must be signed in to change notification settings - Fork 429
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
feat: Add backoff to webhooks, and call multiple webhooks async #2559
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@tushar5526 is attempting to deploy a commit to the Flagsmith Team on Vercel. A member of the Team first needs to authorize it. |
Uffizzi Preview |
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.
Thanks for submitting this @tushar5526. I have added a couple of specific comments, but I'd also love to see some tests written for these too. It seems like perhaps we don't have any currently (otherwise I would have expected them to fail), but if you are able to add some, that would be really great.
Hi @matthewelwell, I modified the logic to use |
No, we can ignore the case where the organisation is deleted. |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #2559 +/- ##
=======================================
Coverage 95.51% 95.51%
=======================================
Files 993 993
Lines 27971 28023 +52
=======================================
+ Hits 26717 26767 +50
- Misses 1254 1256 +2
☔ View full report in Codecov by Sentry. |
I've created this PR to validate the arguments that are passed to task processor functions both when called directly, or when executed synchronously. This should help to ensure that all new tasks adhere to the serialization rules. Based on this, in terms of this PR, I don't think there is any additional logic required. I will review for a final time and then, once my separate PR is merged, we can merge it here and re run the tests as a final check. Hopefully that all makes sense? |
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.
This looks good to me, but I'd appreciate another pair of eyes from @gagantrivedi or @khvn26 before merging.
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.
LGTM, apart from Minor test improvements
Closes #1654
Thanks for submitting a PR! Please check the boxes below:
pre-commit
to check lintingChanges
Significant changes include calling
call_environment_webhooks
andcall_organisation_webhooks
using the task processor and making_call_webhook_email_on_error
async so that any unhealthy webhook in the list does not block sending payload to other webhooks.I have also added
backoff
andjitter
to_call_webhook
with3
retries and using amax_time
of2s
so that threads are not marked unhealthy by the task processor's healthcheck.How did you test this code?
I ran unit tests and set up two endpoints as webhooks for testing. Next, I created a feature flag and added those webhooks to it. I then called those webhooks by toggling the feature and tested for various combinations.