Skip to content

[SILO-1466] feat: api_v2 support via client.v2 (406 operations) - #70

Open
Prashant-Surya wants to merge 1 commit into
mainfrom
feat/silo-1466-python-sdk-v2
Open

[SILO-1466] feat: api_v2 support via client.v2 (406 operations)#70
Prashant-Surya wants to merge 1 commit into
mainfrom
feat/silo-1466-python-sdk-v2

Conversation

@Prashant-Surya

Copy link
Copy Markdown
Member

Description

Adds the complete Plane api_v2 surface to the Python SDK — 406 operations across 120 resource groups — as a single chained form rooted at the workspace, mirroring the API's own scope tree. v1 is untouched (every existing symbol resolves to the same v1 module).

ws = client.v2.workspace("acme")                     # zero-I/O locator
proj = ws.project("ENG")                             # project key or UUID
proj.work_items.create(CreateWorkItem(name="Fix login bug", state="Todo", labels=["bug"]))
proj.work_items.comments.list(work_item_id)
ws.work_items.retrieve_by_identifier("ENG-12")       # readable key, no project needed
ws.wiki.pages.create(CreatePage(name="Runbook"))     # public page -> default collection
client.v2.users.me()                                 # the six non-workspace operations
  • Kernel (plane/api/v2/_kernel/): transport with RFC 9457 problem+json errors, offset/cursor pagination with a stall guard, ?fields / ?expand / ?order_by validated per operation against the OpenAPI golden, upsert, bulk create/update/delete with per-row results, find_by_name, custom verb actions, scope-bound resources.
  • Generated constants (scripts/generate_v2_constants.py) for all 406 operations; every implemented operation is declared in exactly one resource's operations map and a two-way coverage test enforces 406/406.
  • Request models follow v1's convention: Create<Resource> / Update<Resource>; models live in plane.models.v2.
  • Method set is identical to @makeplane/plane-node-sdk (snake_case vs camelCase).
  • Version bumped to 0.3.0; README gains an "API v2" section.

Type of Change

  • Feature (non-breaking change which adds functionality)

Test Scenarios

  • Offline: pytest tests/v2 --ignore=tests/v2/integration — 421 tests against responses mocks asserting verb, exact URL, query, and body; error paths, stall guard, field/expand rejection, bulk cap, find-by-name ambiguity, two-way operation coverage.
  • Live: tests/v2/integration skips without PLANE_BASE_URL / PLANE_API_KEY / WORKSPACE_SLUG; against a plane-dev instance: 362 passed, 23 skipped (feature-mode conflicts), 0 failed — includes an end-to-end scenario (test_full_scenario.py) and the two work-item-type flows ported from plane-ee.
  • ruff clean on the v2 tree; mypy unchanged from main (56 pre-existing v1 findings, 0 in v2).
  • CI: new test.yml runs the offline suite; a secret-gated v2-golden-drift job regenerates the constants against plane-ee's golden.

Follow-ups (not in this PR)

  • The v1 tree still carries 28 pre-existing ruff findings and is not lint-gated by the new workflow.
  • Spec items raised on plane-ee in SILO-1464: page delete requires archive first (undocumented), collection delete orphans pages, pages_* operationIds sit on /collections/.

References

  • SILO-1466
  • Companion: plane-node-sdk [SILO-1463], plane-ee [SILO-1464] (the live suite depends on that permission fix for users/me, permissions/me, worklogs/summary).

🤖 Generated with Claude Code

https://claude.ai/code/session_015XXZ9CT96T1dZoiSYmtiNe

…operations

`client.v2` exposes every api_v2 operation through a single chained form rooted at
the workspace, mirroring the API's own scope tree:

    ws = client.v2.workspace("acme")          # zero-I/O locator
    proj = ws.project("ENG")                  # key or UUID
    proj.work_items.create(WorkItemWrite(name="Fix login bug", state="Todo"))
    ws.work_items.retrieve_by_identifier("ENG-12")
    ws.wiki.pages.create(PageWrite(name="Runbook"))   # public page -> default collection
    client.v2.users.me()                      # the six non-workspace operations

- Kernel: transport with RFC 9457 errors, offset/cursor envelopes with a stall
  guard, ?fields/?expand/?order_by validated per operation against the golden,
  upsert, bulk create/update/delete with per-row results, find_by_name, custom
  verb actions, scope-bound resources (`V2Resource(transport, **scope)`).
