[SILO-1466] feat: api_v2 support via client.v2 (406 operations) - #70
[SILO-1466] feat: api_v2 support via client.v2 (406 operations)#70Prashant-Surya wants to merge 1 commit into
Conversation
…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
|
Important Review skippedToo 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (245)
You can disable this status message by setting the 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)
This comment was auto-generated by Plane |
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).
plane/api/v2/_kernel/): transport with RFC 9457problem+jsonerrors, offset/cursor pagination with a stall guard,?fields/?expand/?order_byvalidated per operation against the OpenAPI golden, upsert, bulk create/update/delete with per-row results,find_by_name, custom verb actions, scope-bound resources.scripts/generate_v2_constants.py) for all 406 operations; every implemented operation is declared in exactly one resource'soperationsmap and a two-way coverage test enforces 406/406.Create<Resource>/Update<Resource>; models live inplane.models.v2.@makeplane/plane-node-sdk(snake_case vs camelCase).Type of Change
Test Scenarios
pytest tests/v2 --ignore=tests/v2/integration— 421 tests againstresponsesmocks asserting verb, exact URL, query, and body; error paths, stall guard, field/expand rejection, bulk cap, find-by-name ambiguity, two-way operation coverage.tests/v2/integrationskips withoutPLANE_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.ruffclean on the v2 tree;mypyunchanged frommain(56 pre-existing v1 findings, 0 in v2).test.ymlruns the offline suite; a secret-gatedv2-golden-driftjob regenerates the constants against plane-ee's golden.Follow-ups (not in this PR)
pages_*operationIds sit on/collections/.References
[SILO-1463], plane-ee[SILO-1464](the live suite depends on that permission fix forusers/me,permissions/me,worklogs/summary).🤖 Generated with Claude Code
https://claude.ai/code/session_015XXZ9CT96T1dZoiSYmtiNe