Simplify Content Groups API v2 Response#37976
Simplify Content Groups API v2 Response#37976brianjbuck-wgu wants to merge 1 commit intoopenedx:masterfrom
Conversation
|
Thanks for the pull request, @brianjbuck-wgu! 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. DetailsWhere 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. |
1b88077 to
0f2fd95
Compare
There was a problem hiding this comment.
Pull request overview
This PR simplifies the Content Groups API v2 response by flattening the structure and removing internal metadata fields. The response now directly returns content groups and a Studio link, rather than nesting groups within a configuration wrapper.
Changes:
- Simplified response structure to return
id,groups, andstudio_content_groups_linkdirectly - Removed internal metadata fields (
should_show_enrollment_track,should_show_experiment_groups,context_course, etc.) - Updated serializer, tests, and API documentation to reflect the new response format
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| openedx/core/djangoapps/course_groups/rest_api/views.py | Refactored view to build simplified response with flattened groups and Studio URL |
| openedx/core/djangoapps/course_groups/rest_api/tests/test_views.py | Updated tests to verify new response structure with id, groups, and studio_content_groups_link |
| openedx/core/djangoapps/course_groups/rest_api/serializers.py | Modified serializer to define new flat response structure |
| openedx/core/djangoapps/course_groups/rest_api/docs/content-groups-api-v2-spec.yaml | Updated API spec to document simplified response schema |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @patch('lms.djangoapps.instructor.permissions.InstructorPermission.has_permission') | ||
| def test_list_auto_creates_empty_content_group_if_none_exists(self, mock_perm): | ||
| """Verify empty content group is auto-created when none exists""" | ||
| def test_list_returns_empty_groups_when_none_exist(self, mock_perm): |
There was a problem hiding this comment.
The test doesn't verify the studio_content_groups_link format when no content groups exist. Add an assertion using @override_settings decorator (like in test_list_content_groups_returns_json) to verify the Studio URL is correctly constructed even when no partition exists.
0f2fd95 to
61c7865
Compare
61c7865 to
4f029d4
Compare
Description
New Response Format
{ "groups": [ {"id": 123, "name": "Content Group A", "version": 1, "usage": []} ], "studio_content_groups_link": "/course/course-v1:org+course+run/group_configurations" }Supporting information
Implements: #37973
Testing instructions
Deadline
None
Other information
None