Skip to content

[INFRA-399] feat: SDK v0.2.14 — import_to_project, ProjectMember, WorkspaceMember#43

Merged
Prashant-Surya merged 2 commits into
mainfrom
infra-399/sdk-wit-import-to-project
Jun 1, 2026
Merged

[INFRA-399] feat: SDK v0.2.14 — import_to_project, ProjectMember, WorkspaceMember#43
Prashant-Surya merged 2 commits into
mainfrom
infra-399/sdk-wit-import-to-project

Conversation

@mguptahub
Copy link
Copy Markdown
Contributor

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 raw session.post() hack in plane-compose.
  • ProjectMember model — adds role: int | None and role_slug: str | None to project member responses. Updates Projects.get_members() return type from list[UserLite]list[ProjectMember].
  • WorkspaceMember model — same fix for workspace-level members. Updates Workspaces.get_members() return type from list[UserLite]list[WorkspaceMember].

Role fields have always been in the API response — the SDK was silently dropping them because UserLite only modelled identity fields. plane-compose was falling back to raw HTTP specifically to capture role/role_slug for members.yaml.

Version

0.2.130.2.14

Files changed

File Change
plane/api/work_item_types.py Add import_to_project()
plane/api/projects.py get_members() returns list[ProjectMember]
plane/api/workspaces.py get_members() returns list[WorkspaceMember]
plane/models/projects.py Add ProjectMember model
plane/models/workspaces.py Add WorkspaceMember model
plane/__init__.py Export new models
pyproject.toml Version bump 0.2.130.2.14
tests/unit/test_work_item_types.py Test import_to_project
tests/unit/test_projects.py Enhanced test_get_members with type + role checks
tests/unit/test_workspaces.py Enhanced test_get_members with type + role checks

Test plan

  • Unit tests pass (pytest tests/unit/)
  • import_to_project reaches the API (verified by smoke test)
  • ProjectMember.role and role_slug are non-None on a real workspace
  • WorkspaceMember.role and role_slug are non-None on a real workspace
  • After merge: plane-compose raw HTTP migration (INFRA-400) can proceed

Blocked by: —
Blocks: INFRA-400 (plane-compose raw HTTP migration)

Co-authored-by: Plane AI noreply@plane.so

… (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>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 1, 2026

Warning

Review limit reached

@mguptahub, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: dc57ba78-7106-45a9-98f4-7de966d0f466

📥 Commits

Reviewing files that changed from the base of the PR and between 8e8240d and a5d52a5.

📒 Files selected for processing (10)
  • plane/__init__.py
  • plane/api/projects.py
  • plane/api/work_item_types.py
  • plane/api/workspaces.py
  • plane/models/projects.py
  • plane/models/workspaces.py
  • pyproject.toml
  • tests/unit/test_projects.py
  • tests/unit/test_work_item_types.py
  • tests/unit/test_workspaces.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch infra-399/sdk-wit-import-to-project

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 and usage tips.

@makeplane
Copy link
Copy Markdown

makeplane Bot commented Jun 1, 2026

- 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>
@Prashant-Surya Prashant-Surya merged commit 2c0aa28 into main Jun 1, 2026
1 check passed
@Prashant-Surya Prashant-Surya deleted the infra-399/sdk-wit-import-to-project branch June 1, 2026 11:32
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