[INFRA-399] feat: SDK v0.2.14 — import_to_project, ProjectMember, WorkspaceMember#43
Conversation
… (INFRA-399) - Add WorkItemTypes.import_to_project() — bulk-links workspace-scoped WITs into a project (POST .../import-work-item-types/). Replaces a raw session.post() in plane-compose. - Add ProjectMember model with role (int) and role_slug (str) fields. Update Projects.get_members() to return list[ProjectMember] instead of list[UserLite], so callers no longer need raw HTTP to capture role. - Add WorkspaceMember model with role (int) and role_slug (str) fields. Update Workspaces.get_members() to return list[WorkspaceMember] instead of list[UserLite], same fix for workspace-level member fetches. - Bump version 0.2.13 → 0.2.14. - Add unit tests for all three changes. Co-authored-by: Plane AI <noreply@plane.so>
|
Warning Review limit reached
More reviews will be available in 52 minutes and 3 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (10)
✨ Finishing Touches🧪 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 |
|
Linked to Plane Work Item(s) References This comment was auto-generated by Plane |
- ProjectMember and WorkspaceMember now inherit from UserLite instead of BaseModel. isinstance(member, UserLite) remains True — no breaking change for existing SDK users who type-check against UserLite. - Duplicate identity fields (id, email, display_name, etc.) removed from both subclasses since they are inherited from UserLite. - Add from __future__ import annotations to projects.py, workspaces.py, and work_item_types.py to prevent the list() method name shadowing the builtin list type in class-body annotations at runtime. Co-authored-by: Plane AI <noreply@plane.so>
Summary
WorkItemTypes.import_to_project()— new method to bulk-link workspace-scoped work item types into a project (POST .../import-work-item-types/). Replaces a rawsession.post()hack in plane-compose.ProjectMembermodel — addsrole: int | Noneandrole_slug: str | Noneto project member responses. UpdatesProjects.get_members()return type fromlist[UserLite]→list[ProjectMember].WorkspaceMembermodel — same fix for workspace-level members. UpdatesWorkspaces.get_members()return type fromlist[UserLite]→list[WorkspaceMember].Role fields have always been in the API response — the SDK was silently dropping them because
UserLiteonly modelled identity fields. plane-compose was falling back to raw HTTP specifically to capturerole/role_slugformembers.yaml.Version
0.2.13→0.2.14Files changed
plane/api/work_item_types.pyimport_to_project()plane/api/projects.pyget_members()returnslist[ProjectMember]plane/api/workspaces.pyget_members()returnslist[WorkspaceMember]plane/models/projects.pyProjectMembermodelplane/models/workspaces.pyWorkspaceMembermodelplane/__init__.pypyproject.toml0.2.13→0.2.14tests/unit/test_work_item_types.pyimport_to_projecttests/unit/test_projects.pytest_get_memberswith type + role checkstests/unit/test_workspaces.pytest_get_memberswith type + role checksTest plan
pytest tests/unit/)import_to_projectreaches the API (verified by smoke test)ProjectMember.roleandrole_slugare non-None on a real workspaceWorkspaceMember.roleandrole_slugare non-None on a real workspaceBlocked by: —
Blocks: INFRA-400 (plane-compose raw HTTP migration)
Co-authored-by: Plane AI noreply@plane.so