fix: accept UUID-string assignees/labels in WorkItemDetail - #58
Merged
Merged
Conversation
The work item retrieve endpoints return `assignees` and `labels` as either a list of UUID strings or a list of expanded objects, depending on `?expand=`. WorkItemDetail typed them as bare `list[UserLite]` / `list[Label]`, so the string form raised a pydantic ValidationError — breaking retrieve_work_item, retrieve_work_item_by_identifier and the assignee/label management tools that call retrieve() first. Widen to `list[str] | list[UserLite]` / `list[str] | list[Label]`, mirroring WorkItemExpand which already handled both shapes. Default stays an empty list. Co-Authored-By: WOZCODE <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
ChangesWork item field compatibility
Estimated code review effort: 1 (Trivial) | ~3 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Prashant-Surya
approved these changes
Jul 13, 2026
frostbun
added a commit
to The1Studio/plane-mcp-server
that referenced
this pull request
Aug 24, 2026
…ing assignees (#28) retrieve_work_item and retrieve_work_item_by_identifier raised a pydantic ValidationError for every work item with an assignee. plane-sdk typed WorkItemDetail.assignees as list[UserLite] and .labels as list[Label], but the API returns bare UUID strings unless the caller passes ?expand=, and the SDK validates the raw payload before the tool sees it. Upstream fixed it in 0.2.20 (makeplane/plane-python-sdk#58) by widening both to list[str] | list[UserLite]. Confirmed by reading the tagged content: v0.2.19 still has the narrow type, v0.2.20 has the union. Our pin was 0.2.17. Bumping alone would have swapped one failure for another. manage_work_item_ assignee and manage_work_item_label retrieve without an expand and then read .id off each entry, which raises AttributeError on the string form now that retrieve succeeds. Both go through a _relation_ids helper that handles either shape. That matters more than the crash: those tools rewrite the WHOLE relation list from what they read, so a lenient version returning [] would silently strip every existing assignee off a work item while reporting success. uv.lock is regenerated in the same commit. It had drifted to 0.2.12, five versions behind the manifest, and was missing boto3/fakeredis entirely. Nothing installs from it today (the Dockerfile runs uv pip install ., and the uvx entry builds from pyproject), so this is hygiene rather than the fix - but a lock naming a version nothing resolves to is a false record. Verified against the live API on 0.2.20: a bare retrieve of an assigned work item returns ['f24a83e3-...'], ?expand=assignees still returns UserLite, and search returns 10 results. tests/test_relation_ids.py asserts on the payload sent to update, never on the call returning, and was confirmed to go red (5 of 9) against the pre-fix comprehensions. Fixes #27 Claude-Session: https://claude.ai/code/session_01PwzXvhgY2ZAEebPzFTxQUY Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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.
Description
The work item retrieve endpoints return
assigneesandlabelsas either a list of UUID strings or a list of expanded objects, depending on?expand=. WorkItemDetail typed them as barelist[UserLite]/list[Label], so the string form raised a pydantic ValidationError — breaking retrieve_work_item, retrieve_work_item_by_identifier and the assignee/label management tools that call retrieve() first.Widen to
list[str] | list[UserLite]/list[str] | list[Label], mirroring WorkItemExpand which already handled both shapes. Default stays an empty list.Type of Change
Screenshots and Media (if applicable)
Test Scenarios
References
Summary by CodeRabbit