We were attempting to add course overrides twice to objects returned in
the toggle state report view. This was causing a TypeError (and thus a
500 error) because the second time, we were attempting to add entries to
an incorrect object.
This issue was not caught by unit tests because we were not testing the
view with WaffleFlagCourseOverride objects. This commit adds a unit test
to prevent future errors.
This is another fix for PR #27108.
BREAKING CHANGE: Remove WaffleSwitchNamespace, WaffleSwitch, WaffleFlagNamespace,
and WaffleFlag from waffle_utils, in favor of the Legecy* classes
in edx-toggles. Although this is a breaking change, we have
preemptively removed all known uses.
BD-21
The toggle state report could not be shared with other IDAs. Here we make use
of the newly available report from edx_toggles, and customize it to add data
from WaffleFlagCourseOverrideModel.
django-not-configured is an error raised by pylint (with
the pylint-django plugin) when it's not correctly configured.
We should not be applying lint amnesty for such a violation.
It was finally decided not to use `skip_namespace_assertion` optional
arguments, but `NonNamespacedWaffle*` classes. We update the ADR to reflect
this change.
The WAFFLE_FLAG_CUSTOM_ATTRIBUTES setting and the WaffleFlag.set_monitor_value
method are soon going to be deprecated in edx-toggles. This is going to be done
in a backward-compatible manner, but we'd better be safe by removing references
to these objects early.
Waffle classes no longer have namespaces. All features are moved to the
WaffleFlag/WaffleSwitch classes.
Here we use the edx_toggles.toggles.__future__ API, which is available
in 1.2.0. This means that we don't have to upgrade edx-toggles. We
should remove the __future__ imports as soon as we upgrade to 2.0.0.
By explicitly importing the legacy namespace classes, we make it clear
that we are using soon-to-be-deprecated classes. We will then be able to
start removing the legacy classes, one module at a time.
* Generate common/djangoapps import shims for LMS
* Generate common/djangoapps import shims for Studio
* Stop appending project root to sys.path
* Stop appending common/djangoapps to sys.path
* Import from common.djangoapps.course_action_state instead of course_action_state
* Import from common.djangoapps.course_modes instead of course_modes
* Import from common.djangoapps.database_fixups instead of database_fixups
* Import from common.djangoapps.edxmako instead of edxmako
* Import from common.djangoapps.entitlements instead of entitlements
* Import from common.djangoapps.pipline_mako instead of pipeline_mako
* Import from common.djangoapps.static_replace instead of static_replace
* Import from common.djangoapps.student instead of student
* Import from common.djangoapps.terrain instead of terrain
* Import from common.djangoapps.third_party_auth instead of third_party_auth
* Import from common.djangoapps.track instead of track
* Import from common.djangoapps.util instead of util
* Import from common.djangoapps.xblock_django instead of xblock_django
* Add empty common/djangoapps/__init__.py to fix pytest collection
* Fix pylint formatting violations
* Exclude import_shims/ directory tree from linting
We observe a lot of deprecation warnings using the
"deprecated_waffle_utils" custom attribute. To make it easier to track
these items, we add the waffle flag/namespace name to the custom
attribute.
Tests were referring to internal implementation
details of edx-django-utils. This comment removes
those references to free the library up to be
refactored.
ARCHBOM-1584
When module_name is None, the call to edx-django-utils'
get_code_owner_from_module crashes. So we avoid making that call when
the module_name is None, which sometimes happens (for good reasons or
not, but it's valid behaviour).
- Add ADR for the extraction of waffle_utils to
edx-toggles to reuse across IDAs.
- Add ADR for temporarily leaving CourseWaffleFlag
in edx-platform in order to simplify extraction.
- Add ADR for simplifying the interface for
WaffleFlag and WaffleSwitch by removing the
Namespace classes.
ARCHBOM-1339
Co-authored-by: Feanil Patel <feanil@edx.org>
This changes:
- `WAFFLE_FLAG_CUSTOM_METRICS`
- `WaffleFlagNamespace._set_waffle_flag_metric`
- `_get_waffle_flag_custom_metrics_set` and some other unreferenced
internals
This uses the new names introduced in edx-django-utils
3.8.0 (edx/edx-django-utils#59), which we're already using, as
well as updating a few other locations where we incorrectly refer
to New Relic custom metrics instead of custom attributes.
Includes a couple of unrelated lint fixes in a file I modified.