Skip to content

feat: add several courseware access related pipeline steps - #2548

Merged
pwnage101 merged 1 commit into
masterfrom
pwnage101/ENT-11544
Jun 17, 2026
Merged

feat: add several courseware access related pipeline steps#2548
pwnage101 merged 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, often redirecting to a DSC page.

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 96.55172% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.63%. Comparing base (2ecc601) to head (5047687).

Files with missing lines Patch % Lines
consent/filters/courseware.py 93.47% 3 Missing ⚠️
consent/helpers.py 98.38% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2548      +/-   ##
==========================================
+ Coverage   86.56%   86.63%   +0.06%     
==========================================
  Files         254      255       +1     
  Lines       16797    16904     +107     
  Branches     1660     1673      +13     
==========================================
+ Hits        14541    14644     +103     
- Misses       1921     1925       +4     
  Partials      335      335              
Flag Coverage Δ
unittests 86.63% <96.55%> (+0.06%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 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 2 times, most recently from e1de1e3 to 1ae72db Compare June 8, 2026 18:35
@pwnage101
pwnage101 force-pushed the pwnage101/ENT-11544 branch from 1ae72db to a6a5753 Compare June 12, 2026 16:00
@pwnage101 pwnage101 changed the title feat: add CoursewareViewRedirectURL pipeline steps feat: add several courseware-access related pipeline steps Jun 12, 2026
@pwnage101 pwnage101 changed the title feat: add several courseware-access related pipeline steps feat: add several courseware access related pipeline steps Jun 12, 2026

@iloveagent57 iloveagent57 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

two small nits, looks good otherwise!

Comment thread enterprise/filters/courseware.py
Comment thread enterprise/utils.py
@pwnage101
pwnage101 force-pushed the pwnage101/ENT-11544 branch 2 times, most recently from 5a95d99 to a3e5b58 Compare June 17, 2026 18:18
@pwnage101
pwnage101 requested a review from Copilot June 17, 2026 18:30

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

Copilot reviewed 19 out of 19 changed files in this pull request and generated 9 comments.

Comment thread enterprise/utils.py
Comment thread consent/helpers.py
Comment thread consent/helpers.py
Comment thread consent/helpers.py
Comment thread consent/helpers.py
Comment thread consent/helpers.py
Comment thread enterprise/filters/courseware.py
Comment thread tests/test_consent/test_helpers.py Outdated
Comment thread CHANGELOG.rst Outdated
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
@pwnage101
pwnage101 force-pushed the pwnage101/ENT-11544 branch from a3e5b58 to 5047687 Compare June 17, 2026 18:45
@pwnage101
pwnage101 merged commit 119af87 into master Jun 17, 2026
11 checks passed
@pwnage101
pwnage101 deleted the pwnage101/ENT-11544 branch June 17, 2026 19:01
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