feat: adopt edx-drf-extensions 10.8.0 building blocks across 6 standardized APIs - #39081
Open
Abdul-Muqadim-Arbisoft wants to merge 6 commits into
Open
Conversation
Bump edx-drf-extensions to 10.8.0, which now ships the reusable core of the FC-0118 REST API conventions (standardized error envelope, response shaping, manual pagination, opaque-key lookup regexes, envelope test helper). openedx/core/lib/api/exceptions.py and the StandardizedErrorMixin in mixins.py become re-exports of the library implementation, keeping the 182 existing openedx.core.lib.api import paths working. The library handler delegates to a configurable base handler, so EDX_DRF_EXTENSIONS['STANDARDIZED_ERROR_BASE_HANDLER'] is pointed at ignored_error_exception_handler to preserve the platform's ignored-error logging and monitoring unchanged.
Import StandardizedErrorMixin and Conflict from the library, apply the ADR 0036 ?view=minimal preset through MinimalViewMixin (the enrollment preset overrides to_minimal_representation, since collapsing the embedded course_details sub-object to a course_id string is not a plain field projection), and paginate the list action through IterablePaginationMixin.paginate_iterable instead of the hand-written paginate/serialize/respond sequence. Response shapes are unchanged.
Import StandardizedErrorMixin from the library, take the router lookup_value_regex from the shared USAGE_KEY_LOOKUP_REGEX constant (identical pattern), and filter the ?view=minimal payload with the shared project() helper. Response shapes are unchanged.
Import StandardizedErrorMixin from the library, take the router lookup_value_regex from the shared COURSE_KEY_LOOKUP_REGEX constant, serve the ADR 0036 ?view=minimal preset through MinimalViewMixin with minimal_fields (replacing the local _apply_view_preset helper), and apply ?fields= selection with the shared project() helper. Response shapes are unchanged.
Import StandardizedErrorMixin from the library and take the router lookup_value_regex from the shared COURSE_KEY_LOOKUP_REGEX constant. Response shapes are unchanged.
Import StandardizedErrorMixin from the library and apply ?fields= selection with the shared project() helper. With its last caller migrated, the local apply_field_selection helper is removed from the v3 utils module. Response shapes are unchanged.
Abdul-Muqadim-Arbisoft
requested review from
Faraz32123,
feanil and
taimoor-ahmed-1
September 7, 2026 19:59
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to the FC-0118 API standardization work merged in #38755. The reusable pieces of that implementation (standardized error envelope, response shaping, manual pagination, opaque-key lookup regexes) were extracted into
edx-drf-extensionsin openedx/edx-drf-extensions#573 (released as 10.8.0), as agreed with @bradenmacdonald and @feanil in the OEP-69 review (openedx/openedx-proposals#805 — discussion thread). This PR completes the loop on the platform side: bump the pin and make the 6 standardized APIs use the library instead of the platform-local copies.Related: FC-0118 umbrella issue #38137.
Commit breakdown
feat: adopt the edx-drf-extensions 10.8.0 REST API building blocksedx-drf-extensions10.7.0 → 10.8.0 (uv.lockviauv lock --upgrade-package, compat exports regenerated viauv export);openedx/core/lib/api/exceptions.pyandStandardizedErrorMixininmixins.pybecome re-exports of the library implementation, so existingopenedx.core.lib.apiimport paths keep working; newEDX_DRF_EXTENSIONS['STANDARDIZED_ERROR_BASE_HANDLER']setting points the library's error handler atignored_error_exception_handler, preserving the platform's ignored-error logging/monitoringfeat: use edx-drf-extensions building blocks in Enrollments v2 API?view=minimalviaMinimalViewMixin(custom representation hook — the enrollment preset collapsescourse_detailsto acourse_idstring);listpagination viaIterablePaginationMixin.paginate_iterablefeat: use edx-drf-extensions building blocks in Xblock v1 APIlookup_value_regexfrom sharedUSAGE_KEY_LOOKUP_REGEX(identical pattern); minimal-view filtering via sharedproject()feat: use edx-drf-extensions building blocks in Course Details v3 APIlookup_value_regexfrom sharedCOURSE_KEY_LOOKUP_REGEX;?view=minimalviaMinimalViewMixin+minimal_fields(local_apply_view_presetremoved);?fields=viaproject()feat: use edx-drf-extensions building blocks in Grading v3 APIlookup_value_regexfrom sharedCOURSE_KEY_LOOKUP_REGEXfeat: use edx-drf-extensions building blocks in Home v3 and v4 APIs?fields=viaproject(); localapply_field_selectionremoved from v3 utils with its last caller migratedBackward compatibility
No behavior change — this is a like-for-like substitution:
openedx.core.lib.api.exceptions/.mixinsimport paths keep working via re-exports.ignored_error_exception_handler(now via theSTANDARDIZED_ERROR_BASE_HANDLERsetting), so error monitoring is unchanged.?view=minimal, and the default full shape) and diffing the JSON.