Repository navigation
Conversation
ancestor_title names a group the body never titled by its bare
number ("6.3.3"). _section_number could not parse it, so any stack
lookup on that group raised TypeError and remediation failed with
an empty section tree.
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
Frappe now rejects a tree node whose parent is not a group (frappe/frappe@10c5427c51). create_section inserted a child under a leaf and relied on _rebuild_tree to set is_group afterwards, so the insert failed with "must be a group node".
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
Remediation failed on two real manuals (Nephrology, Obstetrics) with
TypeError: 'NoneType' object is not subscriptablein_repeats_open_section. The import landed in Review with an empty Wiki tree.When a sub-section (
6.3.3.1) opens before its parent, and no TOC or running header names the parent,ancestor_titlefalls back to the bare number"6.3.3". The stack marks it numbered, but_section_numberused_NUM_RE, which needs text after the number, so it returnedNone.Fix
_section_numbernow also reads a bare dotted number.Tests
test_sectionize: 77 passed. Full app suite passes.Screenshots
Before (Obstetrics import, Wiki tab)
After
CI
Frappe develop now requires a tree node's parent to be a group (frappe/frappe@10c5427c51).
create_sectionadded a child under a leaf and setis_grouponly afterwards, sotest_sync_group_needs_regenerate_when_child_missing_wikifailed onmaintoo. It now marks the parent as a group before the insert. The full suite (591 tests) passes locally with that frappe commit applied.