Feature Flags for SMS Queueing (Rate Limiter)#2827
Draft
Conversation
… we can validate how the messages should be directed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new "SMS control lane" feature, allowing all SMS notifications to be routed through a single fair queue (
send-sms-fair) when theFF_SMS_CONTROL_LANEfeature flag is enabled. This helps centralize SMS delivery and provides more granular control over SMS traffic. The changes include updates to queue selection logic, task dispatching, queue definitions, and tests to support and verify this new behavior.Core features and logic for SMS control lane:
SEND_SMS_FAIR, toQueueNamesand included it in all queue lists and Celery worker scripts. [1] [2] [3] [4]FF_SMS_CONTROL_LANEfeature flag inConfigto enable or disable the SMS control lane.choose_queue,choose_deliver_task, and related functions to route SMS notifications toSEND_SMS_FAIRwhen the flag is enabled, except for research mode. [1] [2] [3] [4] [5] [6]deliver_sms_fairtask and logic to assign aMessageGroupIdfor ordering. [1] [2] [3]MessageGroupIdis set based on service or notification ID, both in direct and job-based notification flows. [1] [2]Testing and validation:
MessageGroupIdwhen the control lane is enabled, and that legacy tasks delegate properly. [1] [2] [3] [4] [5] [6] [7]Miscellaneous:
mypy.inito specify a cache directory for type checking.These changes collectively enable a configurable, centralized SMS delivery mechanism, improve queue management, and ensure robust testing for the new functionality.
Related Issues | Cartes liées
https://app.zenhub.com/workspaces/notify-planning-core-6411dfb7c95fb80014e0cab0/issues/gh/cds-snc/notification-planning-core/786
Reviewer checklist | Liste de vérification du réviseur