Skip to content

Fix paths and do not copy tests on image#2

Merged
alvagante merged 7 commits intomainfrom
devel
Nov 24, 2025
Merged

Fix paths and do not copy tests on image#2
alvagante merged 7 commits intomainfrom
devel

Conversation

@alvagante
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings November 24, 2025 15:13
Copy link
Contributor

Copilot AI left a comment

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 improves the TypeScript build configuration to prevent test files from being compiled and included in production builds, particularly when building Docker images. The changes ensure that only source code from the src/ directory is compiled by TypeScript, while test files continue to be handled separately by Vitest.

  • Added rootDir configuration to properly scope TypeScript compilation to the source directory
  • Removed test files from TypeScript compilation include patterns
  • Explicitly excluded test directory to prevent compilation of test files

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings November 24, 2025 15:21
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 89 to 91
onCommand: (cmd: string) => { streamingManager.emitCommand(executionId, cmd); },
onStdout: (chunk: string) => { streamingManager.emitStdout(executionId, chunk); },
onStderr: (chunk: string) => { streamingManager.emitStderr(executionId, chunk); },
Copy link

Copilot AI Nov 24, 2025

Choose a reason for hiding this comment

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

[nitpick] Inconsistent arrow function syntax for streaming callbacks. In tasks.ts, the callbacks use explicit return type annotations and are formatted across multiple lines (e.g., onCommand: (cmd: string): void => { ... }), while in this file they're inline with braces but no return type. Consider standardizing the pattern across all route files for consistency.

Suggested change
onCommand: (cmd: string) => { streamingManager.emitCommand(executionId, cmd); },
onStdout: (chunk: string) => { streamingManager.emitStdout(executionId, chunk); },
onStderr: (chunk: string) => { streamingManager.emitStderr(executionId, chunk); },
onCommand: (cmd: string): void => {
streamingManager.emitCommand(executionId, cmd);
},
onStdout: (chunk: string): void => {
streamingManager.emitStdout(executionId, chunk);
},
onStderr: (chunk: string): void => {
streamingManager.emitStderr(executionId, chunk);
},

Copilot uses AI. Check for mistakes.
Comment on lines 114 to 116
onCommand: (cmd: string) => { streamingManager.emitCommand(executionId, cmd); },
onStdout: (chunk: string) => { streamingManager.emitStdout(executionId, chunk); },
onStderr: (chunk: string) => { streamingManager.emitStderr(executionId, chunk); },
Copy link

Copilot AI Nov 24, 2025

Choose a reason for hiding this comment

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

[nitpick] Inconsistent arrow function syntax for streaming callbacks. In tasks.ts, the callbacks use explicit return type annotations and are formatted across multiple lines (e.g., onCommand: (cmd: string): void => { ... }), while in this file they're inline with braces but no return type. Consider standardizing the pattern across all route files for consistency.

Suggested change
onCommand: (cmd: string) => { streamingManager.emitCommand(executionId, cmd); },
onStdout: (chunk: string) => { streamingManager.emitStdout(executionId, chunk); },
onStderr: (chunk: string) => { streamingManager.emitStderr(executionId, chunk); },
onCommand: (cmd: string): void => {
streamingManager.emitCommand(executionId, cmd);
},
onStdout: (chunk: string): void => {
streamingManager.emitStdout(executionId, chunk);
},
onStderr: (chunk: string): void => {
streamingManager.emitStderr(executionId, chunk);
},

Copilot uses AI. Check for mistakes.
Comment on lines 96 to 98
onCommand: (cmd: string) => { streamingManager.emitCommand(executionId, cmd); },
onStdout: (chunk: string) => { streamingManager.emitStdout(executionId, chunk); },
onStderr: (chunk: string) => { streamingManager.emitStderr(executionId, chunk); },
Copy link

Copilot AI Nov 24, 2025

Choose a reason for hiding this comment

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

[nitpick] Inconsistent arrow function syntax for streaming callbacks. In tasks.ts, the callbacks use explicit return type annotations and are formatted across multiple lines (e.g., onCommand: (cmd: string): void => { ... }), while in this file they're inline with braces but no return type. Consider standardizing the pattern across all route files for consistency.

Suggested change
onCommand: (cmd: string) => { streamingManager.emitCommand(executionId, cmd); },
onStdout: (chunk: string) => { streamingManager.emitStdout(executionId, chunk); },
onStderr: (chunk: string) => { streamingManager.emitStderr(executionId, chunk); },
onCommand: (cmd: string): void => {
streamingManager.emitCommand(executionId, cmd);
},
onStdout: (chunk: string): void => {
streamingManager.emitStdout(executionId, chunk);
},
onStderr: (chunk: string): void => {
streamingManager.emitStderr(executionId, chunk);
},

Copilot uses AI. Check for mistakes.
- Replace String() constructor with .toString() method for better type safety
- Use nullish coalescing operator (??) instead of logical OR (||)
- Add explicit Promise.resolve() return for async handlers
- Remove debug console.log statements from main.ts
- Improve error message handling with proper null checks
- Enhance code consistency across backend services and routes

Files modified:
- backend/src/bolt/BoltService.ts
- backend/src/config/ConfigService.ts
- backend/src/routes/commands.ts
- backend/src/routes/executions.ts
- backend/src/routes/packages.ts
- backend/src/routes/puppet.ts
- backend/src/routes/streaming.ts
- backend/src/services/ExecutionQueue.ts
- backend/src/services/StreamingExecutionManager.ts
- frontend/src/lib/api.ts
- frontend/src/main.ts
Copilot AI review requested due to automatic review settings November 24, 2025 15:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 12 out of 14 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +89 to +93
asyncHandler((_req: Request, res: Response): Promise<void> => {
res.json({
activeExecutions: streamingManager.getActiveExecutionCount(),
});
return Promise.resolve();
Copy link

Copilot AI Nov 24, 2025

Choose a reason for hiding this comment

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

The handler function is not declared as async, so it must explicitly return a Promise in all code paths. Currently, line 93 returns Promise.resolve() for the error path, but lines 90-92 don't return a promise for the success path.

Either:

  1. Add return before Promise.resolve() on line 93, and wrap the entire function in async and remove the explicit Promise.resolve(), OR
  2. Change lines 90-93 to: return Promise.resolve(res.json({...}));

For consistency with other handlers in the codebase that ARE async (e.g., executions.ts lines 40, 102), consider making this handler async as well.

Suggested change
asyncHandler((_req: Request, res: Response): Promise<void> => {
res.json({
activeExecutions: streamingManager.getActiveExecutionCount(),
});
return Promise.resolve();
asyncHandler(async (_req: Request, res: Response): Promise<void> => {
res.json({
activeExecutions: streamingManager.getActiveExecutionCount(),
});

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings November 24, 2025 15:54
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 16 out of 18 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@alvagante alvagante merged commit e1132f4 into main Nov 24, 2025
8 checks passed
@alvagante alvagante deleted the devel branch November 24, 2025 16:05
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