feat: add competency-based education (CBE) API endpoint - #39099
feat: add competency-based education (CBE) API endpoint#39099javoconsultant wants to merge 1 commit into
Conversation
|
Thanks for the pull request, @javoconsultant! This repository is currently maintained by 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 approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo 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:
🔘 Get a green buildIf 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 PRYour 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:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
There was a problem hiding this comment.
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.
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 singleinclude()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 thatopenedx_learning.urlsremains the single place where openedx-core owns its own URL namespacing — future CBE endpoints need no further change here.User roles impacted
openedx_tagging's admin checks)./api/.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'.openedx-corebranch from the dependency PR into your Studio environment:GET /api/cbe/v1/rule_profiles/→401.403.200with a paginated list of non-archived rule profiles, each carryingid,scope_type,rule_type,rule_payloadandarchived.Behavioural test coverage for the endpoint itself lives in the dependency PR.
Deadline
None.
Other information
openedx-learningversion is pinned inrequirements/./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.