Skip to content

Conversation

@kkartunov
Copy link
Contributor

}

const opportunity = await models.CopilotOpportunity.create(data, { transaction });
req.log.debug('Created new copilot opportunity', { opportunityId: opportunity.id });

Choose a reason for hiding this comment

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

[⚠️ correctness]
Consider adding a check to ensure that opportunity is not null or undefined before logging its id. This will prevent potential runtime errors if create fails silently.

subjects.forEach(subject => sendNotification(subject.handle, subject.email));

// send email to notify via slack
sendNotification('Copilots', config.copilotsSlackEmail);

Choose a reason for hiding this comment

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

[⚠️ security]
The email address config.copilotsSlackEmail should be validated to ensure it is correctly configured. If this value is incorrect, the notification will fail silently.

throw err;
}
try {
const copilotRequest = await models.sequelize.transaction(async (transaction) => {

Choose a reason for hiding this comment

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

[⚠️ performance]
Consider adding a timeout or a retry mechanism for the transaction to handle potential deadlocks or long-running operations.


return res.status(201).json(copilotRequest);
} catch (err) {
req.log.error('Error creating copilot request', { error: err });

Choose a reason for hiding this comment

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

[❗❗ security]
Logging the error message directly might expose sensitive information. Consider sanitizing the error message before logging.

return _.get(res, 'data.result.content', [])
const roles = res.data;
logger.debug(`Roles by ${roleName}: ${JSON.stringify(roles)}`);
return roles.result.content

Choose a reason for hiding this comment

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

[❗❗ correctness]
The roles.result.content is accessed without checking if roles.result is defined. This could lead to a runtime error if the response structure changes or if the expected data is not present. Consider adding a check to ensure roles.result is defined before accessing roles.result.content.

Reduced the branches for deployDev to only 'develop'.
filters:
branches:
only: ['develop', 'migration-setup', 'PM-1612', 'fix-project-exposing']
only: ['develop']

Choose a reason for hiding this comment

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

[⚠️ design]
The branch filter for the deployDev job has been changed to only include the develop branch. Ensure that this aligns with the intended deployment strategy, as it removes the ability to deploy from other branches like migration-setup, PM-1612, fix-2321, and pm-2435. This could impact the flexibility of testing and deploying changes from feature or bug-fix branches.

@kkartunov kkartunov merged commit 104f2ea into master Nov 18, 2025
1 of 2 checks passed
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.

4 participants