Skip to content

Conversation

@Prashant-Surya
Copy link
Member

@Prashant-Surya Prashant-Surya commented Aug 5, 2025

Description

  • add IssueSearchItemSerializer type for issues search endpoint
  • add a new IssueDetailSerializer extending IssueSerializer for detail api
  • exclude slug field from State API response
  • add many=True for serializer responses with arrays
  • add IssuePropertyValueAPIDetailSerializer for issue property values

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Improvement (change that would cause existing functionality to not work as expected)

Summary by CodeRabbit

  • New Features

    • Introduced detailed work item and property value models for more comprehensive data handling.
    • Updated API methods to return detailed information and arrays where applicable.
  • Bug Fixes

    • Corrected API response handling for list operations to properly return arrays of entities.
  • Documentation

    • Updated package version references in documentation.
    • Clarified interface descriptions for search results.
  • Refactor

    • Replaced lightweight label and user representations with detailed or simplified types.
    • Adjusted exported entities to reflect new and removed models.
  • Chores

    • Incremented package version to 0.1.4.
    • Enhanced release automation to extract version and create GitHub releases.

- add IssueSearchItemSerializer type for issues search endpoint
- add a new IssueDetailSerializer extending IssueSerializer for detail api
- exclude slug field from State API response
- add many=True for serializer responses with arrays
- add IssuePropertyValueAPIDetailSerializer for issue property values
@coderabbitai
Copy link

coderabbitai bot commented Aug 5, 2025

Walkthrough

This update introduces new data models and adjusts API response handling to align with detailed entity representations. It updates the Node SDK publishing workflow to automate versioned GitHub releases, increments the SDK version, and updates documentation. Several model and API files are refactored to use new, more detailed types, with obsolete types removed and exports revised accordingly.

Changes

Cohort / File(s) Change Summary
GitHub Workflow & Release Automation
.github/workflows/publish-node-sdk.yml
Enhances the Node SDK publish workflow: extracts the package version post-publish and creates a versioned GitHub release with autogenerated notes. Minor YAML formatting changes applied.
OpenAPI Generator File Manifest
.openapi-generator/FILES
Adds src/models/IssueDetail.ts and src/models/IssuePropertyValueAPIDetail.ts to the tracked files; removes src/models/LabelLite.ts.
SDK Version Bump & Docs
README.md, package.json
Updates SDK version from 0.1.3 to 0.1.4 in both the manifest and documentation install instructions.
Work Item Properties API Refactor
src/apis/WorkItemPropertiesApi.ts
Refactors list methods to correctly handle and return arrays of entities, updates type usage to new detailed models, and adjusts JSON parsing accordingly.
Work Items API Model Update
src/apis/WorkItemsApi.ts
Changes return types for work item retrieval methods from Issue to IssueDetail, updating imports and deserialization logic.
New Model: IssueDetail
src/models/IssueDetail.ts
Introduces the IssueDetail interface and associated JSON conversion utilities for detailed work item representation.
New Model: IssuePropertyValueAPIDetail
src/models/IssuePropertyValueAPIDetail.ts
Adds the IssuePropertyValueAPIDetail interface and conversion utilities for aggregated issue property values.
Model Refactor: IssueExpand
src/models/IssueExpand.ts
Changes labels and assignees properties from arrays of objects to strings, removing related imports and simplifying parsing logic.
Model Documentation Update
src/models/IssueSearch.ts
Simplifies and clarifies interface and property documentation for IssueSearch.
Model Removal: LabelLite
src/models/LabelLite.ts
Deletes the LabelLite interface and its utility functions.
Model Exports Update
src/models/index.ts
Adds exports for IssueDetail and IssuePropertyValueAPIDetail, removes export for LabelLite.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Node SDK Publish Workflow
    participant npm
    participant GitHub Release

    User->>Node SDK Publish Workflow: Trigger workflow
    Node SDK Publish Workflow->>npm: Publish package
    npm-->>Node SDK Publish Workflow: Publish complete
    Node SDK Publish Workflow->>Node SDK Publish Workflow: Extract version from package.json
    Node SDK Publish Workflow->>GitHub Release: Create release with tag "v<version>"
    GitHub Release-->>Node SDK Publish Workflow: Release created
Loading
sequenceDiagram
    participant Client
    participant WorkItemsApi
    participant WorkItemPropertiesApi
    participant Models

    Client->>WorkItemsApi: retrieveWorkItem(...)
    WorkItemsApi->>Models: IssueDetailFromJSON(...)
    Models-->>WorkItemsApi: IssueDetail
    WorkItemsApi-->>Client: IssueDetail

    Client->>WorkItemPropertiesApi: listIssueProperties(...)
    WorkItemPropertiesApi->>Models: IssuePropertyAPIFromJSON(...)
    Models-->>WorkItemPropertiesApi: Array<IssuePropertyAPI>
    WorkItemPropertiesApi-->>Client: Array<IssuePropertyAPI>
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~18 minutes

Poem

A hop, a skip, a version leap—
New models bloom where old ones sleep.
Arrays now dance in API calls,
While GitHub tags adorn the walls.
The docs refreshed, the workflow neat—
This bunny’s code is hard to beat!
🐇✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 04dee5f and 459cf61.

📒 Files selected for processing (1)
  • .github/workflows/publish-node-sdk.yml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/publish-node-sdk.yml
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch release/v0.1.4

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@makeplane
Copy link

makeplane bot commented Aug 5, 2025

Pull Request Linked with Plane Work Items

Comment Automatically Generated by Plane

Copy link

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3712322 and 04dee5f.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (12)
  • .github/workflows/publish-node-sdk.yml (1 hunks)
  • .openapi-generator/FILES (2 hunks)
  • README.md (2 hunks)
  • package.json (1 hunks)
  • src/apis/WorkItemPropertiesApi.ts (8 hunks)
  • src/apis/WorkItemsApi.ts (4 hunks)
  • src/models/IssueDetail.ts (1 hunks)
  • src/models/IssueExpand.ts (2 hunks)
  • src/models/IssuePropertyValueAPIDetail.ts (1 hunks)
  • src/models/IssueSearch.ts (1 hunks)
  • src/models/LabelLite.ts (0 hunks)
  • src/models/index.ts (2 hunks)
💤 Files with no reviewable changes (1)
  • src/models/LabelLite.ts
🧰 Additional context used
🧬 Code Graph Analysis (3)
src/apis/WorkItemsApi.ts (2)
src/runtime.ts (2)
  • InitOverrideFunction (297-297)
  • ApiResponse (392-395)
src/models/IssueDetail.ts (2)
  • IssueDetail (45-226)
  • IssueDetailFromJSON (240-242)
src/models/IssueDetail.ts (3)
src/models/UserLite.ts (3)
  • UserLite (23-66)
  • UserLiteFromJSON (75-77)
  • UserLiteToJSON (95-97)
src/models/Label.ts (3)
  • Label (23-114)
  • LabelFromJSON (124-126)
  • LabelToJSON (152-154)
src/models/PriorityEnum.ts (2)
  • PriorityEnumFromJSON (44-46)
  • PriorityEnumToJSON (52-54)
src/apis/WorkItemPropertiesApi.ts (4)
src/runtime.ts (2)
  • InitOverrideFunction (297-297)
  • ApiResponse (392-395)
src/models/IssuePropertyAPI.ts (2)
  • IssuePropertyAPI (35-180)
  • IssuePropertyAPIFromJSON (193-195)
src/models/IssuePropertyOptionAPI.ts (2)
  • IssuePropertyOptionAPI (20-129)
  • IssuePropertyOptionAPIFromJSON (139-141)
src/models/IssuePropertyValueAPIDetail.ts (2)
  • IssuePropertyValueAPIDetail (22-35)
  • IssuePropertyValueAPIDetailFromJSON (46-48)
🪛 actionlint (1.7.7)
.github/workflows/publish-node-sdk.yml

37-37: the runner of "softprops/action-gh-release@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🔇 Additional comments (21)
package.json (1)

3-3: LGTM! Version increment follows semantic versioning.

The patch version bump from 0.1.3 to 0.1.4 appropriately reflects the bug fixes and type improvements mentioned in the PR objectives.

README.md (1)

1-1: LGTM! Documentation version references updated consistently.

The version references in both the title and npm install command have been properly updated to match the package.json version change.

Also applies to: 39-39

.openapi-generator/FILES (1)

44-44: LGTM! Manifest correctly tracks new model files.

The addition of IssueDetail.ts and IssuePropertyValueAPIDetail.ts to the OpenAPI generator manifest aligns with the new detailed serializers mentioned in the PR objectives.

Also applies to: 54-54

src/models/index.ts (1)

22-22: LGTM! New model exports properly added to public API.

The exports for IssueDetail and IssuePropertyValueAPIDetail correctly make these new detailed models available for consumption by SDK users.

Also applies to: 32-32

src/models/IssueExpand.ts (2)

73-82: Verify breaking change and update JSDoc comments.

The type change from object arrays to strings for labels and assignees is a significant simplification that could be a breaking change for existing consumers.

Additionally, the JSDoc comments don't reflect that these are now strings rather than arrays.

