Repository navigation
feat: add course-run scoping to the criteria-groups endpoint (#682) #911
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ormsbee
merged 1 commit into
openedx:main
from
ufedaseyeuconsultant:ufedaseyeu/feat--682-filtering-to-cc-and-groups
Oct 30, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_create_leaf_group()creates a new leaf for every criterion, so this query returns roughlycriteria + course runs + 1rows for the competency, and a request scoped to one run loads all of them, walks them, and keeps the handful it asked for. The walk is there because I asked for it in #878, and it needs every group in memory because a leaf has nocourseof its own: the only way to learn which course a leaf belongs to is to find its parent.If every group in a course-scoped subtree carried
course_id, which is what ADR 0002 Decision 2 says today ("Within a course-scoped subtree, every group carries the samecourse_id, not only its topmost group"), this could be:and the walk from the roots still works on just those rows, since every ancestor of a loaded group is either instance-wide or in the same course, so it's either loaded too or archived, in which case the child is unreachable, which is what we want. It's also what the
(tag, course)index from Decision 5 was added for. The total count would then be a plainCOUNTon(group__tag, group__archived, archived)if we're willing to lean on #675 archiving subtrees whole, or a cheapvalues_list("id", "parent_id")pass over the non-archived groups if we aren't.The cost is that
resolve_supplied_leaf_group()usescourse_id is Noneas its leaf test,get_courses_with_relative_criteria()joins throughparent__course, and #760'supdate_competency_criteria_group()walks up to the nearest ancestor with a course for its permission check, so this isn't confined to one function (though that last one gets simpler, since the course would just begroup.course). Given that, I'm okay with the code part being a follow-up PR if you'd rather land the criteria fix first, as long as the ADR says which way we're going and this docstring stops presenting the "first course on the path" rule as the model.