Skip to content

Conversation

@Shereef
Copy link
Member

@Shereef Shereef commented Nov 6, 2025

No description provided.

Travis Walker added 28 commits April 19, 2022 09:44
@Shereef Shereef requested a review from Copilot November 6, 2025 03:24
Copy link

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 upgrades dependencies (AWS CDK, aws-sdk, js-yaml, and others) and refactors the deployment provider system to support multiple Serverless Framework versions (v1, v2, v3) and AWS CDK. It also adds support for environment variable-based configuration, SNS notifications for deployment status, and secret resolution from SSM.

  • Updates dependencies including AWS CDK (1.94.1), aws-sdk (2.869.0), js-yaml (4.0.0), and adds new packages (chalk, flat, ncjsm)
  • Refactors Serverless provider to handle v1, v2, and v3 compatibility with dynamic module resolution
  • Adds SNS client for publishing deployment results to Frankenstack
  • Implements secret resolution from AWS Systems Manager Parameter Store
  • Renames class from ServerlessV1 to Serverless and method from destroy to remove

Reviewed Changes

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

Show a summary per file
File Description
package.json Updates dependencies and removes serverless package from direct dependencies
lib/utils/parseYaml.ts/js Updates js-yaml API from deprecated safeLoad to load
lib/service/snsClient.ts/js New service for publishing deployment status messages to SNS
lib/providers/serverless.ts/js Major refactor to support multiple Serverless Framework versions with credential handling
lib/providers/hardcoded.ts/js Updates property names and adds result field to response
lib/providers/cdk.ts/js Adds remove method, credential handling, and refactors deploy logic
lib/deployer.ts/js Adds environment variable parsing, secret resolution, and SNS integration
bin/index.ts/js Makes file parameter optional and adds default command

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


console.log('resolved config', configuration, util.inspect(variablesMeta, {showHidden: false, depth: null, colors: true}));
} catch(err) {
console.error('Error while resoving serverless template.', err);
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

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

Corrected spelling of 'resoving' to 'resolving'.

Suggested change
console.error('Error while resoving serverless template.', err);
console.error('Error while resolving serverless template.', err);

Copilot uses AI. Check for mistakes.
} else {
const result = {status: false}
await this.publishResultToFrankenstack(result);
throw `Failed to resolve secret value for paramater: ${paramName}`;
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

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

Corrected spelling of 'paramater' to 'parameter'.

Suggested change
throw `Failed to resolve secret value for paramater: ${paramName}`;
throw `Failed to resolve secret value for parameter: ${paramName}`;

Copilot uses AI. Check for mistakes.
"@aws-cdk/core": "^1.94.1",
"aws-cdk": "1.94.1",
"aws-sdk": "^2.869.0",
"chalk": "^5.0.0",
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

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

Chalk v5.0.0+ is ESM-only and incompatible with CommonJS require() statements used throughout this codebase. Since chalk is not currently imported anywhere, this unused dependency should either be removed or downgraded to v4.x which supports CommonJS.

Suggested change
"chalk": "^5.0.0",

Copilot uses AI. Check for mistakes.
const client = new SNS();

module.exports = {
async publishJobRunFinishedMessage(jobRunFinishedResult: any) {
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

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

Missing validation for process.env.JOB_RUN_FINISHED_TOPIC_ARN. If this environment variable is undefined, the SNS publish call will fail. Add validation to ensure the TopicArn is defined before attempting to publish.

Suggested change
async publishJobRunFinishedMessage(jobRunFinishedResult: any) {
async publishJobRunFinishedMessage(jobRunFinishedResult: any) {
if (!process.env.JOB_RUN_FINISHED_TOPIC_ARN) {
throw new Error('Environment variable JOB_RUN_FINISHED_TOPIC_ARN is not defined.');
}

Copilot uses AI. Check for mistakes.
return;
}
for(var key of Object.keys(this.component.inputs)) {
if(this.component.inputs[key].startsWith('ssm:')) {
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

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

Potential TypeError if this.component.inputs[key] is not a string. The code should verify that the value is a string before calling startsWith().

Suggested change
if(this.component.inputs[key].startsWith('ssm:')) {
if(typeof this.component.inputs[key] === 'string' && this.component.inputs[key].startsWith('ssm:')) {

Copilot uses AI. Check for mistakes.
options['stage'] = this.stage;

if(this.account) {
options['aws-profile'] = 'frank'
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

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

Avoid automated semicolon insertion (90% of all statements in the enclosing function have an explicit semicolon).

Suggested change
options['aws-profile'] = 'frank'
options['aws-profile'] = 'frank';

Copilot uses AI. Check for mistakes.
}

if(this.account) {
process.argv.push('--aws-profile', 'frank')
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

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

Avoid automated semicolon insertion (90% of all statements in the enclosing function have an explicit semicolon).

Suggested change
process.argv.push('--aws-profile', 'frank')
process.argv.push('--aws-profile', 'frank');

Copilot uses AI. Check for mistakes.
await sls.init();
}
try {
console.log("Executing serverless run.")
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

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

Avoid automated semicolon insertion (90% of all statements in the enclosing function have an explicit semicolon).

Suggested change
console.log("Executing serverless run.")
console.log("Executing serverless run.");

Copilot uses AI. Check for mistakes.
await sls.run();
} catch(err) {
console.error(err);
success = false
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

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

Avoid automated semicolon insertion (90% of all statements in the enclosing function have an explicit semicolon).

Suggested change
success = false
success = false;

Copilot uses AI. Check for mistakes.
return {
result: success,
outputs: outputs
}
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

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

Avoid automated semicolon insertion (90% of all statements in the enclosing function have an explicit semicolon).

Suggested change
}
};

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.

4 participants