feat: replace enterprise_support with AccountSettingsReadOnlyFields#263
feat: replace enterprise_support with AccountSettingsReadOnlyFields#263kiram15 wants to merge 2 commits intorelease-ulmofrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR replaces the direct enterprise-support lookup in the LMS account settings API with an openedx-filters integration, then wires the corresponding filter into LMS settings so enterprise-specific read-only fields can be supplied through the filter pipeline instead of a hard import.
Changes:
- Swaps the account-settings read-only-field logic from
enterprise_supportutility code toAccountSettingsReadOnlyFieldsRequested. - Adds a default LMS
OPEN_EDX_FILTERS_CONFIGentry and production-time merge logic for YAML-provided filter config. - Updates account API tests to mock the new filter hook instead of the previous enterprise helper.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
requirements/edx/testing.txt |
Bumps openedx-filters in the testing lockfile. |
requirements/edx/doc.txt |
Bumps openedx-filters in the docs lockfile. |
requirements/edx/development.txt |
Bumps openedx-filters in the development lockfile. |
openedx/core/djangoapps/user_api/accounts/tests/test_api.py |
Replaces enterprise-specific mocks/tests with filter-based mocking. |
openedx/core/djangoapps/user_api/accounts/api.py |
Routes account read-only-field validation through AccountSettingsReadOnlyFieldsRequested. |
lms/envs/production.py |
Adds special YAML merge handling for OPEN_EDX_FILTERS_CONFIG. |
lms/envs/common.py |
Introduces the default LMS filter configuration for account-settings read-only fields. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ba7d562 to
8fd9988
Compare
8fd9988 to
1ca2afd
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1ca2afd to
9dcae8b
Compare
9dcae8b to
01dbd3d
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b46cd02 to
d65a41b
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d65a41b to
b2b879e
Compare
b2b879e to
4c79537
Compare
4c79537 to
1dc5599
Compare
1dc5599 to
e6dc283
Compare
b7c2b64 to
722ca72
Compare
| # .. setting_description: Configuration dict for openedx-filters pipeline steps. | ||
| # Keys are filter type strings; values are dicts with 'fail_silently' (bool) and | ||
| # 'pipeline' (list of dotted-path strings to PipelineStep subclasses). | ||
| OPEN_EDX_FILTERS_CONFIG = { |
There was a problem hiding this comment.
wait...i thought we already added this variable.
| # Merge OPEN_EDX_FILTERS_CONFIG from YAML into the default defined in common.py. | ||
| # Pipeline steps from YAML are appended after steps defined in common.py. | ||
| # The fail_silently value from YAML takes precedence over the one in common.py. | ||
| for _filter_type, _filter_config in _YAML_TOKENS.get('OPEN_EDX_FILTERS_CONFIG', {}).items(): | ||
| if _filter_type in OPEN_EDX_FILTERS_CONFIG: | ||
| OPEN_EDX_FILTERS_CONFIG[_filter_type]['pipeline'].extend( | ||
| _filter_config.get('pipeline', []) | ||
| ) | ||
| if 'fail_silently' in _filter_config: | ||
| OPEN_EDX_FILTERS_CONFIG[_filter_type]['fail_silently'] = _filter_config['fail_silently'] | ||
| else: | ||
| OPEN_EDX_FILTERS_CONFIG[_filter_type] = _filter_config |
There was a problem hiding this comment.
I thought we already added this...
Description
Removes the direct import of get_enterprise_readonly_account_fields from openedx.features.enterprise_support.utils in accounts/api.py and replaces it with a call to the AccountSettingsReadOnlyFieldsRequested openedx-filter. Adds the filter to OPEN_EDX_FILTERS_CONFIG. Updates tests to mock the filter instead of the old enterprise_support imports.
Supporting information
ENT-11510
Testing instructions
Please provide detailed step-by-step instructions for testing this change.
Deadline
"None" if there's no rush, or provide a specific date or event (and reason) if there is one.
Other information
Include anything else that will help reviewers and consumers understand the change.