Skip to content

Allow MPTT updates when uploading tree to ensure proper order.#2954

Merged
rtibbles merged 1 commit intolearningequality:hotfixesfrom
kollivier:ricecooker_fix
Feb 16, 2021
Merged

Allow MPTT updates when uploading tree to ensure proper order.#2954
rtibbles merged 1 commit intolearningequality:hotfixesfrom
kollivier:ricecooker_fix

Conversation

@kollivier
Copy link
Copy Markdown
Contributor

Description

Our ricecooker API for adding nodes uses disable_mptt_updates and defers tree processing until finalize_channel is called. However, after the removal of sort_order, this causes MPTT to order the nodes incorrectly. Correct this by removing the disable_mptt_updates call and allowing MPTT to order the tree properly at add time.

Currently this PR has only been manually tested. Ideally, we would have a unit test that confirms the order of children, but unit tests can confirm changes do not introduce regressions.

Note that we'll want to run this with a large-ish tree on hotfixes to ensure performance isn't impacted too significantly. (I can take care of this part.)

Steps to Test

  • Run a large sushi chef

Checklist

  • Is the code clean and well-commented?
  • Are there tests for this change?

Reviewers

If you are looking to assign a reviewer, here are some options:

  • Jordan jayoshih (full stack)
  • Aron aronasorman (back end, devops)
  • Micah micahscopes (full stack)
  • Kevin kollivier (back end)
  • Ivan ivanistheone (Ricecooker)
  • Richard rtibbles (full stack, Kolibri)
  • Radina @radinamatic (documentation)

@kollivier kollivier requested a review from rtibbles February 16, 2021 18:27
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 16, 2021

Codecov Report

Merging #2954 (33434c2) into hotfixes (28587f8) will increase coverage by 4.77%.
The diff coverage is 93.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##           hotfixes    #2954      +/-   ##
============================================
+ Coverage     80.80%   85.58%   +4.77%     
============================================
  Files           281      299      +18     
  Lines         12659    15885    +3226     
============================================
+ Hits          10229    13595    +3366     
+ Misses         2430     2290     -140     
Impacted Files Coverage Δ
contentcuration/contentcuration/decorators.py 56.60% <50.00%> (-37.60%) ⬇️
...ntentcuration/contentcuration/db/models/manager.py 91.20% <90.98%> (-8.80%) ⬇️
contentcuration/contentcuration/forms.py 82.85% <94.31%> (+34.40%) ⬆️
contentcuration/contentcuration/api.py 92.06% <100.00%> (+1.43%) ⬆️
...tentcuration/contentcuration/context_processors.py 100.00% <100.00%> (ø)
...ontentcuration/contentcuration/db/advisory_lock.py 100.00% <100.00%> (ø)
...tcuration/contentcuration/db/models/expressions.py 93.33% <100.00%> (-6.67%) ⬇️
...entcuration/contentcuration/db/models/functions.py 100.00% <100.00%> (ø)
...ation/contentcuration/tests/test_rest_framework.py 36.93% <0.00%> (-63.07%) ⬇️
contentcuration/contentcuration/utils/format.py 21.05% <0.00%> (-49.54%) ⬇️
... and 181 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9edb358...7d4532e. Read the comment docs.

@rtibbles rtibbles merged commit 70a2c19 into learningequality:hotfixes Feb 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants