Skip to content

docs: Add missing JSDoc comments to API endpoints - #6347

Merged
yolossn merged 2 commits into
kubernetes-sigs:mainfrom
Psykii22:fix/api-jsdocs
Jul 3, 2026
Merged

yolossn merged 2 commits into
kubernetes-sigs:mainfrom
Psykii22:fix/api-jsdocs

Conversation

@Psykii22

@Psykii22 Psykii22 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR adds missing JSDoc comments to the frontend API layer, replacing old @todo placeholders with proper documentation to improve developer experience.

Related Issue

Changes

  • Updated drainNode.ts: Added JSDoc blocks for the DrainNodeStatus interface and documented the return promise for the drainNodeStatus function.
  • Updated streamingApi.ts: Added JSDoc blocks clarifying the internal configuration structure of StreamResultsParams and the behavior of the streamResultsForCluster streaming function.
  • Fixed various // @todo: needs documenting comments scattered throughout the API files.

Steps to Test

  1. Open frontend/src/lib/k8s/api/v1/drainNode.ts and frontend/src/lib/k8s/api/v1/streamingApi.ts in an IDE
  2. Hover over the DrainNodeStatus type or the StreamResultsParams interface.
  3. Observe that the tooltip successfully renders the new JSDoc descriptions.

Screenshots (if applicable)

Notes for the Reviewer

  • These are simple cleanup tasks targeting @todo comments left by previous developers. No logic changes were made, only JSDoc additions to improve code readability and editor tooling support.

@kubernetes-prow
kubernetes-prow Bot requested review from illume and yolossn July 3, 2026 03:56
@kubernetes-prow kubernetes-prow Bot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 3, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Psykii22
Once this PR has been reviewed and has the lgtm label, please assign joaquimrocha for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow kubernetes-prow Bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jul 3, 2026
@yolossn
yolossn requested a review from Copilot July 3, 2026 14:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to improve developer experience in the frontend Kubernetes API v1 layer by replacing @todo placeholders with JSDoc so IDE tooltips better describe API types and function behavior.

Changes:

  • Added JSDoc for StreamResultsParams and streamResultsForCluster in streamingApi.ts.
  • Added JSDoc for the DrainNodeStatus interface and clarified the drainNodeStatus return description in drainNode.ts.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
frontend/src/lib/k8s/api/v1/streamingApi.ts Adds documentation for streaming configuration and behavior, but still leaves one // @todo: needs documenting. and has an existing JSDoc return mismatch for streamResults.
frontend/src/lib/k8s/api/v1/drainNode.ts Documents drain status type and return value, but the new doc for DrainNodeStatus.id is inaccurate relative to backend behavior.

Comment thread frontend/src/lib/k8s/api/v1/drainNode.ts Outdated
Comment thread frontend/src/lib/k8s/api/v1/streamingApi.ts
Comment thread frontend/src/lib/k8s/api/v1/streamingApi.ts
Signed-off-by: Psykii22 <189542486+Psykii22@users.noreply.github.com>
@kubernetes-prow kubernetes-prow Bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 3, 2026
@yolossn
yolossn merged commit b05958b into kubernetes-sigs:main Jul 3, 2026
12 of 13 checks passed
@illume illume added this to the v0.44.0 milestone Jul 27, 2026
@illume illume added documentation Improvements or additions to documentation dx frontend Issues related to the frontend labels Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. documentation Improvements or additions to documentation dx frontend Issues related to the frontend size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants