Skip to content

[SILO-1142] feat: add epics write endpoints#37

Open
Saurabhkmr98 wants to merge 2 commits intomainfrom
feat/project-epics-write-apis
Open

[SILO-1142] feat: add epics write endpoints#37
Saurabhkmr98 wants to merge 2 commits intomainfrom
feat/project-epics-write-apis

Conversation

@Saurabhkmr98
Copy link
Copy Markdown
Member

@Saurabhkmr98 Saurabhkmr98 commented Mar 27, 2026

Description

  • Added new methods for Project Epics write endpoints

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Improvement (change that would cause existing functionality to not work as expected)
  • Code refactoring
  • Performance improvements
  • Documentation update

Test Scenarios

Screenshot 2026-03-27 at 7 28 18 PM

@makeplane
Copy link
Copy Markdown

makeplane bot commented Mar 27, 2026

Linked to Plane Work Item(s)

This comment was auto-generated by Plane

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 27, 2026

Warning

Rate limit exceeded

@Saurabhkmr98 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 25 minutes and 41 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 25 minutes and 41 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8c1a7e5f-6f9f-46d4-855f-312193f834e4

📥 Commits

Reviewing files that changed from the base of the PR and between 5bf22d5 and 0cd90d6.

📒 Files selected for processing (1)
  • src/api/Epics.ts
📝 Walkthrough

Walkthrough

This PR extends the Plane Node SDK with comprehensive epic management capabilities, adding CRUD operations (create, update, delete) and issue-management methods (listIssues, addIssues) to the Epics API resource. Corresponding TypeScript models and expanded test coverage were introduced. Package version bumped to 0.2.10.

Changes

Cohort / File(s) Summary
Package Version
package.json
Version bumped from 0.2.9 to 0.2.10.
Epic API Methods
src/api/Epics.ts
Added five new public methods: create(), update(), delete(), listIssues(), and addIssues(). Imported supporting request/response types for epic lifecycle and work-item management.
Epic Models
src/models/Epic.ts
Added four new exported interfaces: CreateEpic (required name, optional fields), UpdateEpic (all-optional counterpart), AddEpicWorkItems (work item IDs), and EpicIssue (issue data for epic context).
Test Coverage
tests/unit/epic.test.ts
Expanded from basic retrieval to full lifecycle testing: creation, retrieval, update, listing, and work-item association. Added setup/teardown logic including feature enablement and cleanup.

Sequence Diagram

sequenceDiagram
    participant Client as SDK Client
    participant EpicAPI as Epics API
    participant Backend as Backend Service

    rect rgba(76, 175, 80, 0.5)
    Note over Client,Backend: Epic Lifecycle Operations
    Client->>EpicAPI: create(workspaceSlug, projectId, data)
    EpicAPI->>Backend: POST /epics
    Backend-->>EpicAPI: Epic
    EpicAPI-->>Client: Epic
    
    Client->>EpicAPI: listIssues(workspaceSlug, projectId, epicId)
    EpicAPI->>Backend: GET /epics/{epicId}/issues
    Backend-->>EpicAPI: PaginatedResponse<EpicIssue>
    EpicAPI-->>Client: PaginatedResponse<EpicIssue>
    
    Client->>EpicAPI: addIssues(workspaceSlug, projectId, epicId, data)
    EpicAPI->>Backend: POST /epics/{epicId}/issues
    Backend-->>EpicAPI: EpicIssue[]
    EpicAPI-->>Client: EpicIssue[]
    
    Client->>EpicAPI: update(workspaceSlug, projectId, epicId, data)
    EpicAPI->>Backend: PATCH /epics/{epicId}
    Backend-->>EpicAPI: Epic
    EpicAPI-->>Client: Epic
    
    Client->>EpicAPI: delete(workspaceSlug, projectId, epicId)
    EpicAPI->>Backend: DELETE /epics/{epicId}
    Backend-->>EpicAPI: void
    EpicAPI-->>Client: void
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Hop through epics with grace and care,
Create, update, delete with flair!
List their issues, add work with glee,
A rabbit's dream of CRUD spree! 🎉

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding write endpoints for epics. It is concise, avoids vague terms, and directly relates to the primary purpose of the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/project-epics-write-apis

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 and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (5)
src/api/Epics.ts (3)

57-57: Avoid using any type for the params parameter.

Per coding guidelines, avoid any types. Consider defining a proper interface for pagination/filter parameters.

♻️ Example typed params
// In src/models/common.ts or similar
export interface PaginationParams {
  cursor?: string;
  per_page?: number;
  // Add other common filter params as needed
}

Then use:

-    params?: any
+    params?: PaginationParams

As per coding guidelines: "Avoid any types; use proper typing or unknown with type guards"

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/api/Epics.ts` at line 57, Replace the untyped params?: any with a proper
typed interface: define and export an interface (e.g., PaginationParams) in a
shared models file (suggested: src/models/common.ts) that includes cursor?:
string, per_page?: number and any other expected filter keys, import that
interface into src/api/Epics.ts, and change the function signature from params?:
any to params?: PaginationParams (or params?: PaginationParams | Record<string,
unknown> if free-form keys remain); update any call sites or runtime handling to
satisfy the new type (or add a small type-guard/conversion if runtime values
need validation) and remove the any usage.

53-63: Method names use "Issues" instead of "WorkItems", violating naming guideline.

The coding guidelines specify: "Never use 'Issue' in names — always use 'Work Item'". Consider renaming:

  • listIssueslistWorkItems
  • addIssuesaddWorkItems
♻️ Suggested renames
   /**
-   * List work items under an epic
+   * List work items under an epic
    */
-  async listIssues(
+  async listWorkItems(
     workspaceSlug: string,
     projectId: string,
     epicId: string,
     params?: any
   ): Promise<PaginatedResponse<EpicIssue>> {
   /**
-   * Add work items as sub-issues under an epic
+   * Add work items under an epic
    */
-  async addIssues(
+  async addWorkItems(
     workspaceSlug: string,
     projectId: string,
     epicId: string,
     data: AddEpicWorkItems
   ): Promise<EpicIssue[]> {

As per coding guidelines: "Never use 'Issue' in names — always use 'Work Item'"

Also applies to: 68-78

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/api/Epics.ts` around lines 53 - 63, The public API methods and types
using "Issue" must be renamed to "WorkItem": rename the method listIssues to
listWorkItems (and any addIssues to addWorkItems), update return/type names like
EpicIssue to EpicWorkItem (and any related parameter or interface names), and
update all internal references and imports/usages (e.g., in class Epics, callers
of listIssues/addIssues, and overloads) so signatures and documentation reflect
the new names while preserving behavior and types; ensure exported symbols and
tests are updated accordingly to avoid breaking imports.

39-41: Consider renaming delete to del to match the standard pattern.

Per coding guidelines, standard resource methods should follow the pattern: list, create, retrieve, update, del. This method is named delete instead of del.

♻️ Suggested rename
-  async delete(workspaceSlug: string, projectId: string, epicId: string): Promise<void> {
+  async del(workspaceSlug: string, projectId: string, epicId: string): Promise<void> {
     return this.httpDelete(`/workspaces/${workspaceSlug}/projects/${projectId}/epics/${epicId}/`);
   }

As per coding guidelines: "Standard resource methods should follow the pattern: list, create, retrieve, update, del"

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/api/Epics.ts` around lines 39 - 41, Rename the method named delete to del
on the Epics class: change the method signature async delete(...) to async
del(...) but keep the same parameters and return
this.httpDelete(`/workspaces/${workspaceSlug}/projects/${projectId}/epics/${epicId}/`);;
update all internal references/callers, any interface/type declarations, and
exports that referenced Epics.delete to use Epics.del so callers compile; run
tests/type-checking to ensure no remaining references to the old name.
src/models/Epic.ts (2)

51-64: Derive UpdateEpic from CreateEpic using Partial.

Per coding guidelines, DTOs should be derived using Pick, Omit, and Partial. Since UpdateEpic has the exact same fields as CreateEpic but all optional, it can be derived:

♻️ Suggested derivation
-export interface UpdateEpic {
-  name?: string;
-  description_html?: string;
-  state_id?: string;
-  parent_id?: string;
-  assignee_ids?: string[];
-  label_ids?: string[];
-  priority?: PriorityEnum;
-  start_date?: string;
-  target_date?: string;
-  estimate_point?: string;
-  external_source?: string;
-  external_id?: string;
-}
+export type UpdateEpic = Partial<CreateEpic>;

As per coding guidelines: "Models should use TypeScript interfaces with separate Create/Update DTOs derived using Pick, Omit, and Partial"

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/models/Epic.ts` around lines 51 - 64, Replace the explicit UpdateEpic
interface with a derived type from CreateEpic so all fields become optional;
specifically change UpdateEpic to be a Partial of CreateEpic (e.g., type
UpdateEpic = Partial<CreateEpic>), ensuring you reference the existing
CreateEpic declaration and remove the duplicated field list in the UpdateEpic
declaration.

70-102: Rename EpicIssue to EpicWorkItem to comply with naming guideline.

The coding guidelines specify: "Never use 'Issue' in names — always use 'Work Item'".

♻️ Suggested rename
-export interface EpicIssue {
+export interface EpicWorkItem {
   id: string;
   type_id?: string | null;
   // ... rest of fields
 }

Also update the API methods in src/api/Epics.ts to use EpicWorkItem instead of EpicIssue.

As per coding guidelines: "Never use 'Issue' in names — always use 'Work Item'"

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/models/Epic.ts` around lines 70 - 102, Rename the EpicIssue type to
EpicWorkItem throughout the codebase: update the interface declaration name
(EpicIssue → EpicWorkItem) and any references/imports that use EpicIssue
(notably in src/api/Epics.ts) to the new symbol; ensure exported/imported names
and JSDoc/type annotations are updated, and run/type-check to catch missed
usages so all functions, method signatures, and types now reference
EpicWorkItem.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/api/Epics.ts`:
- Line 57: Replace the untyped params?: any with a proper typed interface:
define and export an interface (e.g., PaginationParams) in a shared models file
(suggested: src/models/common.ts) that includes cursor?: string, per_page?:
number and any other expected filter keys, import that interface into
src/api/Epics.ts, and change the function signature from params?: any to
params?: PaginationParams (or params?: PaginationParams | Record<string,
unknown> if free-form keys remain); update any call sites or runtime handling to
satisfy the new type (or add a small type-guard/conversion if runtime values
need validation) and remove the any usage.
- Around line 53-63: The public API methods and types using "Issue" must be
renamed to "WorkItem": rename the method listIssues to listWorkItems (and any
addIssues to addWorkItems), update return/type names like EpicIssue to
EpicWorkItem (and any related parameter or interface names), and update all
internal references and imports/usages (e.g., in class Epics, callers of
listIssues/addIssues, and overloads) so signatures and documentation reflect the
new names while preserving behavior and types; ensure exported symbols and tests
are updated accordingly to avoid breaking imports.
- Around line 39-41: Rename the method named delete to del on the Epics class:
change the method signature async delete(...) to async del(...) but keep the
same parameters and return
this.httpDelete(`/workspaces/${workspaceSlug}/projects/${projectId}/epics/${epicId}/`);;
update all internal references/callers, any interface/type declarations, and
exports that referenced Epics.delete to use Epics.del so callers compile; run
tests/type-checking to ensure no remaining references to the old name.

In `@src/models/Epic.ts`:
- Around line 51-64: Replace the explicit UpdateEpic interface with a derived
type from CreateEpic so all fields become optional; specifically change
UpdateEpic to be a Partial of CreateEpic (e.g., type UpdateEpic =
Partial<CreateEpic>), ensuring you reference the existing CreateEpic declaration
and remove the duplicated field list in the UpdateEpic declaration.
- Around line 70-102: Rename the EpicIssue type to EpicWorkItem throughout the
codebase: update the interface declaration name (EpicIssue → EpicWorkItem) and
any references/imports that use EpicIssue (notably in src/api/Epics.ts) to the
new symbol; ensure exported/imported names and JSDoc/type annotations are
updated, and run/type-check to catch missed usages so all functions, method
signatures, and types now reference EpicWorkItem.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 392da9eb-667f-4692-b2e4-a96470881719

📥 Commits

Reviewing files that changed from the base of the PR and between d3c564e and 5bf22d5.

📒 Files selected for processing (4)
  • package.json
  • src/api/Epics.ts
  • src/models/Epic.ts
  • tests/unit/epic.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.

1 participant