-
-
Notifications
You must be signed in to change notification settings - Fork 18
refactor: enhance logging and code formatting in SharedJobsService #1487
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 refactors the SharedJobsService and AmazonBedrockAiProvider by standardizing code formatting from spaces to tabs and adding logging statements to improve observability during AI-powered database scanning operations.
Key changes:
- Converted indentation from spaces to tabs throughout both files for consistency
- Added informational and error logging to track AI scan progress and failures
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| backend/src/entities/shared-jobs/shared-jobs.service.ts | Reformatted indentation to tabs; added console.info log at scan start and console.error log for error handling to improve debugging visibility |
| backend/src/entities/ai/amazon-bedrock/amazon-bedrock.ai.provider.ts | Reformatted indentation to tabs; added console.info logs to track AI response receipt and log response content for debugging |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const response = await this.bedrockRuntimeClient.send(command); | ||
| console.info('AI response received from Amazon Bedrock.'); | ||
| const responseText = response.output.message?.content[0].text; | ||
| console.info('AI response text. ', responseText); |
Copilot
AI
Dec 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logging the full AI response text may expose sensitive information. The response could contain user data, internal database structure details, or other confidential information that shouldn't be logged in production environments. Consider removing this log statement or wrapping it in a development-only check, or at minimum redact/truncate sensitive portions of the response.
| console.info('AI response text. ', responseText); |
| if (!connection || isTest()) { | ||
| return; | ||
| } | ||
| console.info(`Starting AI scan for connection with id "${connection.id}"`); |
Copilot
AI
Dec 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The codebase has a structured logging system using WinstonLogger (see backend/src/entities/logging/winston-logger.ts). While console.info/console.error are used in some places in the codebase, for consistency and better log management (centralized configuration, log levels, transports), consider injecting and using WinstonLogger instead of console.info for this logging statement.
| } | ||
| } | ||
| } catch (error) { | ||
| console.error('Error during AI scan and creation of settings/widgets: ', error); |
Copilot
AI
Dec 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The codebase has a structured logging system using WinstonLogger (see backend/src/entities/logging/winston-logger.ts). While console.info/console.error are used in some places in the codebase, for consistency and better log management (centralized configuration, log levels, transports), consider injecting and using WinstonLogger instead of console.error for this logging statement.
| }); | ||
| try { | ||
| const response = await this.bedrockRuntimeClient.send(command); | ||
| console.info('AI response received from Amazon Bedrock.'); |
Copilot
AI
Dec 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The codebase has a structured logging system using WinstonLogger (see backend/src/entities/logging/winston-logger.ts). While console.info/console.error are used in some places in the codebase, for consistency and better log management (centralized configuration, log levels, transports), consider injecting and using WinstonLogger instead of console.info for this logging statement.
No description provided.