Add course-unawareness option to ExperimentWaffleFlag

For the Courseware MFE rollout experiment, we want users'
default buckets to be consistent across course runs.

ExperimentWaffleFlag advised that this could be done
by calling `.is_enabled(...)` without a course_key argument;
however, doing so breaks when uing the main_flag.BUCKET_NUM
scheme to apply bucket rules for a specific set of users
or courses.

This commit explicitly adds course-unaware-bucketing via
a new kwarg to ExperimentWaffleFlag.__init__ method.

Furthermore, it fixes ExperimentWaffleFlag.is_enabled(course_key=None)
to work as advertised, by means of calling
.is_enabled_without_course_context on its subordinate flags.

TNL-7405
This commit is contained in:
Kyle McCormick
2020-08-06 16:23:00 -04:00
committed by Kyle McCormick
parent 07f96f2bba
commit b05948153a
4 changed files with 156 additions and 20 deletions

View File

@@ -21,7 +21,9 @@ WAFFLE_FLAG_NAMESPACE = WaffleFlagNamespace(name='courseware')
# .. toggle_warnings: Also set settings.LEARNING_MICROFRONTEND_URL and ENABLE_COURSEWARE_MICROFRONTEND.
# .. toggle_tickets: TNL-7000
# .. toggle_status: supported
REDIRECT_TO_COURSEWARE_MICROFRONTEND = ExperimentWaffleFlag(WAFFLE_FLAG_NAMESPACE, 'courseware_mfe')
REDIRECT_TO_COURSEWARE_MICROFRONTEND = ExperimentWaffleFlag(
WAFFLE_FLAG_NAMESPACE, 'courseware_mfe', use_course_aware_bucketing=False
)
# Waffle flag to display a link for the new learner experience to course teams without redirecting students.
#