Repository navigation
feat(llc): hierarchy refusals are 422, rules and violation report served and shown, backlog load fixes (#20936, #21032) - #21062
Conversation
… sequence, show fetch failures, roll back the current Kanban card (#21032) - move_subtree_to_project updates descendants in SUBTREE_UPDATE_BATCH-sized statements in the caller's transaction (one IN over >32,767 ids exceeds the bind-parameter limit); a failing later discovery query issues no update. - A behavioural checkout test: an unlocked user-assigned item ends with a null user id, the agent id and assignee type agent. - useBacklogItems: only the latest request writes the list, isLoading and the new loadFailed state; BacklogView shows the failure with a Retry instead of "No items match" and drops the create-refresh warning on a company change. - Kanban: a refused move rolls back the current card, found by id. - Bulk sprint assignment leaves BacklogView for BacklogBulkAssignModal (on the kit form field), which takes BacklogView under the 600-line limit: its size exemption is retired. The native-control classes are shared in controlClass.ts. - A vitest for the llc.enums label mapping in workItemTypes.ts.
…on report are served and shown in the Backlog view (#20936) - Create and update answer a HierarchyViolation (including ProjectRequired) with 422; any other ValueError stays 400 (write_refusal in api/_common.py). - GET /api/llc/work-items/hierarchy-rules serves the parent-type table built from ALLOWED_PARENT_TYPES / PROJECT_REQUIRED_TYPES; GET .../hierarchy-violations returns find_hierarchy_violations for company owners/admins and platform admins (403 otherwise). Both check company access first (404 across companies, as the list route does) and are included before work_items.router so the /{work_item_id} capture cannot shadow them. - useWorkItemHierarchy reads both on the generated contract types; the Backlog view gets a read-only "Hierarchy rules" section and an admin-only collapsible "Hierarchy violations" section (BacklogHierarchyPanel). api.ts regenerated.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 30 minutes. View limit details
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. |
|
Code review (code-reviewer pass) at d4d6acb Verdict: APPROVE. No blocking finding. 26 changed files, 0 behind main, 0 unresolved review threads. The findings below are advisory (L = fix in this PR if cheap, otherwise follow-up) plus one owner decision.
Verified against code, no finding:
Issue ACs: #20936 AC1 to AC3 met (tests present); AC4 (unconnected-code gate) is satisfied by the frontend composable calling both routes through the generated |
…lears rows, BaseButton retry, translated reason codes, SQL-bounded report (#20936)
|
Code review (code-reviewer pass) at c39b62e Verdict: APPROVE. Delta d4d6acb..c39b62e is one commit. The SQL rewrite matches the old Python logic for all five codes (hand-traced), the CTE terminates, and nothing crosses a company. The findings below are non-blocking. Branch is 78 commits behind main; the train rebases it.
Verified OK
|
…eSQL rendering and filter/label agreement (#20936)
|
Code review (delta check) at 10d1427, after APPROVE at c39b62e. One own commit ( |
|
Delta review: 10d1427 after approved c39b62e. Verdict: APPROVE
|
|
Merge check at 21e6326: MERGE-OK. The three merge commits (21e6326, b6653ff, b4613af) have no combined hunks, so every file came cleanly from one side. Against main, the ratchet diff only lowers two pins this branch earns: |
✅ SSOT Configuration Compliance: Passing🎉 No new hardcoded values of either class — Known backlog in |
Closes #20936
Closes #21032
Thinking Path
#20936 closes the two unmet #18978 criteria: a hierarchy breach is answered 422 (not 400), and the rule table and the existing-violation report are served and shown. #21032 is the minor review findings from the #20947 train PR, in the same files.
Single-issue rationale
Two issues, one PR, because they touch the same files (
work_item_hierarchy.py, its tests,BacklogView.vue,en.json). Separate PRs would conflict on every one of them.What Changed
#20936
HierarchyViolation(includingProjectRequired) with 422; any otherValueErrorstays 400 (write_refusalinllc/api/_common.py).GET /api/llc/work-items/hierarchy-rulesandGET /api/llc/work-items/hierarchy-violations, with Pydantic response models. Both check company access first (404 across companies, as the list route does). The report is gated by the existingrequire_company_admin_unless_platform(403 otherwise), with no new admin-named function.work_items_router, becausework_items.pyis at its line baseline and the/{work_item_id}capture must not shadow them.useWorkItemHierarchy(typed from the generated contract, full/api/llc/...paths) andBacklogHierarchyPanel: a read-only "Hierarchy rules" section and an admin-only collapsible "Hierarchy violations" section.api.tsregenerated last.StuckFileCleanupPanelpattern.#21032
move_subtree_to_projectwrites in bounded batches in the same transaction; a failing later discovery query issues no update.useBacklogItems: request-sequence guard on the list andisLoading, plus a distinct fetch-failure state with a Retry; the create-refresh warning is cleared on a company change.llc.enumslabel mapping inworkItemTypes.ts.BacklogBulkAssignModal, which takesBacklogViewunder 600 lines, so its size exemption is retired. Fragmentation baselines lowered (modal 25 to 24, distinct classes 5324 to 5323).Verification
llc/+tests/unit/llc/at-n 2: 3594 passed, 2 skipped.views/llc,components/llc,composables/llc: 92 files, 814 passed.reka-ui, so the local vitest run used a temporary config aliasing it to a stub. That config was deleted and is not committed; CI uses the real package.Review fixes
useWorkItemHierarchy.ts).reset()clears rules, violations, error and hidden state and invalidates in-flight requests before the new fetch.BacklogView.vueareBaseButton.find_hierarchy_violationsreturns a stablecode(parent_cycle,parent_missing,parent_type_not_allowed,project_mismatch,project_required) plustypeandparent_type; the panel rendersllc.backlog.hierarchyReason.<code>fromen.json. Englishreasonkept for logs and API consumers.types/generated/api.tsregenerated.AUTOBOT_LLC_HIERARCHY_VIOLATIONS_LIMIT(default 500, range 1-5000); the response carriestruncatedand the panel shows a translated "showing first N" note.Model Used
Claude Sonnet 5.5
🤖 Generated with Claude Code