Prevent syncing from incomplete source node#5761
Prevent syncing from incomplete source node#5761bjester wants to merge 1 commit intolearningequality:hotfixesfrom
Conversation
rtibblesbot
left a comment
There was a problem hiding this comment.
Clean, focused fix that prevents syncing from an incomplete source node, directly addressing the P0 bug.
CI passing. PR targets hotfixes (not the default unstable branch), which is appropriate for a P0 regression fix. No new user-facing strings added.
- suggestion: The warning log could be more informative (see inline comment)
- suggestion: Test could add an explicit
refresh_from_dbto strengthen the assertion (see inline comment) - praise: Good test structure and necessary fix to
_create_video_nodeto ensure the completeness guard works correctly across all existing tests
@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
977e37d to
1baff6a
Compare
rtibblesbot
left a comment
There was a problem hiding this comment.
Clean fix that addresses the P0 regression. The completeness guard is correctly placed, the warning log is informative, and the test setup changes ensure existing tests exercise the intended sync path.
CI passing. PR targets hotfixes, appropriate for a P0 fix. No new user-facing strings.
Delta from prior review:
-
RESOLVED: Warning log now includes both
node.pkandoriginal_node.pkas suggested -
ACKNOWLEDGED:
refresh_from_dbsuggestion was minor and reasonably declined -
praise: Solid, minimal fix — the guard returns early without mutating the cloned node, which is exactly the right behavior for this case
@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly
How was this generated?
Compared the current PR state against findings from a prior review:
- Retrieved prior bot reviews deterministically via the GitHub API
- Classified each prior finding as RESOLVED, UNADDRESSED, ACKNOWLEDGED, or CONTESTED
- Only raised NEW findings for newly introduced code
- Reviewed the pull request diff checking for correctness, design, architecture, testing, completeness, and adherence to DRY/SRP principles
- Checked CI status and linked issue acceptance criteria
|
|
||
| self.assertIsNotNone(cloned_video.license_id) | ||
| cloned_video.mark_complete() | ||
| self.assertTrue(cloned_video.complete) |
There was a problem hiding this comment.
praise: Good test structure — making the original incomplete via license_id = None, then verifying the cloned node's license_id and complete status are preserved. This directly validates the guard's purpose.
Summary
Adds check to our
sync_nodelogic, which synchronizes metadata and content of imported nodes with their sources, to ensure the source is complete. Otherwise, it logs a warning.References
fixes #5683
related: #5760
Reviewer guidance
Follow the reproduce steps in the issue
AI usage
None