Skip to content

feat/collections resource#64

Merged
Prashant-Surya merged 7 commits into
mainfrom
feat/collections-resource
Jul 23, 2026
Merged

feat/collections resource#64
Prashant-Surya merged 7 commits into
mainfrom
feat/collections-resource

Conversation

@sunder-ch

@sunder-ch sunder-ch commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Description

  • collections API methods

Summary by CodeRabbit

  • New Features
    • Added collection management with create, view, update, and delete operations.
    • Added support for organizing pages in collections, including searching, ordering, moving, adding, and removing pages.
    • Added collection membership management with configurable access levels.
    • Added collection-related filters when listing pages.
    • Added support for assigning parent pages and collections when creating pages.
  • Tests
    • Added coverage for collection, page, and membership workflows.
  • Chores
    • Updated the package version to 0.2.21.

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.
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@sunder-ch, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 11 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

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.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 91f8f7e0-ebd5-4e94-aed4-4adfbb57f9d0

📥 Commits

Reviewing files that changed from the base of the PR and between 0ca4459 and 9ffc4f3.

📒 Files selected for processing (1)
  • tests/unit/test_collections.py
📝 Walkthrough

Walkthrough

The 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.

Changes

Collections API

Layer / File(s) Summary
Collection data contracts
plane/models/collections.py, plane/models/pages.py, plane/models/query_params.py
Defines collection, membership, page-association, pagination, enum, page creation, and query parameter models.
Collection API resource
plane/api/collections/*, plane/client/plane_client.py, pyproject.toml
Implements collection CRUD, page operations, membership operations, client exposure, package export, and version 0.2.21.
Collections endpoint validation
tests/unit/test_collections.py
Adds smoke tests for collection CRUD, page associations and hierarchy, and membership behavior.

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
Loading

Suggested reviewers: dheeru0198, prashant-surya

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is relevant and clearly points to the new collections API resource.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/collections-resource

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.

Comment thread plane/models/collections.py Outdated
Comment thread plane/models/collections.py Outdated
Comment thread plane/api/collections.py Outdated
Comment thread tests/unit/test_collections.py Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 78702e9 and 0ca4459.

📒 Files selected for processing (10)
  • plane/api/collections/__init__.py
  • plane/api/collections/base.py
  • plane/api/collections/members.py
  • plane/api/collections/pages.py
  • plane/client/plane_client.py
  • plane/models/collections.py
  • plane/models/pages.py
  • plane/models/query_params.py
  • pyproject.toml
  • tests/unit/test_collections.py

Comment thread plane/api/collections/base.py
Comment thread plane/api/collections/members.py
Comment thread plane/api/collections/pages.py
Comment thread tests/unit/test_collections.py Outdated
Comment thread tests/unit/test_collections.py Outdated
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.
@Prashant-Surya
Prashant-Surya merged commit a789ece into main Jul 23, 2026
1 check passed
@Prashant-Surya
Prashant-Surya deleted the feat/collections-resource branch July 23, 2026 12:45
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.

3 participants