Skip to content

chore: enable notification feature by default#38073

Merged
AhtishamShahid merged 4 commits intomasterfrom
ahtisham/enable_notifications_by_default
Mar 24, 2026
Merged

chore: enable notification feature by default#38073
AhtishamShahid merged 4 commits intomasterfrom
ahtisham/enable_notifications_by_default

Conversation

@AhtishamShahid
Copy link
Contributor

This pull request refactors the feature flag logic for notifications and email notifications throughout the codebase. The main change is switching from "enable" waffle flags (e.g., ENABLE_NOTIFICATIONS, ENABLE_EMAIL_NOTIFICATIONS) to "disable" waffle flags (e.g., DISABLE_NOTIFICATIONS, DISABLE_EMAIL_NOTIFICATIONS). This means that the features are now enabled by default unless explicitly disabled by the corresponding flag. The update includes changes in both application logic and test cases to use the new flags and invert the logic where necessary.

Key changes include:

Feature flag implementation and usage updates:

  • Replaced ENABLE_NOTIFICATIONS and ENABLE_EMAIL_NOTIFICATIONS with DISABLE_NOTIFICATIONS and DISABLE_EMAIL_NOTIFICATIONS in openedx/core/djangoapps/notifications/config/waffle.py, including updating flag names, documentation, and logic. The new flags now disable the respective features when enabled, instead of enabling them.

  • Updated all application logic in notification and discussion-related tasks to check for the "disable" flags (DISABLE_NOTIFICATIONS, DISABLE_EMAIL_NOTIFICATIONS) and invert the logic accordingly, so features are active unless the flag is enabled.
    Test updates:

  • Refactored all test cases to use the new "disable" flags, removing or inverting any @override_waffle_flag(ENABLE_NOTIFICATIONS, ...) and @override_waffle_flag(ENABLE_EMAIL_NOTIFICATIONS, ...) decorators and logic. Updated assertions to match the new default-enabled behavior.

These changes simplify feature management by making notifications and email notifications enabled by default, and only disabled when the respective "disable" flag is set. This also makes the codebase more consistent and easier to reason about.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants