feat/collections resource#64
Conversation
Adds a full Collections resource (create/list/retrieve/update/delete collections, add/list/search/move/remove pages within a collection, and collection member CRUD) matching the new external Collections API, plus `collection_id`/`parent_id` on CreatePage so pages can be created directly inside a collection or as a sub-page.
…ion listing returns root-branch pages only
|
Warning Review limit reached
Next review available in: 11 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe SDK adds collection models, collection CRUD, page and membership sub-resources, client wiring, collection-related page creation fields and query parameters, smoke tests, and a version bump to 0.2.21. ChangesCollections API
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant PlaneClient
participant Collections
participant CollectionPages
participant HTTPAPI
PlaneClient->>Collections: invoke collection operation
Collections->>CollectionPages: invoke page operation
CollectionPages->>HTTPAPI: send request with serialized data
HTTPAPI-->>CollectionPages: return response
CollectionPages-->>PlaneClient: return validated model
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@plane/api/collections/base.py`:
- Around line 29-84: Append a trailing slash to every collection endpoint URL
used by the collection API methods in plane/api/collections/base.py lines 29-84,
every member endpoint in plane/api/collections/members.py lines 24-72, and every
page endpoint in plane/api/collections/pages.py lines 33-104. Update the URL
construction in the relevant list, create, retrieve, update, delete, and related
methods while preserving their existing parameters and behavior.
In `@plane/api/collections/members.py`:
- Around line 27-72: Rename the public CRUD methods consistently: in
plane/api/collections/members.py lines 27-41, rename add to create, and lines
64-72, rename remove to delete; in plane/api/collections/pages.py lines 39-53,
rename add to create, and lines 94-104, rename remove to delete. Preserve each
method’s existing behavior and signatures while applying the required CRUD
naming convention.
In `@plane/api/collections/pages.py`:
- Around line 55-70: The search method currently accepts a raw string and
manually builds query parameters. Add a dedicated Pydantic search-query DTO,
update search to accept that DTO, serialize it using
model_dump(exclude_none=True), and retain
CollectionPageSearchResult.model_validate() for response validation.
In `@tests/unit/test_collections.py`:
- Around line 111-119: In tests/unit/test_collections.py at lines 111-119,
165-175, and 206-210, narrow the exception handling around page and collection
deletion so unexpected remote cleanup failures propagate; suppress only the
documented idempotent “not found” response, and remove blanket Exception/pass
handling at each affected cleanup site.
- Around line 65-77: Move the cleanup guard in this test to begin immediately
after creating the source resource. Initialize target and page variables to
None, wrap their creation in try, and update the cleanup logic to conditionally
delete each resource that was successfully created, including source.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: c1ccf89f-1d0b-48ea-a542-bd0b632d8caa
📒 Files selected for processing (10)
plane/api/collections/__init__.pyplane/api/collections/base.pyplane/api/collections/members.pyplane/api/collections/pages.pyplane/client/plane_client.pyplane/models/collections.pyplane/models/pages.pyplane/models/query_params.pypyproject.tomltests/unit/test_collections.py
Sub-page creation is not supported by the public API (CreatePage.parent_id is accepted but not honored on creation), so the test now covers only the supported page-in-collection behavior.
Description
Summary by CodeRabbit