fix: gate plugin_settings on ENABLE_ENTERPRISE_INTEGRATION#2610
fix: gate plugin_settings on ENABLE_ENTERPRISE_INTEGRATION#2610
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2610 +/- ##
=======================================
Coverage 86.01% 86.01%
=======================================
Files 249 249
Lines 16674 16673 -1
Branches 1655 1655
=======================================
Hits 14342 14342
+ Misses 1998 1997 -1
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:
|
There was a problem hiding this comment.
Pull request overview
This PR restores the prior behavior of only injecting enterprise social-auth pipeline steps when enterprise integration is enabled, avoiding regressions in contexts (notably Studio/CMS) that should have no enterprise pipeline steps. It also continues a broader move away from settings.FEATURES[...] reads toward top-level Django settings flags, and updates enterprise test settings to invoke plugin settings via the Open edX plugin mechanism.
Changes:
- Gate
enterprise.settings.common.plugin_settings()(and related runtime hooks) onENABLE_ENTERPRISE_INTEGRATIONto avoid injecting enterprise pipeline steps when integration is disabled. - Migrate several settings reads from
settings.FEATURES[...]to top-level settings attributes and update affected tests accordingly. - Reorganize
enterprise/settings/test.pyto apply plugin settings viaadd_plugins()and reduce duplication as enterprise becomes a more optional plugin.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
enterprise/settings/common.py |
Adds an early gate on ENABLE_ENTERPRISE_INTEGRATION before injecting social-auth pipeline steps. |
enterprise/tpa_pipeline.py |
Switches enterprise pipeline-step gating to top-level ENABLE_ENTERPRISE_INTEGRATION. |
enterprise/signals.py |
Switches signal-handler gating to top-level ENABLE_ENTERPRISE_INTEGRATION. |
enterprise/admin/__init__.py |
Switches a former FEATURES-flag read to a top-level setting for admin delete permission. |
enterprise/settings/test.py |
Refactors test settings: defines a base (enterprise-free) pipeline, enables enterprise integration, and applies plugin settings via add_plugins(). |
tests/test_settings.py |
Updates plugin_settings tests to include ENABLE_ENTERPRISE_INTEGRATION and adds a no-op test when disabled. |
tests/test_tpa_pipeline.py |
Updates override_settings usage to the top-level integration flag. |
tests/test_enterprise/test_signals.py |
Updates override_settings usage to the top-level integration flag. |
consent/settings/common.py |
Updates docstring example away from settings.FEATURES[...]. |
enterprise/__init__.py |
Bumps package version to 8.0.6. |
CHANGELOG.rst |
Adds the 8.0.6 release note entry. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
db9448b to
0916f16
Compare
The main behavior change:
- Skip social auth pipeline injection when enterprise integration
is disabled.
- This fixes a broken CMS test in the edxapp which expects NO
enterprise steps in the social auth pipeline.
Other changes rolled into this commit to simplify testing and prep for
making enterprise a truly optional plugin:
- Migrate enterprise FEATURES-dict reads to top-level settings,
matching openedx-platform's ongoing FEATURES flattening/removal.
- Reorganize enterprise/settings/test.py and invoke plugin_settings
(via add_plugins()) to prevent future duplication of test settings
once we migrate enterprise-specific settings into this repo.
ENT-11566
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0916f16 to
4c0c0b0
Compare
The main behavior change:
Other changes rolled into this commit to simplify testing and prep for making enterprise a truly optional plugin:
ENT-11566
The failing test in openedx-platform which prompted this PR: