feat: replace enterprise_support with DashboardRenderStarted filter#264
Open
kiram15 wants to merge 1 commit intorelease-ulmofrom
Open
feat: replace enterprise_support with DashboardRenderStarted filter#264kiram15 wants to merge 1 commit intorelease-ulmofrom
kiram15 wants to merge 1 commit intorelease-ulmofrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR shifts enterprise-related learner dashboard context enrichment out of the student_dashboard view and into the DashboardRenderStarted openedx-filters pipeline, enabling integrations (e.g., edx-enterprise) to inject enterprise context via configured pipeline steps.
Changes:
- Upgraded
openedx-filtersto3.3.0in edx requirement pins. - Removed direct enterprise_support imports/usages from the learner dashboard view; added
requestto the dashboard context for pipeline steps. - Introduced default
OPEN_EDX_FILTERS_CONFIGin LMS common settings and added YAML-merge behavior in production settings; added a test for request presence in filter context.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| requirements/edx/base.txt | Bumps openedx-filters pin to 3.3.0. |
| requirements/edx/development.txt | Keeps dev requirements aligned with the new openedx-filters version. |
| requirements/edx/testing.txt | Keeps test requirements aligned with the new openedx-filters version. |
| requirements/edx/doc.txt | Keeps doc requirements aligned with the new openedx-filters version. |
| lms/envs/common.py | Adds default OPEN_EDX_FILTERS_CONFIG entry for the dashboard render filter. |
| lms/envs/production.py | Merges YAML-provided OPEN_EDX_FILTERS_CONFIG into defaults (append pipeline, override fail_silently). |
| common/djangoapps/student/views/dashboard.py | Removes enterprise_support view logic and passes request through dashboard context for filter steps. |
| common/djangoapps/student/tests/test_filters.py | Adds a pipeline-step-based test intended to validate request availability for dashboard filter enrichment. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+3721
to
+3726
| # .. setting_name: OPEN_EDX_FILTERS_CONFIG | ||
| # .. setting_default: {} | ||
| # .. 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 = { |
Comment on lines
+522
to
+533
| # 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 |
Comment on lines
+500
to
+504
| - The dashboard renders successfully (HTTP 200). | ||
| """ | ||
| response = self.client.get(self.dashboard_url) | ||
|
|
||
| self.assertEqual(response.status_code, 200) |
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.
Description
Removes the direct imports of get_dashboard_consent_notification, get_enterprise_learner_portal_context, and is_enterprise_learner from the student dashboard view and lets the DashboardRenderStarted filter pipeline handle enterprise context enrichment instead. Adds 'request' to the context dict so pipeline steps (e.g. DashboardContextEnricher
in edx-enterprise) can access it.
Supporting information
ENT-11569
Related openedx-platform PR
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.