GeezerVison is showing github.com — Add management command for auditing missing sources by bjester · Pull Request #5711 · learningequality/studio
Conversation
bjester
commented
Feb 18, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Summary
- Adds CTE functionality to channel model
- Adds new management command that audits missing import sources for public channels, where source node was deleted or public channel was marked as deleted
References
#5683
Reviewer guidance
- Tests make sense?
- Can you run the command? It will generate a
fix_missing_import_sources.csv in your CWD
LLMs
- LLMs were used to convert SQL queries into Django ORM queries, but the result was almost entirely rewritten
- Tests were bootstrapped then also rewritten
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
rtibblesbot reacted with eyes emoji
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.
Audit command for missing import sources on public channels, with CTE support added to the Channel model. Code is clean and well-structured.
CI: linting and frontend builds pass; Python unit tests still pending. The "Update community pull requests spreadsheet" failure is an unrelated admin workflow.
- suggestion: Command name vs. current behavior mismatch (inline)
- suggestion: Duplicate CTE construction (inline)
- nitpick:
.gitignore additions are unrelated to the PR scope but harmless
@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly
How was this generated?
Reviewed the pull request diff checking for:
- Correctness: bugs, edge cases, undocumented behavior, resource leaks, hardcoded values
- Design: unnecessary complexity, naming, readability, comment accuracy, redundant state
- Architecture: duplicated concerns, minimal interfaces, composition over inheritance
- Testing: behavior-based assertions, mocks only at hard boundaries, accurate coverage
- Completeness: missing dependencies, unupdated usages, i18n, accessibility, security
- Principles: DRY (same reason to change), SRP, Rule of Three (no premature abstraction)
- Checked CI status and linked issue acceptance criteria
- For UI changes: inspected screenshots for layout, visual completeness, and consistency
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
|
|
|
|
|
|
|
|
class ChannelModelQuerySet(models.QuerySet):
|
|
|
class ChannelModelQuerySet(CTEQuerySet):
|
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.
praise: Good approach — inheriting from CTEQuerySet instead of models.QuerySet keeps the custom create/update_or_create methods intact while adding CTE support. The ChannelModelManager via from_queryset is the correct Django pattern for this.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
I ran it locally and got this:
INFO:contentcuration.management.commands.fix_missing_import_sources:=== Iterating over private destination channels. ===
INFO:contentcuration.management.commands.fix_missing_import_sources:=== Done iterating over private destination channels. ===
INFO:contentcuration.management.commands.fix_missing_import_sources:Found 0 nodes across 0 channels.
INFO:contentcuration.management.commands.fix_missing_import_sources:Finished in 0.015901565551757812
Which seems accurate :)
Further testing we can do live.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
bjester reacted with thumbs up emoji
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
rtibbles
rtibbles approved these changes
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|