Please verify that:

  1. This change aligns with the actual API response format
  2. Existing consumers can handle this breaking change
  3. Consider updating the JSDoc comments to reflect the new string types
    /**
     * 
-    * @type {string}
+    * @type {string} - Comma-separated label names
     * @memberof IssueExpand
     */
    readonly labels?: string;
    /**
     * 
-    * @type {string}
+    * @type {string} - Comma-separated assignee identifiers
     * @memberof IssueExpand
     */
    readonly assignees?: string;

270-271: LGTM! JSON parsing logic correctly updated for string types.

The parsing logic has been appropriately simplified to handle the new string format for labels and assignees.

.github/workflows/publish-node-sdk.yml (1)

26-34: LGTM: Version extraction logic is robust.

The version extraction step properly validates the extracted version and fails gracefully if the version cannot be determined from package.json.

src/models/IssueSearch.ts (1)

24-26: LGTM: Documentation improvement enhances clarity.

The simplified documentation is more concise and clearly describes the purpose of the IssueSearch interface as providing search results for work items.

src/apis/WorkItemsApi.ts (2)

18-18: LGTM: Added necessary imports for IssueDetail type.

The imports are correctly added to support the new IssueDetail type usage in the API methods.

Also applies to: 27-28


379-379: IssueDetail upgrade verified—no breaking changes found

A search for retrieveWorkItem across the TypeScript codebase only returned its definitions in src/apis/WorkItemsApi.ts (no external calls to update), so switching the return type from Issue to IssueDetail is safe and requires no further action.

src/models/IssuePropertyValueAPIDetail.ts (3)

15-35: LGTM: Well-structured interface with clear documentation.

The interface properly represents aggregated issue property values with clear field descriptions and appropriate type definitions.


40-44: LGTM: Type guard implementation is correct.

The instanceOfIssuePropertyValueAPIDetail function properly validates both required fields (propertyId and values) are present and defined.


50-59: LGTM: JSON conversion handles snake_case mapping correctly.

The serialization and deserialization functions properly handle the conversion between property_id (snake_case) and propertyId (camelCase), following the established pattern in the codebase.

Also applies to: 65-75

src/models/IssueDetail.ts (4)

37-44: LGTM: Comprehensive interface documentation is clear.

The documentation accurately describes the interface as handling complete work item lifecycle with full relationship management.


233-238: LGTM: Type guard validates essential required fields.

The instance check correctly validates the three required fields: assignees, labels, and name, which are the non-optional fields in the interface.


244-281: LGTM: JSON deserialization handles complex type conversions correctly.

The deserialization properly:

  • Converts snake_case to camelCase field names
  • Parses ISO date strings to Date objects
  • Maps nested arrays using appropriate converters (UserLiteFromJSON, LabelFromJSON)
  • Handles null/undefined values appropriately

287-318: LGTM: JSON serialization properly excludes readonly fields.

The Omit type in the function signature correctly excludes readonly fields that shouldn't be serialized. The date formatting is appropriate:

  • Full ISO strings for timestamps (toISOString())
  • Date-only strings for date fields (toISOString().substring(0,10))
src/apis/WorkItemPropertiesApi.ts (4)

22-22: LGTM! Proper import of new detailed type.

The addition of IssuePropertyValueAPIDetail import and its corresponding JSON conversion functions aligns with the API's evolution to provide more detailed property value responses.

Also applies to: 38-39


506-506: Correct array handling for list properties endpoint.

The changes properly update the listIssueProperties methods to handle array responses:

  • Return type changed from single IssuePropertyAPI to Array<IssuePropertyAPI>
  • JSON parsing updated to map over the array using jsonValue.map(IssuePropertyAPIFromJSON)

This aligns with the backend API returning arrays for list operations.

Also applies to: 553-553, 560-560


569-569: Correct array handling for list property options endpoint.

The changes properly update the listIssuePropertyOptions methods to handle array responses:

  • Return type changed from single IssuePropertyOptionAPI to Array<IssuePropertyOptionAPI>
  • JSON parsing updated to map over the array using jsonValue.map(IssuePropertyOptionAPIFromJSON)

This maintains consistency with other list endpoints.

Also applies to: 616-616, 623-623


632-632: Proper migration to detailed property value type with array handling.

The changes correctly:

  1. Update return type to Array<IssuePropertyValueAPIDetail> (using the new detailed type)
  2. Update JSON parsing to use IssuePropertyValueAPIDetailFromJSON for each array element
  3. Maintain consistency between raw and non-raw method signatures

This addresses both the array response issue and adopts the more detailed property value model.

Also applies to: 686-686, 693-693

h-release action
@Prashant-Surya Prashant-Surya merged commit 5ee0c7a into main Aug 5, 2025
1 check passed
@Prashant-Surya Prashant-Surya deleted the release/v0.1.4 branch August 5, 2025 12:00
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