You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: parse Community Edition work item relation references - #82
client.work_items.relations.list() raises a Pydantic ValidationError whenever Plane Community Edition returns a non-empty relation group. The v1 endpoint returns {project_id, issue_id} references, while WorkItemRelationResponse currently requires strings.
The new reference model requires both IDs and preserves extra response fields. Existing bare-ID inputs and serialization stay supported. The README demonstrates how to consume either shape. CI now runs the offline v1 contract tests and scoped lint alongside the existing v2 checks.
Before: the new suite fails 9 tests with Input should be a valid string for valid reference objects. After: all 19 tests pass. Coverage includes all eight groups, empty groups, existing bare IDs, extra fields, malformed references, and propagation of HTTP 401/403/404/500.
python -m pytest tests/v2 --ignore=tests/v2/integration -q --tb=short: passed (two skips), on Windows / Python 3.14.7.
Ruff 0.6.9 passes on both changed Python files; Black 26.10.1 check passes; git diff --check passes.
Read-only live diagnosis: /relations/ returns 200, while /dependencies/ and /work-item-relation-definitions/ return 404 on the same self-hosted instance. That live response contained empty groups; non-empty reference parsing is verified with mocked HTTP responses matching the upstream implementation. No live records were changed.
Merge Danger
Door: two-way
Model-only runtime change; no persistence, transport, or dependency changes. Revert restores the previous parsing behavior.
Blast Radius: v1-relations
The eight response fields now have a union element type. Existing string entries remain strings; consumers handling object entries can use the typed project and issue IDs. Static callers assuming every entry is a string need to narrow the type, as shown in the README. The separate v2 relation models are untouched.
Summary by CodeRabbit
New Features
Work item relation responses now support both bare issue IDs and structured references containing project and issue IDs across all relation types.
Empty relation groups continue to be supported, while malformed structured references are rejected.
Documentation
Updated the work item sub-resources example to show both supported formats for blocked_by targets.
No actionable comments were generated in the recent review.
Walkthrough
The work-item relation response model now accepts related items as either string IDs or reference objects with project and issue IDs. The README example and offline tests cover these response shapes, and the test workflow runs the new test.
WorkItemRelationReference requires project and issue IDs. All eight relation groups accept reference objects or string IDs. The example handles both shapes.
This change lets relation responses from Community Edition parse correctly while still accepting the previous string IDs. No merge-blocking risk was found. Consumers that handle relation entries may need to narrow the type to cover objects.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title "fix: parse Community Edition work item relation references" matches the main change. The PR changes WorkItemRelationResponse so its eight relation groups accept either bare string IDs or Wo…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "fix: parse Community Edition work item relation references" matches the main change. The PR changes WorkItemRelationResponse so its eight relation groups accept either bare string IDs or WorkItemRelationReference objects with project_id and issue_id. The title names the Community Edition context and the relation reference parsing, which are the core of the change. It is concise, specific, and follows a conventional commit prefix.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · 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.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: defaults
Review profile: CHILL
Plan: Advanced
Run ID: 44c2143a-9911-4897-94d7-8620e31de9ec
Commits
Reviewing files that changed from the base of the PR and between 4fe2ec8 and d6d3cd3.
Files selected for processing: 4
.github/workflows/test.yml
README.md
plane/models/work_items.py
tests/test_work_item_relation_response.py
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
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
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.
Summary
client.work_items.relations.list()raises a PydanticValidationErrorwhenever Plane Community Edition returns a non-empty relation group. The v1 endpoint returns{project_id, issue_id}references, whileWorkItemRelationResponsecurrently requires strings.The new reference model requires both IDs and preserves extra response fields. Existing bare-ID inputs and serialization stay supported. The README demonstrates how to consume either shape. CI now runs the offline v1 contract tests and scoped lint alongside the existing v2 checks.
The response shape comes from Plane v1.4.3's IssueRelationListCreateAPIEndpoint. It also preserves project context for cross-project relations.
This complements makeplane/plane-mcp-server#265, which currently bypasses this model using
_get, and relates to makeplane/plane-mcp-server#185. It does not change MCP endpoint selection or add endpoints missing from CE.Evidence
Input should be a valid stringfor valid reference objects.After: all 19 tests pass. Coverage includes all eight groups, empty groups, existing bare IDs, extra fields, malformed references, and propagation of HTTP 401/403/404/500.
python -m pytest tests/v2 --ignore=tests/v2/integration -q --tb=short: passed (two skips), on Windows / Python 3.14.7.git diff --checkpasses./relations/returns 200, while/dependencies/and/work-item-relation-definitions/return 404 on the same self-hosted instance. That live response contained empty groups; non-empty reference parsing is verified with mocked HTTP responses matching the upstream implementation. No live records were changed.Merge Danger
Door: two-way
Model-only runtime change; no persistence, transport, or dependency changes. Revert restores the previous parsing behavior.
Blast Radius: v1-relations
The eight response fields now have a union element type. Existing string entries remain strings; consumers handling object entries can use the typed project and issue IDs. Static callers assuming every entry is a string need to narrow the type, as shown in the README. The separate v2 relation models are untouched.
Summary by CodeRabbit
blocked_bytargets.