feat: add AccountSettingsEnterpriseReadOnlyFieldsStep pipeline step#2544
feat: add AccountSettingsEnterpriseReadOnlyFieldsStep pipeline step#2544
Conversation
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
50361c6 to
304a409
Compare
| fn=lambda request, *args, **kwargs: kwargs.get('enterprise_customer_uuid'), | ||
| ) | ||
| def delete_admin(self, request, enterprise_customer_uuid=None, id=None): # pylint: disable=redefined-builtin,unused-argument | ||
| def delete_admin(self, request, enterprise_customer_uuid=None, id=None): # pylint: disable=redefined-builtin |
There was a problem hiding this comment.
lint error for unnecessary pylint ignore
ffa236d to
186d67a
Compare
pwnage101
left a comment
There was a problem hiding this comment.
Apologies, but I took a deeper look at the code and found many things I don't like!
There was a problem hiding this comment.
Pull request overview
Adds an edx-enterprise pipeline step that participates in the org.openedx.learning.account.settings.read_only_fields.requested.v1 openedx-filter to mark certain account settings fields as read-only for learners whose enterprise SSO IdP is configured to sync profile data.
Changes:
- Introduce
AccountSettingsReadOnlyFieldsStepto addENTERPRISE_READONLY_ACCOUNT_FIELDS(conditionally includingnamebased on social auth presence). - Add unit tests covering common branches (no enterprise link, no IdP, no TPA, sync disabled, name excluded without social auth).
- Add
openedx-filtersdependency and bump package version/changelog.
Reviewed changes
Copilot reviewed 10 out of 12 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
enterprise/filters/accounts.py |
Implements the new PipelineStep that computes enterprise-driven read-only account fields. |
tests/filters/test_accounts.py |
Adds unit tests for the pipeline step’s main decision branches. |
requirements/base.in |
Adds openedx-filters as a runtime dependency. |
requirements/test-master.txt |
Pins/records openedx-filters in compiled test requirements. |
requirements/test.txt |
Updates compiled dependency provenance comments related to openedx-filters. |
requirements/dev.txt |
Updates compiled dev requirements to include openedx-filters. |
requirements/doc.txt |
Updates compiled doc requirements to include openedx-filters. |
requirements/edx-platform-constraints.txt |
Updates a pinned dependency version during constraints sync. |
enterprise/__init__.py |
Bumps package version to 6.8.4. |
CHANGELOG.rst |
Adds the 6.8.4 release entry for this feature. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
5da2567 to
013bf62
Compare
|
|
||
| fake_get_ec.return_value = enterprise_customer | ||
| assert handle_enterprise_logistration(backend, self.user) is None | ||
| assert handle_enterprise_logistration.__wrapped__(backend, self.user) is None |
There was a problem hiding this comment.
Had to use .wrapped to bypass the @partial decorator and test the business logic directly
013bf62 to
d2f1767
Compare
d2f1767 to
fea50a5
Compare
3919256 to
2e2abb6
Compare
requirements/doc.txt
Outdated
| # by the following command: | ||
| # | ||
| # make upgrade | ||
| # pip-compile --output-file=requirements/doc.txt requirements/doc.in |
There was a problem hiding this comment.
Nit: this will just be immediately un-done---maybe just keep this make upgrade.
|
Just the Nit above and the fundamental question about matching against all vs. just one provider: #2544 (comment) The rest LGTM! |
2e2abb6 to
cb400fb
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 16 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cb400fb to
109a270
Compare
109a270 to
797bdc0
Compare
Implements the AccountSettingsEnterpriseReadOnlyFieldsStep PipelineStep for the org.openedx.learning.account.settings.read_only_fields.requested.v1 openedx-filter. When a user is linked to an enterprise customer whose SSO IdP has sync_learner_profile_data enabled, the step adds ENTERPRISE_READONLY_ACCOUNT_FIELDS to the readonly_fields set. The name field is only included when a UserSocialAuth record exists for the IdP backend.
ENT-11510
Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com
Blocked by:
Blocks: