Skip to content

📝 Add docstrings to newf#11

Closed
coderabbitai[bot] wants to merge 1 commit into
newffrom
coderabbitai/docstrings/f5df529
Closed

📝 Add docstrings to newf#11
coderabbitai[bot] wants to merge 1 commit into
newffrom
coderabbitai/docstrings/f5df529

Conversation

@coderabbitai
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot commented Dec 8, 2025

Docstrings generation was requested by @Coder-soft.

The following files were modified:

  • hosting/cli/src/api/client.ts
  • hosting/cli/src/auth/discord.ts
  • hosting/cli/src/auth/session.ts
  • hosting/cli/src/tui/app.tsx
  • hosting/cli/src/tui/screens/create.tsx
  • hosting/cli/src/tui/screens/dashboard.tsx
  • hosting/cli/src/tui/screens/login.tsx
  • hosting/server/src/api/websocket.ts
  • hosting/server/src/auth/middleware.ts
  • hosting/server/src/auth/supabase.ts
  • hosting/server/src/config.ts
  • hosting/server/src/index.ts
  • hosting/server/src/orchestrator/docker.ts
  • hosting/server/src/orchestrator/instance.ts
These file types are not supported
  • docs/api-reference.html
  • docs/getting-started.html
  • docs/index.html
  • docs/plugins.html
  • docs/security.html
  • docs/websocket.html
  • hosting/README.md
  • hosting/cli/package.json
  • hosting/cli/tsconfig.json
  • hosting/database/schema.sql
  • hosting/server/.env.example
  • hosting/server/package.json
  • hosting/server/tsconfig.json
  • hosting/shared/package.json
  • hosting/shared/tsconfig.json
ℹ️ Note

CodeRabbit cannot perform edits on its own pull requests yet.

Docstrings generation was requested by @Coder-soft.

* #10 (comment)

The following files were modified:

* `hosting/cli/src/api/client.ts`
* `hosting/cli/src/auth/discord.ts`
* `hosting/cli/src/auth/session.ts`
* `hosting/cli/src/tui/app.tsx`
* `hosting/cli/src/tui/screens/create.tsx`
* `hosting/cli/src/tui/screens/dashboard.tsx`
* `hosting/cli/src/tui/screens/login.tsx`
* `hosting/server/src/api/websocket.ts`
* `hosting/server/src/auth/middleware.ts`
* `hosting/server/src/auth/supabase.ts`
* `hosting/server/src/config.ts`
* `hosting/server/src/index.ts`
* `hosting/server/src/orchestrator/docker.ts`
* `hosting/server/src/orchestrator/instance.ts`
@coderabbitai coderabbitai Bot requested a review from Coder-soft December 8, 2025 16:19
@coderabbitai coderabbitai Bot mentioned this pull request Dec 8, 2025
Closed
@coderabbitai
Copy link
Copy Markdown
Contributor Author

coderabbitai Bot commented Dec 8, 2025

Important

Review skipped

CodeRabbit bot authored PR detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Dec 8, 2025

Greptile Overview

Greptile Summary

Added comprehensive JSDoc docstrings to 14 TypeScript files across the HoloBridge hosting platform, documenting all exported functions, components, and key internal utilities.

Key Changes

  • CLI files: Documented API client functions, authentication flows (Discord OAuth, session management), and TUI components
  • Server files: Documented WebSocket handlers, auth middleware, Supabase integration, Docker orchestration, and instance management
  • Documentation quality: Most docstrings include clear descriptions, @param tags, @returns tags, and @throws tags where applicable

Issues Found

  • Missing @param tags in 7 function docstrings across three files (detailed in inline comments)
  • All issues are documentation completeness issues; no functional code was changed

Confidence Score: 4/5

  • Safe to merge after fixing missing @param tags in docstrings
  • This is a documentation-only PR with no functional code changes. The docstrings are well-written and accurate, but 7 functions are missing @param tags which should be added for completeness and consistency with the rest of the codebase.
  • hosting/cli/src/api/client.ts, hosting/server/src/orchestrator/docker.ts, and hosting/server/src/orchestrator/instance.ts need @param tags added to their docstrings

Important Files Changed

File Analysis

Filename Score Overview
hosting/cli/src/api/client.ts 4/5 Added comprehensive JSDoc docstrings to all exported functions; missing @param tags for id in getInstance and parameters in togglePlugin
hosting/server/src/orchestrator/docker.ts 4/5 Added docstrings for Docker orchestration functions; missing @param containerId in several function docstrings (startContainer, stopContainer, getContainerStatus)
hosting/server/src/orchestrator/instance.ts 4/5 Added comprehensive docstrings for instance management functions; missing @param instanceId in getInstance function and period missing in encrypt docstring

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant Bot as CodeRabbit Bot
    participant Files as Source Files
    participant PR as Pull Request

    Dev->>PR: Request docstring generation in PR #10
    Bot->>Files: Analyze 14 TypeScript files
    Files-->>Bot: Return function signatures
    Bot->>Bot: Generate JSDoc docstrings
    Bot->>Files: Add docstrings to functions
    Files-->>Bot: Docstrings added
    Bot->>PR: Create PR #11 with docstrings
    PR-->>Dev: Ready for review
Loading

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

Additional Comments (2)

  1. hosting/server/src/orchestrator/docker.ts, line 164-170 (link)

    syntax: missing @param containerId parameter in docstring

  2. hosting/server/src/orchestrator/docker.ts, line 172-178 (link)

    syntax: missing @param containerId parameter in docstring

14 files reviewed, 7 comments

Edit Code Review Agent Settings | Greptile

Comment on lines +103 to +107
* Retrieve details for a specific instance by ID.
*
* @returns An object containing the `instance`, its `containerStatus`, and `stats` with `cpu` and `memory` (or `null` if stats are unavailable).
* @throws When the API response indicates failure or does not contain data.
*/
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.

syntax: missing @param id parameter in docstring

Suggested change
* Retrieve details for a specific instance by ID.
*
* @returns An object containing the `instance`, its `containerStatus`, and `stats` with `cpu` and `memory` (or `null` if stats are unavailable).
* @throws When the API response indicates failure or does not contain data.
*/
/**
* Retrieve details for a specific instance by ID.
*
* @param id - The instance identifier to retrieve
* @returns An object containing the `instance`, its `containerStatus`, and `stats` with `cpu` and `memory` (or `null` if stats are unavailable).
* @throws When the API response indicates failure or does not contain data.
*/
Prompt To Fix With AI
This is a comment left during a code review.
Path: hosting/cli/src/api/client.ts
Line: 103:107

Comment:
**syntax:** missing `@param id` parameter in docstring

```suggestion
/**
 * Retrieve details for a specific instance by ID.
 *
 * @param id - The instance identifier to retrieve
 * @returns An object containing the `instance`, its `containerStatus`, and `stats` with `cpu` and `memory` (or `null` if stats are unavailable).
 * @throws When the API response indicates failure or does not contain data.
 */
```

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +277 to +282
/**
* Toggle a plugin's enabled state for a specific instance.
*
* @returns The updated `InstancePlugin` object.
* @throws Error if the API response indicates failure or lacks the updated plugin data.
*/
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.

syntax: missing parameters instanceId, pluginId, and enabled in docstring

Suggested change
/**
* Toggle a plugin's enabled state for a specific instance.
*
* @returns The updated `InstancePlugin` object.
* @throws Error if the API response indicates failure or lacks the updated plugin data.
*/
/**
* Toggle a plugin's enabled state for a specific instance.
*
* @param instanceId - The instance identifier that owns the plugin
* @param pluginId - The plugin identifier to toggle
* @param enabled - Whether the plugin should be enabled (`true`) or disabled (`false`)
* @returns The updated `InstancePlugin` object.
* @throws Error if the API response indicates failure or lacks the updated plugin data.
*/
Prompt To Fix With AI
This is a comment left during a code review.
Path: hosting/cli/src/api/client.ts
Line: 277:282

Comment:
**syntax:** missing parameters `instanceId`, `pluginId`, and `enabled` in docstring

```suggestion
/**
 * Toggle a plugin's enabled state for a specific instance.
 *
 * @param instanceId - The instance identifier that owns the plugin
 * @param pluginId - The plugin identifier to toggle
 * @param enabled - Whether the plugin should be enabled (`true`) or disabled (`false`)
 * @returns The updated `InstancePlugin` object.
 * @throws Error if the API response indicates failure or lacks the updated plugin data.
 */
```

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +24 to 31
/**
* Derives a 256-bit encryption key from the configured security encryption key.
*
* @returns A 32-byte Buffer containing the derived AES-256 key.
*/
function getEncryptionKey(): Buffer {
return createHash('sha256').update(config.security.encryptionKey).digest();
}
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.

syntax: missing @param tag for function parameter