- Spec-generated constants (`scripts/generate_v2_constants.py`) for all 406
  operations; every implemented operation is declared in exactly one resource's
  `operations` map and a two-way coverage test enforces 406/406.
- Method set is identical to @makeplane/plane-node-sdk (snake_case vs camelCase).
- Offline tests under tests/v2 (responses); live tests under tests/v2/integration
  skip without PLANE_BASE_URL/PLANE_API_KEY/WORKSPACE_SLUG.
- CI: .github/workflows/test.yml runs the offline suite; a secret-gated
  `v2-golden-drift` job regenerates the constants against plane-ee's golden.
- Version 0.3.0. v1 surface untouched.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XXZ9CT96T1dZoiSYmtiNe
@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 245 files, which is 145 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 48a67460-7342-4dd5-bb89-1dd91b37503b

📥 Commits

Reviewing files that changed from the base of the PR and between 31a4f9e and 5ae278c.

⛔ Files ignored due to path filters (2)
  • plane/api/v2/_generated/__init__.py is excluded by !**/_generated/**
  • plane/api/v2/_generated/constants.py is excluded by !**/_generated/**
📒 Files selected for processing (245)
  • .github/workflows/test.yml
  • CLAUDE.md
  • README.md
  • plane/__init__.py
  • plane/api/v2/__init__.py
  • plane/api/v2/_kernel/__init__.py
  • plane/api/v2/_kernel/errors.py
  • plane/api/v2/_kernel/pagination.py
  • plane/api/v2/_kernel/resource.py
  • plane/api/v2/_kernel/transport.py
  • plane/api/v2/artifacts.py
  • plane/api/v2/assets.py
  • plane/api/v2/audit_logs.py
  • plane/api/v2/automations/__init__.py
  • plane/api/v2/automations/activities.py
  • plane/api/v2/automations/edges.py
  • plane/api/v2/automations/nodes.py
  • plane/api/v2/collections/__init__.py
  • plane/api/v2/collections/members.py
  • plane/api/v2/collections/pages.py
  • plane/api/v2/customer_properties.py
  • plane/api/v2/customers/__init__.py
  • plane/api/v2/customers/customers.py
  • plane/api/v2/customers/property_values.py
  • plane/api/v2/customers/requests.py
  • plane/api/v2/cycles.py
  • plane/api/v2/estimates/__init__.py
  • plane/api/v2/estimates/points.py
  • plane/api/v2/features.py
  • plane/api/v2/group_sync/__init__.py
  • plane/api/v2/group_sync/config.py
  • plane/api/v2/group_sync/project_mappings.py
  • plane/api/v2/group_sync/workspace_mappings.py
  • plane/api/v2/initiatives/__init__.py
  • plane/api/v2/initiatives/initiatives.py
  • plane/api/v2/initiatives/labels.py
  • plane/api/v2/intakes.py
  • plane/api/v2/invitations.py
  • plane/api/v2/labels.py
  • plane/api/v2/members.py
  • plane/api/v2/milestones.py
  • plane/api/v2/modules.py
  • plane/api/v2/pages.py
  • plane/api/v2/permission_schemes.py
  • plane/api/v2/permissions.py
  • plane/api/v2/project.py
  • plane/api/v2/projects.py
  • plane/api/v2/releases/__init__.py
  • plane/api/v2/releases/changelog.py
  • plane/api/v2/releases/comments.py
  • plane/api/v2/releases/labels.py
  • plane/api/v2/releases/links.py
  • plane/api/v2/releases/tags.py
  • plane/api/v2/roles.py
  • plane/api/v2/states.py
  • plane/api/v2/stickies.py
  • plane/api/v2/teamspaces.py
  • plane/api/v2/users.py
  • plane/api/v2/views/__init__.py
  • plane/api/v2/views/project.py
  • plane/api/v2/views/workspace.py
  • plane/api/v2/webhook_logs.py
  • plane/api/v2/webhooks.py
  • plane/api/v2/wiki.py
  • plane/api/v2/work_item_properties/__init__.py
  • plane/api/v2/work_item_properties/contexts.py
  • plane/api/v2/work_item_properties/options.py
  • plane/api/v2/work_item_properties/workspace_options.py
  • plane/api/v2/work_item_relation_definitions.py
  • plane/api/v2/work_item_templates/__init__.py
  • plane/api/v2/work_item_templates/project.py
  • plane/api/v2/work_item_templates/workspace.py
  • plane/api/v2/work_item_types/__init__.py
  • plane/api/v2/work_item_types/properties.py
  • plane/api/v2/work_items/__init__.py
  • plane/api/v2/work_items/activities.py
  • plane/api/v2/work_items/attachments.py
  • plane/api/v2/work_items/comments.py
  • plane/api/v2/work_items/dependencies.py
  • plane/api/v2/work_items/links.py
  • plane/api/v2/work_items/relations.py
  • plane/api/v2/work_items/worklogs.py
  • plane/api/v2/work_items/workspace.py
  • plane/api/v2/workflows/__init__.py
  • plane/api/v2/workflows/states.py
  • plane/api/v2/workflows/transitions.py
  • plane/api/v2/workflows/workflows.py
  • plane/api/v2/worklogs.py
  • plane/api/v2/workspace.py
  • plane/client/plane_client.py
  • plane/config.py
  • plane/models/v2/__init__.py
  • plane/models/v2/artifacts.py
  • plane/models/v2/assets.py
  • plane/models/v2/audit_logs.py
  • plane/models/v2/automations.py
  • plane/models/v2/collections.py
  • plane/models/v2/common.py
  • plane/models/v2/customer_properties.py
  • plane/models/v2/customers.py
  • plane/models/v2/cycle_actions.py
  • plane/models/v2/cycles.py
  • plane/models/v2/estimates.py
  • plane/models/v2/features.py
  • plane/models/v2/group_sync.py
  • plane/models/v2/initiatives.py
  • plane/models/v2/intakes.py
  • plane/models/v2/invitations.py
  • plane/models/v2/labels.py
  • plane/models/v2/members.py
  • plane/models/v2/milestone_work_items.py
  • plane/models/v2/milestones.py
  • plane/models/v2/module_work_items.py
  • plane/models/v2/modules.py
  • plane/models/v2/pages.py
  • plane/models/v2/permission_schemes.py
  • plane/models/v2/permissions.py
  • plane/models/v2/project_role_distribution.py
  • plane/models/v2/projects.py
  • plane/models/v2/releases.py
  • plane/models/v2/roles.py
  • plane/models/v2/states.py
  • plane/models/v2/stickies.py
  • plane/models/v2/teamspaces.py
  • plane/models/v2/users.py
  • plane/models/v2/views.py
  • plane/models/v2/webhook_logs.py
  • plane/models/v2/webhooks.py
  • plane/models/v2/work_item_properties.py
  • plane/models/v2/work_item_relation_definitions.py
  • plane/models/v2/work_item_templates.py
  • plane/models/v2/work_item_types.py
  • plane/models/v2/work_items.py
  • plane/models/v2/workflows.py
  • plane/models/v2/worklogs_summary.py
  • pyproject.toml
  • scripts/generate_v2_constants.py
  • tests/v2/__init__.py
  • tests/v2/conftest.py
  • tests/v2/fixtures/__init__.py
  • tests/v2/fixtures/_hidden/__init__.py
  • tests/v2/fixtures/_hidden/resource.py
  • tests/v2/fixtures/nested/__init__.py
  • tests/v2/fixtures/nested/deep/__init__.py
  • tests/v2/fixtures/nested/deep/resource.py
  • tests/v2/integration/__init__.py
  • tests/v2/integration/conftest.py
  • tests/v2/integration/helpers.py
  • tests/v2/integration/test_artifacts.py
  • tests/v2/integration/test_assets.py
  • tests/v2/integration/test_audit_logs.py
  • tests/v2/integration/test_automations.py
  • tests/v2/integration/test_bulk.py
  • tests/v2/integration/test_collections.py
  • tests/v2/integration/test_crud.py
  • tests/v2/integration/test_customer_properties.py
  • tests/v2/integration/test_customers.py
  • tests/v2/integration/test_cycle_actions.py
  • tests/v2/integration/test_errors.py
  • tests/v2/integration/test_estimates.py
  • tests/v2/integration/test_features.py
  • tests/v2/integration/test_find_one.py
  • tests/v2/integration/test_full_scenario.py
  • tests/v2/integration/test_group_sync.py
  • tests/v2/integration/test_initiatives.py
  • tests/v2/integration/test_intakes.py
  • tests/v2/integration/test_invitations.py
  • tests/v2/integration/test_members.py
  • tests/v2/integration/test_milestone_work_items.py
  • tests/v2/integration/test_module_work_items.py
  • tests/v2/integration/test_pages.py
  • tests/v2/integration/test_pagination.py
  • tests/v2/integration/test_permission_schemes.py
  • tests/v2/integration/test_permissions.py
  • tests/v2/integration/test_project_work_item_types_flow.py
  • tests/v2/integration/test_projects.py
  • tests/v2/integration/test_releases.py
  • tests/v2/integration/test_roles.py
  • tests/v2/integration/test_scope_parity.py
  • tests/v2/integration/test_stickies.py
  • tests/v2/integration/test_teamspaces.py
  • tests/v2/integration/test_upsert.py
  • tests/v2/integration/test_users.py
  • tests/v2/integration/test_views.py
  • tests/v2/integration/test_webhook_logs.py
  • tests/v2/integration/test_webhooks.py
  • tests/v2/integration/test_work_item_properties.py
  • tests/v2/integration/test_work_item_relation_definitions.py
  • tests/v2/integration/test_work_item_sub_resources.py
  • tests/v2/integration/test_work_item_templates.py
  • tests/v2/integration/test_work_item_types.py
  • tests/v2/integration/test_work_items.py
  • tests/v2/integration/test_workflows.py
  • tests/v2/integration/test_worklogs_summary.py
  • tests/v2/integration/test_workspace_work_item_types_flow.py
  • tests/v2/integration/test_workspace_work_items.py
  • tests/v2/test_artifacts_resource.py
  • tests/v2/test_assets_resource.py
  • tests/v2/test_audit_logs_resource.py
  • tests/v2/test_automations_resource.py
  • tests/v2/test_bulk.py
  • tests/v2/test_collections_resource.py
  • tests/v2/test_customer_properties_resource.py
  • tests/v2/test_customers_resource.py
  • tests/v2/test_cycles_resource.py
  • tests/v2/test_errors.py
  • tests/v2/test_estimates_resource.py
  • tests/v2/test_features_resource.py
  • tests/v2/test_find_one.py
  • tests/v2/test_generated_constants.py
  • tests/v2/test_group_sync_resource.py
  • tests/v2/test_initiatives_resource.py
  • tests/v2/test_intakes_resource.py
  • tests/v2/test_invitations_resource.py
  • tests/v2/test_labels_resource.py
  • tests/v2/test_live_smoke.py
  • tests/v2/test_locators.py
  • tests/v2/test_members_resource.py
  • tests/v2/test_milestones_resource.py
  • tests/v2/test_modules_resource.py
  • tests/v2/test_operations_coverage.py
  • tests/v2/test_pages_resource.py
  • tests/v2/test_pagination.py
  • tests/v2/test_permission_schemes_resource.py
  • tests/v2/test_permissions_resource.py
  • tests/v2/test_projects_resource.py
  • tests/v2/test_releases_resource.py
  • tests/v2/test_resource.py
  • tests/v2/test_roles_resource.py
  • tests/v2/test_states_resource.py
  • tests/v2/test_stickies_resource.py
  • tests/v2/test_teamspaces_resource.py
  • tests/v2/test_transport.py
  • tests/v2/test_users_resource.py
  • tests/v2/test_views_resource.py
  • tests/v2/test_webhook_logs_resource.py
  • tests/v2/test_webhooks_resource.py
  • tests/v2/test_work_item_properties_resource.py
  • tests/v2/test_work_item_relation_definitions_resource.py
  • tests/v2/test_work_item_templates_resource.py
  • tests/v2/test_work_item_types_resource.py
  • tests/v2/test_work_items_resource.py
  • tests/v2/test_workflows_resource.py
  • tests/v2/test_worklogs_summary_resource.py
  • tests/v2/test_workspace_work_items_resource.py

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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.

@makeplane

makeplane Bot commented Aug 30, 2026

Copy link
Copy Markdown

Linked to Plane Work Item(s)

This comment was auto-generated by Plane

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.

1 participant