-
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: Send users notification when api flags have been blocked #4338
feat: Send users notification when api flags have been blocked #4338
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Docker builds report
|
Uffizzi Preview |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4338 +/- ##
=======================================
Coverage 96.83% 96.84%
=======================================
Files 1165 1166 +1
Lines 38621 38675 +54
=======================================
+ Hits 37398 37453 +55
+ Misses 1223 1222 -1 ☔ View full report in Codecov by Sentry. |
api/organisations/templates/organisations/api_flags_blocked_notification.txt
Outdated
Show resolved
Hide resolved
…on_when_api_flags_have_been_blocked
api/organisations/tasks.py
Outdated
@@ -47,6 +42,10 @@ | |||
STARTUP_V2, | |||
SubscriptionCacheEntity, | |||
) | |||
from .task_helpers import ( | |||
_handle_api_usage_notifications, |
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 shouldn't still be a private function since we're calling it from another module now.
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.
Ok I've renamed it
api/organisations/task_helpers.py
Outdated
) | ||
|
||
|
||
def send_api_usage_notification( |
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 probably can be a private function now?
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.
Sure, I've renamed it.
Changes
Previously, users using the free Flagsmith plan were blocked from using the feature flagging API once they had breach the limit and grace period. With this change, users now get an email notification that their usage is now being blocked.
How did you test this code?
Added tests for the functionality to an existing long test which covered multiple of the possible scenarios.