Skip to content

fix(api): support module sort order updates - #9958

Open
faizansaiyed123 wants to merge 1 commit into
makeplane:previewfrom
faizansaiyed123:fix/module-reorder-api
Open

faizansaiyed123 wants to merge 1 commit into
makeplane:previewfrom
faizansaiyed123:fix/module-reorder-api

Conversation

@faizansaiyed123

@faizansaiyed123 faizansaiyed123 commented Oct 8, 2026 •

Copy link
Copy Markdown

Summary

Related to #9023.

  • Allow sort_order in the public module PATCH request.
  • Keep module creation unchanged; sort_order is update-only.
  • Add contract coverage proving the value persists.
  • Add coverage proving the updated value changes manual module ordering through modules-lite?order_by=sort_order.

Validation

The contract tests are designed against the existing module ordering contract and the existing sort_order FloatField.

The MCP request model currently comes from the separately versioned plane-sdk; enabling the MCP surface requires the corresponding SDK model update as a coordinated follow-up rather than silently accepting and dropping the field.

Summary by CodeRabbit

  • New Features
    • Module order can now be changed by updating a module’s sort position. The new position is saved and reflected in module listings, so modules appear in the requested sequence. This makes it possible to adjust the order of modules and see that order consistently represented in the list.

@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 873fb428-440b-41f7-bfc7-ec65571eab44
📥 Commits

Reviewing files that changed from the base of the PR and between 66c95bd and 4f5a2de.

📒 Files selected for processing (2)
  • apps/api/plane/api/serializers/module.py
  • apps/api/plane/tests/contract/api/test_module_reorder.py

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The module update serializer now accepts sort_order. New contract tests verify that PATCH updates the value and that modules-lite reflects the updated ordering.

Changes

Module sort-order updates

Layer / File(s) Summary
Accept and verify module sort-order updates
apps/api/plane/api/serializers/module.py, apps/api/plane/tests/contract/api/test_module_reorder.py
The update serializer includes sort_order. Contract tests check the PATCH response, persisted value, and modules-lite ordering.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 4f5a2

This enables module sort-order updates while preserving existing creation and listing behavior. No actionable merge-blocking risk is evident.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main API change: enabling module sort order updates.
Description check ✅ Passed The description clearly explains the change, scope, related issue, and contract test coverage. It also notes the MCP SDK dependency. Screenshots are not needed for this API change.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
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.

1 participant