Skip to content

feat: expand API resource coverage and harden test suite#53

Open
akhil-vamshi-konam wants to merge 8 commits into
mainfrom
feat/expand-api-resource-coverage
Open

feat: expand API resource coverage and harden test suite#53
akhil-vamshi-konam wants to merge 8 commits into
mainfrom
feat/expand-api-resource-coverage

Conversation

@akhil-vamshi-konam

@akhil-vamshi-konam akhil-vamshi-konam commented Jul 24, 2026

Copy link
Copy Markdown

Summary

Broadens the SDK's endpoint coverage with several new resources and sub-resources, corrects a set of wrong endpoint URLs and models, and makes the live test suite reliable and honest.

New resources

  • Collections — folders that group workspace pages, with members and pages sub-resources
  • Estimates — estimate CRUD plus estimate-points
  • Roles — workspace/project role definitions (read-only)

New sub-resources & methods

  • WorkItems — dependencies, customRelations, pages; workspace-wide list + count; archive / unarchive / listArchived
  • Releases — changelog, comments, links, workItems sub-resources; retrieve / delete; label & tag retrieve / update / delete
  • WorkItemProperties — project-level CRUD plus attach/detach to a type
  • Pages — list for workspace and project pages
  • Workspace — getMembersLite, getProjectRoleDistribution
  • Projects / Cycles / Modules — lite listings; project members-lite
  • WorkspaceWorkItemTypes — retrieve, delete
  • WorkspaceWorkItemProperties — property retrieve; option retrieve / delete
  • Intake — status transition
  • Users — asset upload
  • Customers — bulk property-values create; delete by external reference

Fixes

  • Correct diverging URLs: project-members, total-worklogs, archived-modules, cycle archive, and the import-work-item-types payload key
  • Reshape ReleaseTag model to version / commit / git metadata
  • BaseResource.httpDelete now accepts query params; error dump gated behind enableLogging
  • CreatePage supports parent_id / collection_id
  • Remove non-functional Members stub

Tests

  • Live conditional suites added for every new resource
  • Fix outdated request payloads and helper misuse in existing suites
  • Skip guards now match specific server messages, so unsupported / feature-gated cases skip without hiding real failures
  • Auto-load .env via dotenv for local runs
Screenshot 2026-07-24 at 10 48 59 PM

Summary by CodeRabbit

  • New Features
    • Added Collections management, including pages and members.
    • Added Estimates, Roles, and expanded Releases capabilities for changelogs, comments, links, labels, tags, and work items.
    • Added work item archiving, workspace listings/counts, dependencies, custom relations, and page links.
    • Added lite listings for projects, cycles, modules, and members.
    • Added epic management, customer property updates, user asset uploads, intake status updates, and workspace analytics.
  • Bug Fixes
    • Improved request handling, deletion options, endpoint behavior, and configurable error logging.
  • Tests
    • Expanded coverage across new and updated API capabilities.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The SDK expands Plane API coverage with Collections, Estimates, Roles, Release sub-resources, Work Item relations, lite listings, additional property/page operations, updated models and exports, configurable test logging, dotenv-based test setup, and broader integration tests.

Changes

API resource expansion

Layer / File(s) Summary
Collections, estimates, and roles
src/api/Collections/..., src/api/Estimates.ts, src/api/Roles.ts, src/client/plane-client.ts
Adds collection management with member/page sub-resources, estimate and estimate-point operations, read-only role access, and client wiring.
Release resource expansion
src/api/Releases/..., src/models/Release.ts
Adds release retrieval/deletion plus changelog, comments, links, work-item, label, and tag operations.
Work items, properties, and pages
src/api/WorkItems/..., src/api/WorkItemProperties/index.ts, src/api/WorkspaceWorkItemProperties/...
Adds relations, page links, archive operations, project-level properties, option retrieval/deletion, and workspace type/property operations.
Supporting API surfaces
src/api/Customers/..., src/api/Cycles.ts, src/api/Modules.ts, src/api/Pages.ts, src/api/Projects.ts, src/api/Workspace.ts
Adds customer property values, external-ID deletion, lite listings, page management, member pagination, work-log routing, intake status updates, user asset uploads, and workspace role distributions.
Contracts and validation
src/models/*, src/index.ts, tests/unit/*
Adds request/response models, updates release and page contracts, expands exports, and adds or adjusts conditional integration tests.
Test setup and error handling
jest.config.js, package.json, src/api/BaseResource.ts
Loads dotenv during Jest initialization, forwards DELETE query parameters, and gates raw error logging on configuration.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

Suggested reviewers: sriramveeraghanta

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main themes: broader API coverage and test-suite hardening.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/expand-api-resource-coverage

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.

@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: 10

🧹 Nitpick comments (13)
src/api/Collections/Members.ts (1)

1-3: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use kebab-case for the new source filenames.

  • src/api/Collections/Members.ts#L1-L3: rename to members.ts and update imports.
  • src/api/Collections/Pages.ts#L1-L11: rename to pages.ts and update imports.
  • src/api/Estimates.ts#L1-L11: rename to estimates.ts and update imports.
  • src/api/Roles.ts#L1-L4: rename to roles.ts and update imports.

As per coding guidelines, src/**/*.ts files must “Use kebab-case for file names.”

🤖 Prompt for 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.

In `@src/api/Collections/Members.ts` around lines 1 - 3, Rename
src/api/Collections/Members.ts to members.ts, src/api/Collections/Pages.ts to
pages.ts, src/api/Estimates.ts to estimates.ts, and src/api/Roles.ts to
roles.ts; update every import or reference to use the new kebab-case filenames.

Source: Coding guidelines

src/api/WorkItems/CustomRelations.ts (2)

1-3: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use kebab-case resource filenames consistently.

  • src/api/WorkItems/CustomRelations.ts#L1-L3: rename to custom-relations.ts.
  • src/api/WorkItems/Dependencies.ts#L1-L7: rename to dependencies.ts.
  • src/api/WorkItems/Pages.ts#L1-L4: rename to pages.ts.
  • src/api/WorkItems/index.ts#L23-L25: update imports for the renamed modules.

As per coding guidelines, src/**/*.ts filenames must use kebab-case.

🤖 Prompt for 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.

In `@src/api/WorkItems/CustomRelations.ts` around lines 1 - 3, Rename
CustomRelations.ts to custom-relations.ts, Dependencies.ts to dependencies.ts,
and Pages.ts to pages.ts to comply with kebab-case filename conventions. Update
the imports in src/api/WorkItems/index.ts lines 23-25 to reference the renamed
modules, preserving the existing exports and behavior.

Source: Coding guidelines


51-54: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Standardize deletion methods as del.

  • src/api/WorkItems/CustomRelations.ts#L51-L54: rename remove to del.
  • src/api/WorkItems/Dependencies.ts#L46-L49: rename remove to del.
  • src/api/WorkItems/Pages.ts#L62-L65: rename delete to del.

Update the corresponding test call sites with the same API rename.

As per coding guidelines, standard resource methods must be named list, create, retrieve, update, and del.

🤖 Prompt for 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.

In `@src/api/WorkItems/CustomRelations.ts` around lines 51 - 54, Standardize
resource deletion methods to del: rename remove in
src/api/WorkItems/CustomRelations.ts lines 51-54 and
src/api/WorkItems/Dependencies.ts lines 46-49, and rename delete in
src/api/WorkItems/Pages.ts lines 62-65. Update all corresponding test call sites
to invoke del while preserving the existing deletion behavior.

Source: Coding guidelines

src/api/WorkItems/Pages.ts (1)

18-27: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Type the page-list query parameters.

params?: any bypasses SDK validation. Define an endpoint-specific query interface (or use Record<string, unknown> until its fields are known).

As per coding guidelines, avoid any types; use proper typing or unknown with type guards.

🤖 Prompt for 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.

In `@src/api/WorkItems/Pages.ts` around lines 18 - 27, Replace the any-typed
params argument in the list method with an endpoint-specific page-list query
interface; if the supported fields are not yet known, use Record<string,
unknown> instead. Preserve the existing request path and response typing while
ensuring callers no longer bypass SDK type validation.

Source: Coding guidelines

src/api/Pages.ts (1)

34-35: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Replace public any contracts with SDK types.

These methods weaken the exported API surface and violate the repository typing rule.

  • src/api/Pages.ts#L34-L35: introduce a typed page-list params contract.
  • src/api/Pages.ts#L64-L65: use that same contract for project page listing.
  • src/api/Projects.ts#L97-L98: return a typed work-log totals model, or unknown with caller-side narrowing.

As per coding guidelines, src/**/*.ts: “Avoid any types; use proper typing or unknown with type guards.”

🤖 Prompt for 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.

In `@src/api/Pages.ts` around lines 34 - 35, Replace the public any contracts in
src/api/Pages.ts lines 34-35 and 64-65 by defining and reusing a typed page-list
parameters contract for listWorkspacePages and project page listing. In
src/api/Projects.ts lines 97-98, replace the any work-log totals response with a
typed totals model, or use unknown and require caller-side narrowing. Preserve
the existing method behavior while complying with the repository’s no-any rule.

Source: Coding guidelines

src/api/Releases/Links.ts (1)

17-23: 📐 Maintainability & Code Quality | 🔵 Trivial

params: any violates typing guideline.

Will address via a consolidated comment covering the same pattern in Comments.ts and WorkItems.ts.

🤖 Prompt for 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.

In `@src/api/Releases/Links.ts` around lines 17 - 23, Replace the params: any type
in the list method of Links.ts with the established typed query-parameter type
used by the corresponding list methods in Comments.ts and WorkItems.ts,
preserving optionality and existing request behavior.

Source: Coding guidelines

src/api/Releases/WorkItems.ts (1)

17-23: 📐 Maintainability & Code Quality | 🔵 Trivial

params: any violates typing guideline.

Will address via a consolidated comment covering the same pattern in Comments.ts and Links.ts.

🤖 Prompt for 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.

In `@src/api/Releases/WorkItems.ts` around lines 17 - 23, Replace the any-typed
params argument in WorkItems.list with the established typed query-parameter
type used by the related Comments and Links list methods, preserving its
optional behavior and existing request flow.

Source: Coding guidelines

src/api/Releases/Comments.ts (1)

17-23: 📐 Maintainability & Code Quality | 🔵 Trivial

params: any violates typing guideline.

As per coding guidelines, src/**/*.ts should avoid any types. This will be addressed via a consolidated comment covering the same pattern in Links.ts and WorkItems.ts.

🤖 Prompt for 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.

In `@src/api/Releases/Comments.ts` around lines 17 - 23, Replace the any type on
the params argument of Comments.list with the appropriate specific parameter
type already used by the API client, matching the established typing pattern in
related methods such as Links and WorkItems while preserving the existing
request and response handling.

Source: Coding guidelines

tests/unit/releases/releases.test.ts (1)

13-44: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

afterAll doesn't clean up comment/link on failure.

Unlike label/tag/release, the created comment and link are only deleted within their own dedicated it blocks (lines 203-205, 238-240). If an earlier test in the suite throws, these resources leak on the server.

🧹 Proposed fix
   afterAll(async () => {
     // Clean up created resources
+    if (link?.id) {
+      try {
+        await client.releases.links.delete(workspaceSlug, release.id!, link.id);
+      } catch (error) {
+        console.warn("Failed to delete release link:", error);
+      }
+    }
+    if (comment?.id) {
+      try {
+        await client.releases.comments.delete(workspaceSlug, release.id!, comment.id);
+      } catch (error) {
+        console.warn("Failed to delete release comment:", error);
+      }
+    }
     if (label?.id) {
🤖 Prompt for 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.

In `@tests/unit/releases/releases.test.ts` around lines 13 - 44, Add cleanup for
the created comment and link in the afterAll teardown, guarded by their IDs and
using the corresponding release comment/link deletion APIs. Follow the existing
label, tag, and release cleanup pattern so resources are removed even when their
dedicated tests fail.
src/models/Page.ts (1)

20-25: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Keep server-managed fields out of CreatePage.

Partial<Page> allows response-only fields such as created_by and updated_by to be sent in create requests. Define CreatePage from an explicit Pick/Omit of createable fields, then add parent_id and collection_id to that constrained DTO.

As per coding guidelines, model DTOs should be separate and derived with Pick, Omit, and Partial.

🤖 Prompt for 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.

In `@src/models/Page.ts` around lines 20 - 25, Update the CreatePage type to
derive from an explicit Pick, Omit, and/or Partial of fields allowed during
creation rather than Partial<Page>, excluding server-managed response fields
such as created_by and updated_by. Preserve the existing optional parent_id and
collection_id additions.

Source: Coding guidelines

src/models/Collection.ts (1)

42-57: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Derive request DTOs from the corresponding entity models.

The collection and estimate request interfaces manually duplicate response fields, allowing model and request contracts to drift. Use Pick, Omit, and Partial consistently at each site.

  • src/models/Collection.ts#L42-L57: derive CreateCollection and UpdateCollection from Collection.
  • src/models/Collection.ts#L74-L82: derive member create/update DTOs from CollectionMember.
  • src/models/Estimate.ts#L24-L41: derive estimate create/update DTOs from Estimate.
  • src/models/Estimate.ts#L62-L78: derive estimate-point create/update DTOs from EstimatePoint.

As per coding guidelines, model Create/Update DTOs should use interfaces with Pick, Omit, and Partial.

🤖 Prompt for 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.

In `@src/models/Collection.ts` around lines 42 - 57, Derive all request DTOs from
their corresponding entity models using interface composition with Pick, Omit,
and Partial instead of duplicating fields. Update src/models/Collection.ts lines
42-57 for CreateCollection and UpdateCollection, src/models/Collection.ts lines
74-82 for the CollectionMember create/update DTOs, src/models/Estimate.ts lines
24-41 for Estimate create/update DTOs, and src/models/Estimate.ts lines 62-78
for EstimatePoint create/update DTOs; preserve the existing allowed and excluded
fields, including Collection access remaining immutable after creation.

Source: Coding guidelines

src/api/BaseResource.ts (1)

114-119: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Type the new DELETE query parameters.

The new params?: any expands an untyped API surface. Introduce a shared query-parameter type, such as Record<string, unknown>, while preserving any richer shapes required by Axios.

As per coding guidelines, src/**/*.ts must avoid any and use proper typing or unknown with type guards.

🤖 Prompt for 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.

In `@src/api/BaseResource.ts` around lines 114 - 119, Update the httpDelete
method’s params argument to use a shared typed query-parameter definition
instead of any, such as Record<string, unknown>, while retaining compatibility
with Axios-supported richer parameter shapes. Ensure the related BaseResource
API contains no any and uses unknown only with appropriate narrowing.

Source: Coding guidelines

src/models/Role.ts (1)

1-33: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Rename new model files to kebab-case.

  • src/models/Role.ts#L1-L33: rename to src/models/role.ts and update imports/re-exports.
  • src/models/WorkItemPage.ts#L1-L40: rename to src/models/work-item-page.ts and update imports/re-exports.

As per coding guidelines, “Use kebab-case for file names.”

🤖 Prompt for 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.

In `@src/models/Role.ts` around lines 1 - 33, Rename src/models/Role.ts to
src/models/role.ts and src/models/WorkItemPage.ts to
src/models/work-item-page.ts, then update every import and re-export referencing
these model modules to use the kebab-case paths. Preserve the existing Role and
WorkItemPage symbols and behavior.

Source: Coding guidelines

🤖 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 `@src/api/BaseResource.ts`:
- Around line 158-162: Update the enableLogging branch in BaseResource’s
error-handling flow to replace raw error logging with a sanitized structured
representation. Include only safe diagnostic fields, excluding Authorization,
X-Api-Key, request data, response data, and other sensitive Axios details, while
preserving the existing conditional console.error behavior.

In `@src/api/Collections/index.ts`:
- Around line 59-62: Rename the public CRUD method `delete` to `del` in the
collections API while preserving its parameters and request behavior. Update all
callers in the collections unit tests to use `del`, ensuring no references to
the old method name remain.

In `@src/api/Customers/index.ts`:
- Around line 62-66: The customer API method should use the standard del naming
convention: rename Customers.deleteByExternalId to delByExternalId in
src/api/Customers/index.ts at lines 62-66, then update the corresponding test
call in tests/unit/customers/property-values.test.ts at lines 84-86 to use
delByExternalId.

In `@src/api/Estimates.ts`:
- Around line 48-50: Rename the public CRUD method delete to del in Estimates,
preserving its existing request and return behavior. Update all corresponding
calls and assertions in tests/unit/estimate.test.ts to use del, while leaving
the other standard resource methods unchanged.

In `@src/api/WorkItems/index.ts`:
- Around line 130-158: Update the parameter types used by listWorkspace and
listArchived to expose their documented query options, including filters,
order_by, cursor, per_page, fields, and expand where supported, while retaining
existing options. Add endpoint-appropriate interfaces near the existing
ListWorkItemsParams definitions and use them in both method signatures instead
of the overly restrictive shared type.

In `@src/api/WorkspaceWorkItemProperties/Options.ts`:
- Around line 54-56: Rename the public delete methods to del for consistency:
update Options.delete in src/api/WorkspaceWorkItemProperties/Options.ts:54-56
and WorkspaceWorkItemTypes.delete in
src/api/WorkspaceWorkItemTypes/index.ts:37-39; update the corresponding test
calls to options.del(...) at tests/unit/workspace-work-item-types.test.ts:83-85
and workspaceWorkItemTypes.del(...) at :95-97.

In `@tests/unit/customers/property-values.test.ts`:
- Around line 47-50: Strengthen the assertion in the “should read back the
bulk-set value” test by verifying the listed values include the expected
propertyId and the value “bulk value,” rather than only checking that the
response is defined. Keep the existing listValues call and use the returned
values collection for the content assertion.

In `@tests/unit/page.test.ts`:
- Around line 76-91: Do not let the workspace-page deletion test pass when
DELETE is unsupported: update the create/list/delete flow in
tests/unit/page.test.ts lines 76-91 to gate execution on a known server
capability or rethrow the 405, while removing the any and console usage. Apply
the same handling to project-page deletion in tests/unit/page.test.ts lines
93-107 so unsupported SDK operations remain visible and no test data is silently
left behind.

In `@tests/unit/work-items/archive.test.ts`:
- Around line 22-29: Update the archive test setup around completedState to
select an eligible completed or cancelled state; if neither exists, fail or skip
setup before invoking the archive operation. Ensure the work item state is
updated only when a valid archivable state has been found.

In `@tests/unit/workspace-work-item-types.test.ts`:
- Around line 86-91: Make live-test cleanup unconditional and failure-visible:
in tests/unit/workspace-work-item-types.test.ts at lines 86-91, let workspace
property deletion failures propagate instead of converting them to warnings; at
lines 95-98, register guarded work-item-type cleanup in afterAll; in
tests/unit/work-items/archive.test.ts at lines 32-40, restore archived state
when necessary and propagate deletion failures.

---

Nitpick comments:
In `@src/api/BaseResource.ts`:
- Around line 114-119: Update the httpDelete method’s params argument to use a
shared typed query-parameter definition instead of any, such as Record<string,
unknown>, while retaining compatibility with Axios-supported richer parameter
shapes. Ensure the related BaseResource API contains no any and uses unknown
only with appropriate narrowing.

In `@src/api/Collections/Members.ts`:
- Around line 1-3: Rename src/api/Collections/Members.ts to members.ts,
src/api/Collections/Pages.ts to pages.ts, src/api/Estimates.ts to estimates.ts,
and src/api/Roles.ts to roles.ts; update every import or reference to use the
new kebab-case filenames.

In `@src/api/Pages.ts`:
- Around line 34-35: Replace the public any contracts in src/api/Pages.ts lines
34-35 and 64-65 by defining and reusing a typed page-list parameters contract
for listWorkspacePages and project page listing. In src/api/Projects.ts lines
97-98, replace the any work-log totals response with a typed totals model, or
use unknown and require caller-side narrowing. Preserve the existing method
behavior while complying with the repository’s no-any rule.

In `@src/api/Releases/Comments.ts`:
- Around line 17-23: Replace the any type on the params argument of
Comments.list with the appropriate specific parameter type already used by the
API client, matching the established typing pattern in related methods such as
Links and WorkItems while preserving the existing request and response handling.

In `@src/api/Releases/Links.ts`:
- Around line 17-23: Replace the params: any type in the list method of Links.ts
with the established typed query-parameter type used by the corresponding list
methods in Comments.ts and WorkItems.ts, preserving optionality and existing
request behavior.

In `@src/api/Releases/WorkItems.ts`:
- Around line 17-23: Replace the any-typed params argument in WorkItems.list
with the established typed query-parameter type used by the related Comments and
Links list methods, preserving its optional behavior and existing request flow.

In `@src/api/WorkItems/CustomRelations.ts`:
- Around line 1-3: Rename CustomRelations.ts to custom-relations.ts,
Dependencies.ts to dependencies.ts, and Pages.ts to pages.ts to comply with
kebab-case filename conventions. Update the imports in
src/api/WorkItems/index.ts lines 23-25 to reference the renamed modules,
preserving the existing exports and behavior.
- Around line 51-54: Standardize resource deletion methods to del: rename remove
in src/api/WorkItems/CustomRelations.ts lines 51-54 and
src/api/WorkItems/Dependencies.ts lines 46-49, and rename delete in
src/api/WorkItems/Pages.ts lines 62-65. Update all corresponding test call sites
to invoke del while preserving the existing deletion behavior.

In `@src/api/WorkItems/Pages.ts`:
- Around line 18-27: Replace the any-typed params argument in the list method
with an endpoint-specific page-list query interface; if the supported fields are
not yet known, use Record<string, unknown> instead. Preserve the existing
request path and response typing while ensuring callers no longer bypass SDK
type validation.

In `@src/models/Collection.ts`:
- Around line 42-57: Derive all request DTOs from their corresponding entity
models using interface composition with Pick, Omit, and Partial instead of
duplicating fields. Update src/models/Collection.ts lines 42-57 for
CreateCollection and UpdateCollection, src/models/Collection.ts lines 74-82 for
the CollectionMember create/update DTOs, src/models/Estimate.ts lines 24-41 for
Estimate create/update DTOs, and src/models/Estimate.ts lines 62-78 for
EstimatePoint create/update DTOs; preserve the existing allowed and excluded
fields, including Collection access remaining immutable after creation.

In `@src/models/Page.ts`:
- Around line 20-25: Update the CreatePage type to derive from an explicit Pick,
Omit, and/or Partial of fields allowed during creation rather than
Partial<Page>, excluding server-managed response fields such as created_by and
updated_by. Preserve the existing optional parent_id and collection_id
additions.

In `@src/models/Role.ts`:
- Around line 1-33: Rename src/models/Role.ts to src/models/role.ts and
src/models/WorkItemPage.ts to src/models/work-item-page.ts, then update every
import and re-export referencing these model modules to use the kebab-case
paths. Preserve the existing Role and WorkItemPage symbols and behavior.

In `@tests/unit/releases/releases.test.ts`:
- Around line 13-44: Add cleanup for the created comment and link in the
afterAll teardown, guarded by their IDs and using the corresponding release
comment/link deletion APIs. Follow the existing label, tag, and release cleanup
pattern so resources are removed even when their dedicated tests fail.
🪄 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: 65b4bc25-f17d-47bc-acd6-cdaf4f4bb24f

📥 Commits

Reviewing files that changed from the base of the PR and between bfae758 and 3ed54fa.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (78)
  • README.md
  • jest.config.js
  • package.json
  • src/api/BaseResource.ts
  • src/api/Collections/Members.ts
  • src/api/Collections/Pages.ts
  • src/api/Collections/index.ts
  • src/api/Customers/Properties.ts
  • src/api/Customers/index.ts
  • src/api/Cycles.ts
  • src/api/Estimates.ts
  • src/api/Intake.ts
  • src/api/Members.ts
  • src/api/Modules.ts
  • src/api/Pages.ts
  • src/api/Projects.ts
  • src/api/Releases/Changelog.ts
  • src/api/Releases/Comments.ts
  • src/api/Releases/ItemLabels.ts
  • src/api/Releases/Labels.ts
  • src/api/Releases/Links.ts
  • src/api/Releases/Tags.ts
  • src/api/Releases/WorkItems.ts
  • src/api/Releases/index.ts
  • src/api/Roles.ts
  • src/api/Users.ts
  • src/api/WorkItemProperties/index.ts
  • src/api/WorkItemTypes.ts
  • src/api/WorkItems/CustomRelations.ts
  • src/api/WorkItems/Dependencies.ts
  • src/api/WorkItems/Pages.ts
  • src/api/WorkItems/index.ts
  • src/api/Workspace.ts
  • src/api/WorkspaceWorkItemProperties/Options.ts
  • src/api/WorkspaceWorkItemProperties/index.ts
  • src/api/WorkspaceWorkItemTypes/index.ts
  • src/client/plane-client.ts
  • src/index.ts
  • src/models/Collection.ts
  • src/models/Customer.ts
  • src/models/Cycle.ts
  • src/models/Estimate.ts
  • src/models/Intake.ts
  • src/models/Member.ts
  • src/models/Module.ts
  • src/models/Page.ts
  • src/models/Project.ts
  • src/models/Release.ts
  • src/models/Role.ts
  • src/models/User.ts
  • src/models/WorkItem.ts
  • src/models/WorkItemPage.ts
  • src/models/index.ts
  • tests/unit/collections.test.ts
  • tests/unit/customers/property-values.test.ts
  • tests/unit/epic.test.ts
  • tests/unit/estimate.test.ts
  • tests/unit/initiative.test.ts
  • tests/unit/intake.test.ts
  • tests/unit/lite-listings.test.ts
  • tests/unit/module.test.ts
  • tests/unit/page.test.ts
  • tests/unit/project-templates.test.ts
  • tests/unit/releases/releases.test.ts
  • tests/unit/role.test.ts
  • tests/unit/work-item-types/project-properties.test.ts
  • tests/unit/work-item-types/properties-options.test.ts
  • tests/unit/work-item-types/types.test.ts
  • tests/unit/work-items/archive.test.ts
  • tests/unit/work-items/custom-relations.test.ts
  • tests/unit/work-items/dependencies.test.ts
  • tests/unit/work-items/pages.test.ts
  • tests/unit/work-items/relations.test.ts
  • tests/unit/workflows/workflow.test.ts
  • tests/unit/workspace-project-states.test.ts
  • tests/unit/workspace-templates/workspace-templates.test.ts
  • tests/unit/workspace-work-item-types.test.ts
  • tests/unit/workspace.test.ts
💤 Files with no reviewable changes (1)
  • src/api/Members.ts

Comment thread src/api/BaseResource.ts Outdated
Comment thread src/api/Collections/index.ts
Comment thread src/api/Customers/index.ts
Comment thread src/api/Estimates.ts
Comment thread src/api/WorkItems/index.ts
Comment thread src/api/WorkspaceWorkItemProperties/Options.ts
Comment thread tests/unit/customers/property-values.test.ts
Comment thread tests/unit/page.test.ts Outdated
Comment thread tests/unit/work-items/archive.test.ts
Comment thread tests/unit/workspace-work-item-types.test.ts

@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: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tests/unit/collections.test.ts (1)

7-11: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Gate each suite on its required feature flags.

The documentation says WORKSPACE_PAGES and PRIVATE_COLLECTIONS are prerequisites, but every suite checks only config.workspaceSlug. A workspace without those flags will run the suites and fail instead of being skipped.

Also applies to: 74-74, 154-154

🤖 Prompt for 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.

In `@tests/unit/collections.test.ts` around lines 7 - 11, Update the suite gates
in “Collections API Tests” and the additional collection suites to check the
feature flags required by each suite, not only config.workspaceSlug. Require
WORKSPACE_PAGES for workspace-page cases and require both WORKSPACE_PAGES and
PRIVATE_COLLECTIONS for private-collection cases, so unsupported configurations
are skipped.
🧹 Nitpick comments (2)
tests/unit/work-items/pages.test.ts (1)

21-27: 🗄️ Data Integrity & Integration | 🔵 Trivial

Run this live suite against a disposable or dedicated workspace.

Because the created page cannot be deleted, every execution leaves persistent test data. Isolate these tests from shared workspaces or provide server-side cleanup to prevent accumulation and cross-run pollution.

🤖 Prompt for 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.

In `@tests/unit/work-items/pages.test.ts` around lines 21 - 27, Update the setup
around client.pages.createProjectPage in the test suite to require a disposable
or dedicated workspace for these live tests, preventing persistent page data
from polluting shared workspaces; if cleanup support is available, use it after
each test instead.
tests/unit/collections.test.ts (1)

91-99: 🗄️ Data Integrity & Integration | 🔵 Trivial

Run page-creating suites against a disposable or dedicated workspace.

The standalone and inline pages cannot be deleted, so repeated executions permanently accumulate test data. Avoid shared workspaces or add server-side cleanup.

Also applies to: 140-150

🤖 Prompt for 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.

In `@tests/unit/collections.test.ts` around lines 91 - 99, Update the workspace
setup and cleanup flow around createWorkspacePage and the affected
standalone/inline page tests to use a disposable or dedicated workspace per test
suite, rather than a shared workspace. Preserve the existing source/target
collection cleanup and ensure the dedicated workspace is removed through the
available server cleanup mechanism after the tests complete.
🤖 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 `@tests/unit/epic.test.ts`:
- Around line 23-27: Update the “should retrieve an epic” test so it never
silently passes when epics.results is empty: require a known/seeded epic fixture
for client.epics.retrieve, or explicitly skip the test using the test
framework’s skip mechanism while preserving retrieval assertions when an epic
exists.

---

Outside diff comments:
In `@tests/unit/collections.test.ts`:
- Around line 7-11: Update the suite gates in “Collections API Tests” and the
additional collection suites to check the feature flags required by each suite,
not only config.workspaceSlug. Require WORKSPACE_PAGES for workspace-page cases
and require both WORKSPACE_PAGES and PRIVATE_COLLECTIONS for private-collection
cases, so unsupported configurations are skipped.

---

Nitpick comments:
In `@tests/unit/collections.test.ts`:
- Around line 91-99: Update the workspace setup and cleanup flow around
createWorkspacePage and the affected standalone/inline page tests to use a
disposable or dedicated workspace per test suite, rather than a shared
workspace. Preserve the existing source/target collection cleanup and ensure the
dedicated workspace is removed through the available server cleanup mechanism
after the tests complete.

In `@tests/unit/work-items/pages.test.ts`:
- Around line 21-27: Update the setup around client.pages.createProjectPage in
the test suite to require a disposable or dedicated workspace for these live
tests, preventing persistent page data from polluting shared workspaces; if
cleanup support is available, use it after each test instead.
🪄 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: 7419c18a-f0be-4242-956b-7016c8ed7427

📥 Commits

Reviewing files that changed from the base of the PR and between 3ed54fa and 206f816.

📒 Files selected for processing (8)
  • package.json
  • src/api/BaseResource.ts
  • src/api/Pages.ts
  • src/models/WorkItem.ts
  • tests/unit/collections.test.ts
  • tests/unit/epic.test.ts
  • tests/unit/page.test.ts
  • tests/unit/work-items/pages.test.ts
💤 Files with no reviewable changes (2)
  • tests/unit/page.test.ts
  • src/api/Pages.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/api/BaseResource.ts
  • src/models/WorkItem.ts

Comment thread tests/unit/epic.test.ts Outdated

@Saurabhkmr98 Saurabhkmr98 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed via a 4-way parallel pass over new resources, WorkItems sub-resources, the Releases subtree, and fixes to existing resources. Most of the diff (Collections, Estimates, Roles, the Releases subtree, WorkItemProperties/WorkspaceWorkItemProperties/WorkspaceWorkItemTypes, and the fixes to pre-existing resources) checked out clean. Left two inline comments below.

(Note: I also spotted an unrelated pre-existing bug in src/api/WorkspaceTemplates/WorkItems.ts / src/api/ProjectTemplates/WorkItems.ts — unhyphenated workitems/templates/ vs the codebase's consistent work-items/ — but those files aren't touched by this PR, so I'm not commenting on them here; worth a separate issue.)

Comment thread src/api/WorkItems/index.ts
Comment thread src/api/WorkItemTypes.ts

@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: 2

🤖 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 `@tests/unit/workspace-work-item-types.test.ts`:
- Line 55: Update the test guard around config.projectId so missing projectId
explicitly skips the Jest test instead of returning from its body. Use the
repository’s conditional-test helper or define the case with it.skip, while
preserving normal assertion execution when projectId is available.
- Around line 57-59: Update the importToProject assertion in the workItemTypes
test to match the endpoint’s empty response: await the promise directly or
assert that it resolves to undefined, instead of using resolves.toBeDefined().
🪄 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: 12774670-b866-4af2-b4df-bbff206378d2

📥 Commits

Reviewing files that changed from the base of the PR and between 206f816 and 63b8fec.

📒 Files selected for processing (1)
  • tests/unit/workspace-work-item-types.test.ts

Comment thread tests/unit/workspace-work-item-types.test.ts
Comment thread tests/unit/workspace-work-item-types.test.ts

@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: 2

🧹 Nitpick comments (4)
src/api/Epics.ts (2)

36-40: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Name the standard delete method del.

This newly added resource method violates the required standard API method name and makes the public surface inconsistent.

As per coding guidelines, standard resource methods must be named list, create, retrieve, update, and del.

🤖 Prompt for 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.

In `@src/api/Epics.ts` around lines 36 - 40, Rename the Epics resource method
delete to del while preserving its parameters, return type, and existing
httpDelete endpoint behavior; keep the standard methods list, create, retrieve,
and update unchanged.

Source: Coding guidelines


46-62: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Remove permissive any from public parameter contracts.

The new Epic list signatures and the updated initiative pagination interface both bypass TypeScript validation with any.

  • src/api/Epics.ts#L46-L62: define endpoint-specific list parameter interfaces instead of params?: any.
  • src/models/Initiative.ts#L35-L38: replace the any index signature with unknown (or a bounded parameter type) so callers cannot silently pass unchecked values.

As per coding guidelines, src/**/*.ts must avoid any types.

🤖 Prompt for 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.

In `@src/api/Epics.ts` around lines 46 - 62, Replace the permissive params?: any
contracts in src/api/Epics.ts lines 46-62, covering EpicApi.list and
EpicApi.listIssues, with endpoint-specific parameter interfaces that provide
TypeScript validation while preserving pagination behavior. In
src/models/Initiative.ts lines 35-38, replace the any index signature with
unknown or an appropriately bounded parameter type. Ensure neither site uses
any.

Source: Coding guidelines

src/models/Epic.ts (2)

36-51: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Derive the create DTO from Epic.

UpdateEpic correctly uses Partial, but CreateEpic manually repeats entity fields. Use Pick<Epic, ...> plus the API-only *_id fields so entity and request contracts cannot drift.

As per coding guidelines, model Create/Update DTOs must use Pick, Omit, and Partial.

🤖 Prompt for 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.

In `@src/models/Epic.ts` around lines 36 - 51, Update CreateEpic to derive
entity-backed fields from Epic with Pick<Epic, ...>, while retaining the
API-only state_id, parent_id, assignee_ids, and label_ids fields alongside any
other request-only fields. Keep UpdateEpic as Partial<CreateEpic> and remove
duplicated entity field declarations so the DTO stays synchronized with Epic.

Source: Coding guidelines


60-60: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use Work Item terminology throughout the Epic API.

The public model and resource names violate the required naming convention; retain the server’s /issues/ URL but rename the SDK symbols.

  • src/models/Epic.ts#L60-L60: rename EpicIssue to EpicWorkItem.
  • src/api/Epics.ts#L53-L74: rename listIssues/addIssues to listWorkItems/addWorkItems and use the renamed model.
  • tests/unit/epic.test.ts#L87-L102: update test calls for the renamed public methods.

As per coding guidelines, src/**/*.ts must never use “Issue” in names and must use “Work Item” instead.

🤖 Prompt for 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.

In `@src/models/Epic.ts` at line 60, Rename EpicIssue to EpicWorkItem in
src/models/Epic.ts:60-60, and update src/api/Epics.ts:53-74 to rename
listIssues/addIssues to listWorkItems/addWorkItems while using EpicWorkItem;
retain the /issues/ server URL. Update the corresponding test calls in
tests/unit/epic.test.ts:87-102, and ensure no src/**/*.ts public symbols use
“Issue” terminology.

Source: Coding guidelines

🤖 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 `@tests/unit/epic.test.ts`:
- Around line 24-31: Update the catch block in the epic test to read the HTTP
status from error.response?.status and derive the message from
error.response?.data, including the relevant epics, error, or detail fields. Use
these Axios response properties for the 400/unsupported-epics check while
preserving the existing warning, skip behavior, and rethrow for other errors.

In `@tests/unit/work-items/work-items.test.ts`:
- Around line 166-170: Update the filtered results assertions in the work-items
test to verify that the created urgent work item is included by asserting
filtered.results contains urgent.id. Keep the existing non-empty and priority
assertions, using the created urgent fixture rather than relying only on
pre-existing urgent items.

---

Nitpick comments:
In `@src/api/Epics.ts`:
- Around line 36-40: Rename the Epics resource method delete to del while
preserving its parameters, return type, and existing httpDelete endpoint
behavior; keep the standard methods list, create, retrieve, and update
unchanged.
- Around line 46-62: Replace the permissive params?: any contracts in
src/api/Epics.ts lines 46-62, covering EpicApi.list and EpicApi.listIssues, with
endpoint-specific parameter interfaces that provide TypeScript validation while
preserving pagination behavior. In src/models/Initiative.ts lines 35-38, replace
the any index signature with unknown or an appropriately bounded parameter type.
Ensure neither site uses any.

In `@src/models/Epic.ts`:
- Around line 36-51: Update CreateEpic to derive entity-backed fields from Epic
with Pick<Epic, ...>, while retaining the API-only state_id, parent_id,
assignee_ids, and label_ids fields alongside any other request-only fields. Keep
UpdateEpic as Partial<CreateEpic> and remove duplicated entity field
declarations so the DTO stays synchronized with Epic.
- Line 60: Rename EpicIssue to EpicWorkItem in src/models/Epic.ts:60-60, and
update src/api/Epics.ts:53-74 to rename listIssues/addIssues to
listWorkItems/addWorkItems while using EpicWorkItem; retain the /issues/ server
URL. Update the corresponding test calls in tests/unit/epic.test.ts:87-102, and
ensure no src/**/*.ts public symbols use “Issue” terminology.
🪄 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: 4e89214a-eccd-4a19-a49c-29b0af139959

📥 Commits

Reviewing files that changed from the base of the PR and between 63b8fec and b4eaf3d.

📒 Files selected for processing (10)
  • package.json
  • src/api/Cycles.ts
  • src/api/Epics.ts
  • src/api/Modules.ts
  • src/api/WorkItems/index.ts
  • src/models/Epic.ts
  • src/models/Initiative.ts
  • src/models/WorkItem.ts
  • tests/unit/epic.test.ts
  • tests/unit/work-items/work-items.test.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/api/Modules.ts
  • src/models/WorkItem.ts

Comment thread tests/unit/epic.test.ts
Comment thread tests/unit/work-items/work-items.test.ts
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