-
Notifications
You must be signed in to change notification settings - Fork 32
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
Add repair page tree CLI command #2242
Conversation
Code Climate has analyzed commit 6705a06 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 0.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 75.4% (-0.5% change). View more on Code Climate. |
6221381
to
1c8d99b
Compare
d6ffc2e
to
97d6bb0
Compare
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.
Awesome, this is very much needed 😍
In general, it seems to work for a few test cases I set up.
However, it did not catch problems in these cases:
- Inconsistencies between the
tree_id
and theparent
field - Inconsistencies between the
depth
and theparent
field - When the
lft
andrgt
values are incorrect in a way that the page is not included inget_children()
I added a few suggestions that take the parent
field as single source of truth and adapts all internal tree fields accordingly. I hope this works completely independent of how bad the tree structure is broken.
However, I did not validate my suggestion against the real database, so I would be very interested in the result it produces.
22b2e46
to
6705a06
Compare
Co-authored-by: Timo Ludwig <timo.ludwig@tuerantuer.org>
836ffb1
to
353254e
Compare
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 did not do super-intensive testing on this, but seems to work well for a few inconsistencies I manually created.
Would be interesting to see how this performs on the production system.
If possible, it would also be cool to create test cases from the currently broken production data, but it's more important that we finally merge this 😄
Short description
Add a shell command that repairs a tree of a given tree node ID.
Proposed changes
Side effects
Resolved issues
Pull Request Review Guidelines