Skip to content

refactor: enhance logging and code formatting in SharedJobsService#1487

Merged
Artuomka merged 1 commit into
mainfrom
backend_aws_bedrock
Dec 23, 2025
Merged

refactor: enhance logging and code formatting in SharedJobsService#1487
Artuomka merged 1 commit into
mainfrom
backend_aws_bedrock

Conversation

@Artuomka

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings December 23, 2025 13:13
@Artuomka Artuomka merged commit f28d516 into main Dec 23, 2025
17 checks passed
@Artuomka Artuomka deleted the backend_aws_bedrock branch December 23, 2025 13:13

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

Copy link

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.

Suggested change
console.info('AI response text. ', responseText);

Copilot uses AI. Check for mistakes.
if (!connection || isTest()) {
return;
}
console.info(`Starting AI scan for connection with id "${connection.id}"`);

Copilot AI Dec 23, 2025

Copy link

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.

Copilot uses AI. Check for mistakes.
}
}
} catch (error) {
console.error('Error during AI scan and creation of settings/widgets: ', error);

Copilot AI Dec 23, 2025

Copy link

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.

Copilot uses AI. Check for mistakes.
});
try {
const response = await this.bedrockRuntimeClient.send(command);
console.info('AI response received from Amazon Bedrock.');

Copilot AI Dec 23, 2025

Copy link

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.

Copilot uses AI. Check for mistakes.
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