Suggested change
/**
* Derives a 256-bit encryption key from the configured security encryption key.
*
* @returns A 32-byte Buffer containing the derived AES-256 key.
*/
function getEncryptionKey(): Buffer {
return createHash('sha256').update(config.security.encryptionKey).digest();
}
/**
* Derives a 256-bit encryption key from the configured security encryption key.
*
* @returns A 32-byte Buffer containing the derived AES-256 key.
*/
function getEncryptionKey(): Buffer {
return createHash('sha256').update(config.security.encryptionKey).digest();
}
/**
* Encrypts a UTF-8 string using AES-256-GCM and returns a single hex-encoded payload.
*
* @param text - The plaintext to encrypt
* @returns A string formatted as `iv:tag:encrypted` where each segment is hex-encoded (IV and auth tag are 16 bytes)
*/
Prompt To Fix With AI
This is a comment left during a code review.
Path: hosting/server/src/orchestrator/instance.ts
Line: 24:31

Comment:
**syntax:** missing `@param` tag for function parameter

```suggestion
/**
 * Derives a 256-bit encryption key from the configured security encryption key.
 *
 * @returns A 32-byte Buffer containing the derived AES-256 key.
 */
function getEncryptionKey(): Buffer {
    return createHash('sha256').update(config.security.encryptionKey).digest();
}

/**
 * Encrypts a UTF-8 string using AES-256-GCM and returns a single hex-encoded payload.
 *
 * @param text - The plaintext to encrypt
 * @returns A string formatted as `iv:tag:encrypted` where each segment is hex-encoded (IV and auth tag are 16 bytes)
 */
```

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines 181 to 185
/**
* Get an instance by ID
* Retrieve an instance record by its ID.
*
* @returns The `Instance` mapped from the database row (with `createdAt` and `updatedAt` as `Date`), or `null` if the instance is not found or a query error occurs.
*/
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.

syntax: missing @param instanceId parameter in docstring

Suggested change
/**
* Get an instance by ID
* Retrieve an instance record by its ID.
*
* @returns The `Instance` mapped from the database row (with `createdAt` and `updatedAt` as `Date`), or `null` if the instance is not found or a query error occurs.
*/
/**
* Retrieve an instance record by its ID.
*
* @param instanceId - The ID of the instance to retrieve
* @returns The `Instance` mapped from the database row (with `createdAt` and `updatedAt` as `Date`), or `null` if the instance is not found or a query error occurs.
*/
Prompt To Fix With AI
This is a comment left during a code review.
Path: hosting/server/src/orchestrator/instance.ts
Line: 181:185

Comment:
**syntax:** missing `@param instanceId` parameter in docstring

```suggestion
/**
 * Retrieve an instance record by its ID.
 *
 * @param instanceId - The ID of the instance to retrieve
 * @returns The `Instance` mapped from the database row (with `createdAt` and `updatedAt` as `Date`), or `null` if the instance is not found or a query error occurs.
 */
```

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines 211 to 216
/**
* Get container status
* Retrieve the current status and metadata for a container.
*
* @returns A `ContainerStatus` object containing `id`, `name`, `state`, optional `health`, `port`, and optional `startedAt` when available; `null` if the container cannot be inspected.
*/
export async function getContainerStatus(containerId: string): Promise<ContainerStatus | null> {
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.

syntax: missing @param containerId parameter in docstring

Suggested change
/**
* Get container status
* Retrieve the current status and metadata for a container.
*
* @returns A `ContainerStatus` object containing `id`, `name`, `state`, optional `health`, `port`, and optional `startedAt` when available; `null` if the container cannot be inspected.
*/
export async function getContainerStatus(containerId: string): Promise<ContainerStatus | null> {
/**
* Retrieve the current status and metadata for a container.
*
* @param containerId - The Docker container ID to query
* @returns A `ContainerStatus` object containing `id`, `name`, `state`, optional `health`, `port`, and optional `startedAt` when available; `null` if the container cannot be inspected.
*/
Prompt To Fix With AI
This is a comment left during a code review.
Path: hosting/server/src/orchestrator/docker.ts
Line: 211:216

Comment:
**syntax:** missing `@param containerId` parameter in docstring

```suggestion
/**
 * Retrieve the current status and metadata for a container.
 *
 * @param containerId - The Docker container ID to query
 * @returns A `ContainerStatus` object containing `id`, `name`, `state`, optional `health`, `port`, and optional `startedAt` when available; `null` if the container cannot be inspected.
 */
```

How can I resolve this? If you propose a fix, please make it concise.

@Coder-soft Coder-soft closed this Dec 16, 2025
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