Skip to content

fix: accept UUID-string assignees/labels in WorkItemDetail - #58

Merged
Prashant-Surya merged 1 commit into
mainfrom
fix/work-item-detail-assignees-labels-union
Jul 13, 2026
Merged

Prashant-Surya merged 1 commit into
mainfrom
fix/work-item-detail-assignees-labels-union

Conversation

@akhil-vamshi-konam

@akhil-vamshi-konam akhil-vamshi-konam commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

Description

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.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Improvement (change that would cause existing functionality to not work as expected)
  • Code refactoring
  • Performance improvements
  • Documentation update

Screenshots and Media (if applicable)

Test Scenarios

References

Summary by CodeRabbit

  • Bug Fixes
    • Fixed work item details failing validation when assignees or labels are returned as UUIDs instead of expanded objects.
    • Work item details now consistently support both compact ID lists and expanded assignee or label data.

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]>
@coderabbitai

coderabbitai Bot commented Jul 13, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f5312041-93c3-40db-9a77-2a9faa6b9830

📥 Commits

Reviewing files that changed from the base of the PR and between 125d8f8 and 0f34d70.

📒 Files selected for processing (1)
  • plane/models/work_items.py

📝 Walkthrough

Walkthrough

WorkItemDetail now accepts assignee and label collections as either UUID strings or expanded objects, with documentation describing the API’s ?expand= behavior.

Changes

Work item field compatibility

Layer / File(s) Summary
Flexible assignee and label fields
plane/models/work_items.py
WorkItemDetail.assignees and labels accept either UUID string lists or expanded object lists while retaining empty-list defaults and documenting the expansion behavior.

Estimated code review effort: 1 (Trivial) | ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: WorkItemDetail now accepts UUID-string assignees and labels.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/work-item-detail-assignees-labels-union

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.

@Prashant-Surya
Prashant-Surya merged commit 3795bed into main Jul 13, 2026
4 checks passed
@Prashant-Surya
Prashant-Surya deleted the fix/work-item-detail-assignees-labels-union branch July 13, 2026 10:41
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]>
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