Skip to content

feat: replace enterprise_support with AccountSettingsReadOnlyFields#263

Open
kiram15 wants to merge 2 commits intorelease-ulmofrom
kiram15/ENT-11510-1
Open

feat: replace enterprise_support with AccountSettingsReadOnlyFields#263
kiram15 wants to merge 2 commits intorelease-ulmofrom
kiram15/ENT-11510-1

Conversation

@kiram15
Copy link
Copy Markdown

@kiram15 kiram15 commented May 5, 2026

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.

  • Does this change depend on other changes elsewhere?
  • Any special concerns or limitations? For example: deprecations, migrations, security, or accessibility.
  • If your database migration can't be rolled back easily.

Copilot AI review requested due to automatic review settings May 5, 2026 03:40
@kiram15 kiram15 changed the title feat: replace enterprise_support import with AccountSettingsReadOnlyF… feat: replace enterprise_support with AccountSettingsReadOnlyFields May 5, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_support utility code to AccountSettingsReadOnlyFieldsRequested.
  • Adds a default LMS OPEN_EDX_FILTERS_CONFIG entry 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.

Comment thread requirements/edx/development.txt
Comment thread lms/envs/production.py Outdated
Comment thread openedx/core/djangoapps/user_api/accounts/tests/test_api.py Outdated
@kiram15 kiram15 force-pushed the kiram15/ENT-11510-1 branch from ba7d562 to 8fd9988 Compare May 5, 2026 04:19
Copilot AI review requested due to automatic review settings May 5, 2026 04:27
@kiram15 kiram15 force-pushed the kiram15/ENT-11510-1 branch from 8fd9988 to 1ca2afd Compare May 5, 2026 04:27
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread openedx/core/djangoapps/user_api/accounts/tests/test_api.py
Comment thread openedx/core/djangoapps/user_api/accounts/tests/test_api.py Outdated
Comment thread openedx/core/djangoapps/user_api/accounts/tests/test_api.py Outdated
@kiram15 kiram15 force-pushed the kiram15/ENT-11510-1 branch from 1ca2afd to 9dcae8b Compare May 5, 2026 04:43
Copilot AI review requested due to automatic review settings May 5, 2026 04:58
@kiram15 kiram15 force-pushed the kiram15/ENT-11510-1 branch from 9dcae8b to 01dbd3d Compare May 5, 2026 04:58
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread lms/envs/common.py Outdated
Comment thread lms/envs/production.py Outdated
Comment thread openedx/core/djangoapps/user_api/accounts/tests/test_api.py
@kiram15 kiram15 force-pushed the kiram15/ENT-11510-1 branch 2 times, most recently from b46cd02 to d65a41b Compare May 5, 2026 05:43
Copilot AI review requested due to automatic review settings May 5, 2026 05:43
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread lms/envs/production.py Outdated
Comment thread openedx/core/djangoapps/user_api/accounts/api.py Outdated
@kiram15 kiram15 force-pushed the kiram15/ENT-11510-1 branch from d65a41b to b2b879e Compare May 5, 2026 21:30
Copilot AI review requested due to automatic review settings May 6, 2026 17:13
@kiram15 kiram15 force-pushed the kiram15/ENT-11510-1 branch from b2b879e to 4c79537 Compare May 6, 2026 17:13
@kiram15 kiram15 force-pushed the kiram15/ENT-11510-1 branch from 4c79537 to 1dc5599 Compare May 6, 2026 19:42
@kiram15 kiram15 force-pushed the kiram15/ENT-11510-1 branch from 1dc5599 to e6dc283 Compare May 6, 2026 19:49
Comment thread lms/djangoapps/grades/events.py Outdated
Comment thread lms/envs/production.py Outdated
@kiram15 kiram15 force-pushed the kiram15/ENT-11510-1 branch from b7c2b64 to 722ca72 Compare May 7, 2026 15:40
Comment thread lms/envs/common.py
# .. 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 = {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wait...i thought we already added this variable.

Comment thread lms/envs/production.py
Comment on lines +285 to +296
# 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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we already added this...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants