Skip to content
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

Merged

Conversation

zachaysan
Copy link
Contributor

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.

@zachaysan zachaysan requested a review from a team as a code owner July 15, 2024 15:46
@zachaysan zachaysan requested review from khvn26 and removed request for a team July 15, 2024 15:46
Copy link

vercel bot commented Jul 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 25, 2024 2:04pm
flagsmith-frontend-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 25, 2024 2:04pm
flagsmith-frontend-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 25, 2024 2:04pm

@zachaysan zachaysan requested review from matthewelwell and removed request for khvn26 July 15, 2024 15:46
@github-actions github-actions bot added api Issue related to the REST API feature New feature or request labels Jul 15, 2024
Copy link
Contributor

github-actions bot commented Jul 15, 2024

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-api-test:pr-4338 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-e2e:pr-4338 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-frontend:pr-4338 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-api:pr-4338 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-4338 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-4338 Finished ✅ Results

Copy link
Contributor

github-actions bot commented Jul 15, 2024

Uffizzi Preview deployment-54202 was deleted.

Copy link

codecov bot commented Jul 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.84%. Comparing base (7015b36) to head (c8cd92a).

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.
📢 Have feedback on the report? Share it here.

@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jul 24, 2024
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jul 24, 2024
@@ -47,6 +42,10 @@
STARTUP_V2,
SubscriptionCacheEntity,
)
from .task_helpers import (
_handle_api_usage_notifications,
Copy link
Contributor

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.

Copy link
Contributor Author

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

)


def send_api_usage_notification(
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@github-actions github-actions bot removed the feature New feature or request label Jul 25, 2024
@matthewelwell matthewelwell added this pull request to the merge queue Jul 25, 2024
Merged via the queue into main with commit 114d0c3 Jul 25, 2024
34 checks passed
@matthewelwell matthewelwell deleted the feat/send_users_notification_when_api_flags_have_been_blocked branch July 25, 2024 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issue related to the REST API feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants