Skip to content

feat: add competency-based education (CBE) API endpoint - #39099

Draft
javoconsultant wants to merge 1 commit into
openedx:masterfrom
javoconsultant:773-cbe-urls
Draft

feat: add competency-based education (CBE) API endpoint#39099
javoconsultant wants to merge 1 commit into
openedx:masterfrom
javoconsultant:773-cbe-urls

Conversation

@javoconsultant

@javoconsultant javoconsultant commented Sep 11, 2026

Copy link
Copy Markdown

Description

Mounts the competency-based education (CBE) REST API from openedx-learning (openedx-core) into Studio's URL configuration.

This is the platform-side half of the work: the endpoints, serializers, permissions and pagination all live in openedx-core, and this PR is the single include() that makes them reachable from a running Studio instance.

Combined with the routing added in the dependency PR, this exposes:

  • GET /api/cbe/v1/rule_profiles/ — paginated, read-only collection of non-archived competency rule profiles, restricted to taxonomy administrators.

It is wired into CMS/Studio (rather than LMS) because the consumer is the authoring-side Competency Management page. The api/ prefix is deliberately generic so that openedx_learning.urls remains the single place where openedx-core owns its own URL namespacing — future CBE endpoints need no further change here.

User roles impacted

  • Course Author / Taxonomy Administrator — gains access to the new read-only endpoint (permission checks are enforced in openedx-core, deferring to openedx_tagging's admin checks).
  • Developer — new routes available under Studio's /api/.
  • Learner — no impact; nothing is exposed in the LMS.

No UI changes, so no screenshots. No settings or configuration changes.

Supporting information

Testing instructions

This PR cannot be tested on its own — the dependency PR must be installed first, otherwise Studio will fail to start with ModuleNotFoundError: No module named 'openedx_learning.urls'.

  1. Install the openedx-core branch from the dependency PR into your Studio environment:
    pip install -e 'git+https://github.com/javoconsultant/openedx-core@773-read-rule-profiles#egg=openedx-learning'
    
  2. Check out this branch and restart Studio.
  3. Confirm the route is registered:
    ./manage.py cms show_urls | grep rule_profiles
    
  4. As an unauthenticated user, GET /api/cbe/v1/rule_profiles/401.
  5. As an authenticated user without taxonomy admin rights → 403.
  6. As a taxonomy administrator200 with a paginated list of non-archived rule profiles, each carrying id, scope_type, rule_type, rule_payload and archived.
  7. Confirm ordering is stable across repeated requests and that paging through the collection returns each profile exactly once.

Behavioural test coverage for the endpoint itself lives in the dependency PR.

Deadline

None.

Other information

  • Depends on feat: implement CBE REST API with competency rule profiles and permissions jesperhodge/openedx-core#9. This PR should not merge until that one lands and the resulting openedx-learning version is pinned in requirements/.
  • Open question on the URL path: the endpoint currently resolves to /api/cbe/v1/rule_profiles/, while the design docs describe /api/cbe/rest_api/v1/rule_profiles/. The prefix chosen here (api/) keeps that decision entirely inside openedx-core — if the path changes there, this file does not need to change.
  • No database migrations.
  • No new settings, feature flags or dependencies added by this PR itself.
  • Access control and pagination limits are enforced in openedx-core, not here.

@openedx-webhooks

Copy link
Copy Markdown

Thanks for the pull request, @javoconsultant!

This repository is currently maintained by @openedx/wg-maintenance-openedx-platform-oncall.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

🔘 Update the status of your PR

Your PR is currently marked as a draft. After completing the steps above, update its status by clicking "Ready for Review", or removing "WIP" from the title, as appropriate.


Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@mgwozdz-unicon mgwozdz-unicon 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.

I approve contingent on the merge of jesperhodge/openedx-core#9 into openedx/openedx-core with an updated version applied to this PR with a green build.

Claude flagged this as an optional suggestion:
Would you consider adding a small test proving the mount itself works, independent of the logic it exposes? There's a precedent for this in cms/tests/test_user_tasks.py, added alongside the commit that mounted django-user-tasks, also a separate pip package, at api/tasks/v0/. That test calls reverse() on the mounted route and makes one request to confirm it resolves and responds, with a docstring noting that the underlying authorization logic is tested in the external package itself, this one only proves the route is exposed. Something similarly small here, a reverse('cbe:rule_profile-list') call plus one request checking for a 401 or 200, would cover the one thing this PR actually changes that #9's own test suite can't: whether the mount resolves correctly from Studio's URL configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

open-source-contribution PR author is not from Axim or 2U

Projects

Status: Needs Triage

Development

Successfully merging this pull request may close these issues.

3 participants