Skip to content

feat: add CoursewareViewRedirectURL pipeline steps#2548

Open
pwnage101 wants to merge 1 commit into
masterfrom
pwnage101/ENT-11544
Open

feat: add CoursewareViewRedirectURL pipeline steps#2548
pwnage101 wants to merge 1 commit into
masterfrom
pwnage101/ENT-11544

Conversation

@pwnage101

@pwnage101 pwnage101 commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

This commit replaces most enterprise-specific logic serving the purpose
of conditionally blocking courseware access.

Enterprise steps added:

  • EnterpriseStartDateAccessFailureStep supplies an enterprise-specific start-date error for enterprise learners.
  • ActiveEnterpriseCheckStep denies access when the learner's active EnterpriseCustomer differs from the enrollment's customer.

Consent steps added:

  • DataSharingConsentRedirectStep supplies a redirect URL to collect data sharing consent when it is required.
  • DataSharingConsentCourseAccessStep denies access when consent is required.

ENT-11544


Blocked by:

Blocks:

@codecov

codecov Bot commented May 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 62.06897% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.00%. Comparing base (306ca8a) to head (b4c83bf).

Files with missing lines Patch % Lines
consent/helpers.py 50.00% 11 Missing ⚠️

❌ Your patch check has failed because the patch coverage (62.06%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2548      +/-   ##
==========================================
- Coverage   86.04%   86.00%   -0.04%     
==========================================
  Files         250      251       +1     
  Lines       16700    16740      +40     
  Branches     1657     1662       +5     
==========================================
+ Hits        14369    14397      +28     
- Misses       1997     2008      +11     
- Partials      334      335       +1     
Flag Coverage Δ
unittests 86.00% <62.06%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pwnage101 pwnage101 force-pushed the pwnage101/ENT-11544 branch 4 times, most recently from b279908 to fcd378f Compare May 20, 2026 16:37
@pwnage101 pwnage101 force-pushed the pwnage101/ENT-11544 branch from fcd378f to e6bff04 Compare May 21, 2026 16:45
@pwnage101 pwnage101 force-pushed the pwnage101/ENT-11544 branch 6 times, most recently from a0204dc to e885e65 Compare June 2, 2026 22:48
@pwnage101 pwnage101 marked this pull request as ready for review June 2, 2026 23:39
Comment thread enterprise/settings/common.py Outdated
Comment thread enterprise/filters/courseware.py Outdated
Comment thread tests/filters/test_courseware.py Outdated
Comment thread consent/helpers.py
@pwnage101 pwnage101 force-pushed the pwnage101/ENT-11544 branch 13 times, most recently from bbe88aa to 44259b7 Compare June 4, 2026 19:33

Copilot AI left a comment

Copy link
Copy Markdown

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 introduces new openedx-filters pipeline steps in enterprise and consent to enforce enterprise-specific courseware access gating (enterprise start-date messaging, active-enterprise mismatch blocking, and data-sharing consent redirects/blocks), and adds unit tests to validate the new behaviors.

Changes:

  • Added Enterprise courseware filter steps for start-date override errors and active-enterprise mismatch access denial.
  • Added Consent courseware filter steps plus helper logic to compute enterprise consent redirect URLs / access blocks.
  • Added/expanded tests covering new enterprise/consent helpers and courseware filter pipeline steps.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
tests/test_enterprise/test_utils.py Adds tests for get_active_enterprise_customer_user.
tests/test_consent/test_helpers.py Adds unit tests for consent helper behavior and URL building.
tests/test_consent/test_filters_courseware.py Adds tests for consent courseware filter steps (redirect + access denial).
tests/filters/test_courseware.py Adds tests for enterprise courseware filter steps (start-date override + active enterprise check).
enterprise/utils.py Adds get_active_enterprise_customer_user and enterprise_learner_enrolled.
enterprise/settings/common.py Registers enterprise courseware pipeline steps in filters config.
enterprise/filters/dashboard.py Updates migration-related comment wording.
enterprise/filters/courseware.py Adds enterprise courseware pipeline steps.
consent/settings/common.py Registers consent courseware pipeline steps in filters config.
consent/helpers.py Adds consent enforcement logic and consent URL builder helpers.
consent/filters/courseware.py Adds consent courseware pipeline steps.
consent/filters/init.py Adds package docstring for consent filter steps.

Comment thread consent/helpers.py Outdated
Comment thread enterprise/utils.py Outdated
Comment thread enterprise/utils.py Outdated
Comment thread consent/filters/courseware.py Outdated
Comment thread consent/filters/courseware.py
Comment thread enterprise/filters/courseware.py
Comment thread enterprise/filters/courseware.py
@pwnage101 pwnage101 force-pushed the pwnage101/ENT-11544 branch 7 times, most recently from 6baf4f0 to f5652be Compare June 4, 2026 22:31
Comment thread enterprise/filters/courseware.py
Comment thread consent/helpers.py Outdated
Comment thread consent/helpers.py
Comment thread enterprise/filters/courseware.py Outdated
@pwnage101 pwnage101 force-pushed the pwnage101/ENT-11544 branch from f5652be to e1de1e3 Compare June 8, 2026 18:29
This commit replaces most enterprise-specific logic serving the purpose
of conditionally blocking courseware access.

Enterprise steps added:
- EnterpriseStartDateAccessFailureStep supplies an enterprise-specific start-date error for enterprise learners.
- ActiveEnterpriseCheckStep denies access when the learner's active EnterpriseCustomer differs from the enrollment's customer.

Consent steps added:
- DataSharingConsentRedirectStep supplies a redirect URL to collect data sharing consent when it is required.
- DataSharingConsentCourseAccessStep denies access when consent is required.

ENT-11544
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.

5 participants