-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/openedx/edx-enterprise in…
…to hamza/ENT-5039
- Loading branch information
Showing
26 changed files
with
819 additions
and
590 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
Waffle-based feature flags for Enterprise | ||
========================================= | ||
|
||
Status | ||
------ | ||
|
||
Accepted (September 2023) | ||
|
||
Context | ||
------- | ||
|
||
Enterprise typically uses environment configuration to control feature flags for soft/dark releases. For micro-frontends, this control involves environment variables that are set at build time and used to compile JavaScript source or configuration settings derived from the runtime MFE configuration API in edx-platform. For backend APIs, this control typically either involves configuration settings or, on occasion, a Waffle flag. | ||
|
||
By solely relying on environment configuration, we are unable to dynamically control feature flags in production based on the user's context. | ||
|
||
For example, we may want to enable a feature for all staff users but keep it disabled for customers/users while it's in development. Similarly, we may want to enable a feature for a subset of specific users (e.g., members of a specific engineering squad) in production to QA before enabling it for all users. | ||
|
||
However, neither of these are really possible with environment configuration. | ||
|
||
|
||
Decisions | ||
--------- | ||
|
||
We will adopt the Waffle-based approach to feature flags for Enterprise micro-frontends in favor of environment variables or the MFE runtime configuration API. This approach will allow us to have more dynamic and granual control over feature flags in production based on the user's context (e.g., all staff users have a feature enabled, a subset of users have a feature enabled, etc.). | ||
|
||
|
||
Consequences | ||
------------ | ||
|
||
* We are introducing a third mechanism by which we control feature flags in the Enterprise micro-frontends. We may want to consider migrating other feature flags to this Waffle-based approach in the future. Similarly, such an exercise may be a good opportunity to revisit what feature flags exist today and what can be removed now that the associate features are stable in production. | ||
* The majority of the feature flag setup for Enterprise systems lives in configuration settings. By moving more towards Waffle, the feature flag setup will live in databases and modified via Django Admin instead of via code changes. | ||
|
||
|
||
Further Improvements | ||
-------------------- | ||
|
||
* To further expand on the capabilities of Waffle-based feature flags, we may want to invest in the ability to enable such feature flags at the **enterprise customer** layer, where we may be able to enable soft-launch features for all users linked to an enterprise customer without needing to introduce new boolean fields on the ``EnterpriseCustomer`` model. | ||
|
||
Alternatives Considered | ||
----------------------- | ||
|
||
* Continue using the environment variable to enabling feature flags like Enterprise has been doing the past few years. In order to test a disabled feature in production, this approach requires developers to allow the environment variable to be intentionally overridden by a `?feature=` query parameter in the URL. Without the query parameter in the URL, there is no alternative ways to temporarily enable the feature without impacting actual users and customers. Waffle-based feature flags give much more flexibility to developers to test features in production without impacting actual users and customers. | ||
* Exposes a net-new API endpoint specific to returning feature flags for Enterprise needs. This approach was not adopted as it would require new API integrations within both the enterprise administrator and learner portal micro-frontends, requiring users to wait for additional network requests to resolve. Instead, we are preferring to include Waffle-based feature flags on existing API endpoints made by both micro-frontends. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
Your project description goes here. | ||
""" | ||
|
||
__version__ = "4.1.15" | ||
__version__ = "4.3.1" |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Generated by Django 3.2.21 on 2023-09-21 10:07 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('enterprise', '0184_auto_20230914_2057'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='enterprisecustomer', | ||
name='career_engagement_network_message', | ||
field=models.TextField(blank=True, help_text='Message text shown on the learner portal dashboard for career engagement network.'), | ||
), | ||
migrations.AddField( | ||
model_name='enterprisecustomer', | ||
name='enable_career_engagement_network_on_learner_portal', | ||
field=models.BooleanField(default=False, help_text='If checked, the learners will be able to see the link to CEN on the learner portal dashboard.', verbose_name='Allow navigation to career engagement network from learner portal dashboard'), | ||
), | ||
migrations.AddField( | ||
model_name='historicalenterprisecustomer', | ||
name='career_engagement_network_message', | ||
field=models.TextField(blank=True, help_text='Message text shown on the learner portal dashboard for career engagement network.'), | ||
), | ||
migrations.AddField( | ||
model_name='historicalenterprisecustomer', | ||
name='enable_career_engagement_network_on_learner_portal', | ||
field=models.BooleanField(default=False, help_text='If checked, the learners will be able to see the link to CEN on the learner portal dashboard.', verbose_name='Allow navigation to career engagement network from learner portal dashboard'), | ||
), | ||
] |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
""" | ||
Waffle toggles for enterprise features within the LMS. | ||
""" | ||
|
||
from edx_toggles.toggles import WaffleFlag | ||
|
||
ENTERPRISE_NAMESPACE = 'enterprise' | ||
ENTERPRISE_LOG_PREFIX = 'Enterprise: ' | ||
|
||
# .. toggle_name: enterprise.TOP_DOWN_ASSIGNMENT_REAL_TIME_LCM | ||
# .. toggle_implementation: WaffleFlag | ||
# .. toggle_default: False | ||
# .. toggle_description: Enables top-down assignment | ||
# .. toggle_use_cases: open_edx | ||
# .. toggle_creation_date: 2023-09-15 | ||
TOP_DOWN_ASSIGNMENT_REAL_TIME_LCM = WaffleFlag( | ||
f'{ENTERPRISE_NAMESPACE}.top_down_assignment_real_time_lcm', | ||
__name__, | ||
ENTERPRISE_LOG_PREFIX, | ||
) | ||
|
||
|
||
def top_down_assignment_real_time_lcm(): | ||
""" | ||
Returns whether top-down assignment and real time LCM feature flag is enabled. | ||
""" | ||
return TOP_DOWN_ASSIGNMENT_REAL_TIME_LCM.is_enabled() | ||
|
||
|
||
def enterprise_features(): | ||
""" | ||
Returns a dict of enterprise Waffle-based feature flags. | ||
""" | ||
return { | ||
'top_down_assignment_real_time_lcm': top_down_assignment_real_time_lcm(), | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
|
||
|
||
|
||
|
||
# A central location for most common version constraints | ||
# (across edx repos) for pip-installation. | ||
# | ||
|
Oops, something went wrong.