feat: implement feed url updated notification#1739
Open
davidgamez wants to merge 20 commits into
Open
Conversation
davidgamez
commented
Jun 23, 2026
|
|
||
| logger = logging.getLogger(__name__) | ||
|
|
||
| _DEFAULT_SENDER_EMAIL = "noreply@mobilitydatabase.org" |
Member
Author
There was a problem hiding this comment.
[out-of-scope]: Configurations should be more dynamic, avoiding the need for redeployment when they are changed.
davidgamez
commented
Jun 23, 2026
| return get_rate_limiter(_BREVO_RATE_LIMITER_NAME, _configured_brevo_rps()) | ||
|
|
||
|
|
||
| _DIGEST_EMAIL_SUBJECT_DICTIONARY = { |
Member
Author
There was a problem hiding this comment.
[out-of-scope]: internationalization messages
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.
Summary:
This PR introduces the feed URL update notification. The URL update notification has two variants: URL replacement and feed redirect. Added helpers to emit notifications, rate limiting, and Brevo integration.
Expected behavior:
feed.url_updated => feed_redirectedevent is logged into the notification_event tablefeed.url_updated => url_replacedevent is logged into the notification_event table.Testing tips:
[Internal team]
For integrated tests, use DEV environment. As the notification endpoints are not implemented, notification-related entities need to be created via SQL.
notification_subscriptiontable; replace with the target user id(REPLACE_ME_WITH_USER_ID)notifications_dispatch_plantask from retool(DEV)rawemail(not from a template)From our AI friend
This pull request introduces several improvements and new features to the notification system and environment configuration for database update workflows. The main changes include the addition of a generic rate limiter utility, enhancements to notification event emission for feed updates and redirects, and the introduction of more flexible environment variable handling for user databases in CI/CD workflows.
Key changes:
Notification System Enhancements
notification_constants.py, which defines namespaced string constants for notification types, event subtypes, cadences, statuses, sources, and feed roles, improving maintainability and reducing magic strings throughout the notification codebase.__init__.pyin theshared.notificationspackage, clarifying the available exports and their purposes.Notification Event Emission in Database Population Scripts
populate_db_gtfs.pyandpopulate_db_gbfs.pyto emit notification events when a feed's producer URL is replaced or when a feed is redirected. This enables downstream systems to react to important feed changes and improves auditability. [1] [2] [3] [4] [5]Utility Improvements
rate_limiter.py) with a process-wide registry, allowing consistent and testable rate limiting for outbound API calls across the codebase.CI/CD Workflow Improvements
db-update-content.yml,catalog-update.yml) to support a separateUSER_DB_ENVIRONMENTvariable, allowing the user database environment to be configured independently from the main DB environment. This is particularly useful for development setups that share infrastructure. [1] [2] [3]These changes collectively improve the robustness, configurability, and observability of both the notification system and deployment workflows.
Please make sure these boxes are checked before submitting your pull request - thanks!
./scripts/api-tests.shto make sure you didn't break anything