feat: add EnterpriseEnrollmentPostProcessor pipeline step for CourseEnrollmentStarted filter#2553
feat: add EnterpriseEnrollmentPostProcessor pipeline step for CourseEnrollmentStarted filter#2553pwnage101 wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2553 +/- ##
==========================================
+ Coverage 86.01% 86.03% +0.01%
==========================================
Files 249 250 +1
Lines 16673 16695 +22
Branches 1655 1656 +1
==========================================
+ Hits 14342 14364 +22
Misses 1997 1997
Partials 334 334
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
a35d99d to
ceabb63
Compare
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds an EnterpriseEnrollmentPostProcessor pipeline step to post enterprise enrollment + consent on course enrollment events, with accompanying unit tests.
Changes:
- Introduces
enterprise.filters.enrollment.EnterpriseEnrollmentPostProcessorpipeline step. - Adds unit tests covering enterprise vs non-enterprise paths and exception logging behavior.
- Adds minimal
tests/filterspackage init.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| enterprise/filters/enrollment.py | New pipeline step that posts enterprise enrollment and consent, logging failures. |
| enterprise/filters/init.py | Initializes enterprise.filters package. |
| tests/filters/test_enrollment.py | New tests validating API client calls and exception logging. |
| tests/filters/init.py | Initializes tests.filters package. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| def _make_openedx_modules(): | ||
| """ | ||
| Build a minimal set of sys.modules entries for the openedx namespace. | ||
| """ | ||
| entries = {} | ||
| for name in ( | ||
| "openedx", | ||
| "openedx.features", | ||
| "openedx.features.enterprise_support", | ||
| ): | ||
| entries[name] = ModuleType(name) | ||
| return entries |
There was a problem hiding this comment.
These ModuleType stubs won't behave like packages during import because they lack __path__. As a result, from openedx.features.enterprise_support.api import ... can fail with ModuleNotFoundError: 'openedx' is not a package in environments where openedx isn't installed. Fix by marking the namespace modules as packages (e.g., setting __path__ = [] on each) and/or wiring submodules as attributes on their parents so the import machinery can resolve the hierarchy.
b8aef35 to
21f022a
Compare
…nrollmentStarted filter
21f022a to
67d3376
Compare
ENT-11570
Related: