Commit Graph

121 Commits

Author SHA1 Message Date
Braden MacDonald
4ca522152f feat: Allow specifying a version when loading a v2 XBlock (#35626) 2024-10-16 08:43:20 -07:00
salmannawaz
57b480b04f Update all edx-platform REST endpoints to support JWT Auth (#34152)
* chore: update API endpoints to support default JWT auth

The default DRF Auth classes were recently updated to allow for both JWT and Session auth by default. Any endpoint that overrides the AUTHENTICATION_CLASSES but has just session, just JWT or just both of those should be updated to remove the override.

Details in https://github.com/openedx/edx-platform/issues/33662
2024-02-13 10:46:58 -05:00
Sarina Canelake
4a2f231302 fix: fix github url strings (org edx -> openedx) 2022-09-15 14:52:28 -04:00
Eugene Dyudyunov
52dd883a3c refactor: delete now unused FutureCourseWaffleFlag (#30367)
Remove temporary FutureCourseWaffleFlag class;
Update ora2 and edx-toggles to versions cleaned from the
LegacyWaffle* classes;
Replace `override_flag`s with `override_waffle_flag`;
Replace `override_switch`s with `override_waffle_switch` (where it's possible).
2022-05-13 08:48:42 -04:00
Eugene Dyudyunov
655e4a344f refactor!: update CourseWaffleFlag (#30351)
BREAKING: get rid of the LegacyWaffle-based CourseWaffleFlag.
Both CourseWaffleFlag and FutureCourseWaffleFlag now use the modern
WaffleFlag as parent class. FutureCourseWaffleFlag left to support ORA
transition to modern waffle.

Switch to the ORA version which supporting new Waffles.
2022-05-10 15:08:59 -04:00
Eugene Dyudyunov
8bd43207ca refactor!: switch from LegacyWaffle* to modern waffles (#30330)
This is a first stage for removing the LegacyWaffle* classes.

LegacyWaffleFlag usage replaced with WaffleFlag;
LegacyWaffleSwitche usage replaced with WaffleSwitch;
New CourseWaffleFlag added to the temporary module __future__ as FutureCourseWaffleFlag;
Updated all the imports to use CourseWaffleFlag from the __future__ module;

BREAKING CHANGE: A number of toggle related constants (e.g. ENABLE_ACCESSIBILITY_POLICY_PAGE)
changed types. They were strings, and are now toggle instances (e.g. WaffleSwitch). Although the entire
refactor should be self-contained in edx-platform, if any plugins or dependencies were directly
using these constants, they will break. If this is the case, try to find a better publicized way of
exposing those toggles.
2022-05-05 12:03:10 -04:00
Robert Raposa
9fa79809d8 refactor: CookieMonitoringMiddleware moved to edx-django-utils
The CookieMonitoringMiddleware and its related script
moved to edx-django-utils.

ARCHBOM-2054
2022-03-17 16:59:00 -04:00
Robert Raposa
8b775961a6 fix: rename table_blacklist to table_ignorelist 2022-03-09 16:43:47 -05:00
Mohammad Ahtasham ul Hassan
68e0885ca8 fix: fixed django4 warnings (#29644) 2022-03-07 15:50:17 +05:00
Julia Eskew
a6a27104cd feat: Add organization-level waffle flag overrides to the view consumed
to make the toggle report spreadsheet. Add appropriate tests.
2022-02-04 12:31:09 -05:00
Julia Eskew
0eb0f99d00 feat: Add org-level waffle overrides to allow a waffle flag to be overridden for all
courses in a particular organization, without needing to make a separate course-level
waffle override for each individual course for an organization.
2022-01-28 08:00:18 -05:00
M. Zulqarnain
43008723be feat: New codemods on OpenedX 3 (#28778) 2021-10-22 13:55:51 +05:00
Michael Terry
0170a0e6f0 feat: add note field to course waffle overrides
It's often very useful to note the reason we override a waffle.
Who asked for it and why - is it temporary until a feature is
completed or a complete opt-out of the feature itself, etc.

Now there's a text field to leave such comments for your future
self, much like waffle flags themselves.
2021-07-26 14:15:06 -04:00
Usama Sadiq
63a9327a9d refactor: pyupgrade second iteration (#27460) 2021-05-10 13:57:24 +05:00
Usama Sadiq
04b3949683 refactor: Ran pyupgrade on openedx/core/djangoapps
Ran pyupgrade on openedx/core/djangoapps/{video_config, video_pipeline, waffle_utils}
2021-04-08 14:36:34 +05:00
Robert Raposa
280f8e1577 docs: improve CourseWaffleFlag admin docs
Improve the docs for how to configure CourseWaffleFlag
overrides via Django admin.

ARCHBOM-1721
2021-04-06 11:05:44 -04:00
Robert Raposa
650b0c1360 Merge pull request #27118 from regisb/regisb/fix-toggle-state-report-typeerror
[BD-21] fix: TypeError in toggle state report view
2021-03-23 17:32:30 -04:00
Régis Behmo
dae4403ba7 fix: TypeError in toggle state report view
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.
2021-03-23 20:33:48 +01:00
Robert Raposa
cbc803cd15 feat!: remove old waffle classes (#27069)
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
2021-03-23 09:37:48 -04:00
Régis Behmo
78c152975b refactor: migrate toggle state report to edx_toggles
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.
2021-03-19 17:14:14 +01:00
Kyle McCormick
9aefd6f986 style: django-not-configured is not a sensible lint-amnesty value (#26862)
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.
2021-03-05 08:11:58 -05:00
Aarif
01ac3c2ed3 replaced unittest assertions pytest assertions (#26308) 2021-02-11 17:41:41 +05:00
Jawayria
250c94dc6a BOM-2331: Applied pylint-amnesty to waffle_utils, xblock, xmodule_django, zendesk_proxy, __init__.py 2021-02-04 17:49:15 +05:00
Robert Raposa
6e6b6901a0 Merge pull request #26040 from regisb/regisb/remove-waffle-custom-monitoring
[BD-21] Remove soon-to-be-deprecated value monitor in edx-toggles
2021-02-01 14:56:35 -05:00
Régis Behmo
e9de9257cd Improve test coverage of toggle state view 2021-01-13 17:09:24 +01:00
Régis Behmo
16ad959d7b Refactor: convert view methods to functions for easier testing
Just removing the `self` argument from all methods is enough to convert them to simple functions.
2021-01-13 16:31:15 +01:00
Régis Behmo
d04d4291f5 Document non-namespaced waffle classes in ADR
It was finally decided not to use `skip_namespace_assertion` optional
arguments, but `NonNamespacedWaffle*` classes. We update the ADR to reflect
this change.
2021-01-12 16:58:11 +01:00
Régis Behmo
8199c78def Remove soon-to-be-deprecated value monitor in edx-toggles
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.
2021-01-12 15:52:55 +01:00
Régis Behmo
f29e415353 Fix deprecated usage of WaffleFlag.namespaced_flag_name
As of edx-toggles==1.2.0, the `WaffleFlag.namespaced_flag_name`
attribute is deprecated in favour of `WaffleFlag.name`.
2020-12-15 12:28:57 +01:00
Régis Behmo
216b99264a Upgrade waffle classes to the new edx-toggles API
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.
2020-12-03 16:40:43 +01:00
Régis Behmo
a16cd71046 Start waffle namespace deprecation
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.
2020-12-03 16:06:14 +01:00
Régis Behmo
fe9558035e Fix monitored values of CourseWaffleFlag objects
The monitored value was being twice namespaced, resulting in incorrect
names, such as "schedules.schedules.send_updates_for_course".
2020-11-19 10:29:08 +01:00
Kyle McCormick
151bd13666 Use full names for common.djangoapps imports; warn when using old style (#25477)
* 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
2020-11-10 07:02:01 -05:00
Robert Raposa
fe9395bd7a Merge pull request #25538 from regisb/regisb/improve-waffle-tests
[BD-21] Improve waffle_utils tests to not rely on internal API
2020-11-06 08:58:18 -05:00
Régis Behmo
19ff82a3da Improve waffle_utils tests to not rely on internal API
This is required for a smooth upgrade of edx-toggles.
2020-11-06 12:11:52 +01:00
Robert Raposa
061d5d8fc5 Merge pull request #25529 from regisb/regisb/better-waffle-deprecation-monitoring
[BD-21] Improve monitoring of waffle deprecation with custom attributes
2020-11-05 15:09:54 -05:00
Régis Behmo
b32fc50947 Improve monitoring of waffle deprecation with custom attributes
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.
2020-11-05 08:36:03 +01:00
Nizar Mahmoud
3a46e7c5f5 Squashes waffle_utils.WaffleFlag deprecation warning 2020-11-05 02:00:33 +03:00
Régis Behmo
da0623107c Expose SettingToggle and SettingDictToggle objects in the API
Note that settings for which a corresponding SettingToggle or
SettingDictToggle exists are no longer exposed in the "django_settings"
list of the API.
2020-11-04 15:53:48 +01:00
Régis Behmo
c9c1136459 Re-introduce waffle classes (with deprecation warnings)
This is for backward compatibility.
2020-11-03 19:25:37 +01:00
Régis Behmo
b70042435a Deprecate waffle_utils.testutils.override* functions
These functions should from now on be imported from
edx_toggles.toggles.testutils.
2020-11-03 19:25:37 +01:00
Régis Behmo
4586002956 Import waffle classes from edx_toggles instead of waffle_utils
Those classes were ported to edx_toggles. The imports remain in
waffle_utils.__init__ for backward compatibility.
2020-11-03 19:25:37 +01:00
Régis Behmo
3b127f8c92 Deprecate WaffleSwitch.override* methods
This allows us to get rid of the custom WaffleSwitch and
WaffleSwitchNamespace classes from waffle_utils in favour of
edx_toggles.toggles classes.
2020-11-03 19:25:37 +01:00
Régis Behmo
2307dff4c9 Deprecate WaffleFlag.override method
This allows us to get rid of waffle_utils' custom WaffleFlag method.
2020-11-03 19:25:37 +01:00
Robert Raposa
39a7c6498c remove internal references to edx_django_utils
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
2020-11-02 16:46:11 -05:00
Régis Behmo
312f0cd749 Fix error in toggle state endpoint in the absence of module_name
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).
2020-10-29 22:59:53 +01:00
Régis Behmo
a27499830c Add deprecation warning comments to waffle_utils code 2020-10-29 22:59:53 +01:00
Régis Behmo
98ffa347d5 Fix waffle_utils unit tests 2020-10-29 22:59:53 +01:00
Régis Behmo
e5500b34a0 Backport override features from edx-toggles to waffle_utils
Note that those features are destined to be deprecated, eventually.
2020-10-29 22:59:52 +01:00
Régis Behmo
db5feec4cf Move waffle_utils/testutils.py to edx-toggles 2020-10-29 22:59:52 +01:00