Skip to content
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

refactor: env-helpers #249

Merged
merged 2 commits into from
Sep 6, 2023
Merged

refactor: env-helpers #249

merged 2 commits into from
Sep 6, 2023

Conversation

mattzcarey
Copy link
Owner

No description provided.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 6, 2023

Risk Level 3 - /home/runner/work/code-review-gpt/code-review-gpt/services/core/functions/review-lambda/index.ts

The code changes in this file have a high risk to the code base. The changes involve adding a new type ReviewLambdasBody and importing the getVariableFromSSM function from the ../utils/getVariable module. The ReviewLambdasBody type seems to be used to define the structure of the request body for the Lambda function. The getVariableFromSSM function is used to retrieve a variable from AWS Systems Manager Parameter Store. The changes seem to be safe and do not introduce any potential bugs or performance issues. However, it would be good to ensure that the getVariableFromSSM function is implemented correctly and handles any errors that may occur when retrieving the variable from AWS SSM. Additionally, it would be good to review the authentication logic in the code to ensure that it is secure and follows best practices.


Risk Level 3 - /home/runner/work/code-review-gpt/code-review-gpt/services/core/functions/demo-review-lambda/index.ts

The function saveInputAndResponseToS3 has been removed, which may cause a bug or unintended behavior in the code. Ensure that the removal of this function is intentional and does not affect the functionality of the code.

To fix this issue, either restore the saveInputAndResponseToS3 function or update the code to handle the absence of this function.

Example:

const saveInputAndResponseToS3 = async (bucketName: string, s3Client: S3Client, demoReviewId: string, prompt: string, markdownReport: string) => {
  // Implementation of saving input and response to S3
};

Risk Level 3 - /home/runner/work/code-review-gpt/code-review-gpt/services/core/helpers/lambda.ts

The code changes in this file have a moderate risk to the code base. The changes add new constants and functions related to lambda functions. The code looks clean and readable. However, there is a potential bug in the commonLambdaEnvironment constant. It retrieves the stage and region values using the getStage and getRegion functions, but these functions may return different values each time they are called. It would be better to retrieve these values once and store them in variables. Additionally, the commonLambdaProps constant could benefit from using the SOLID principle of single responsibility. It currently includes multiple properties and configurations, which could be split into separate constants or functions for better maintainability.


🔍🔒🐛


Powered by Code Review GPT

@github-actions
Copy link
Contributor

github-actions bot commented Sep 6, 2023

Test results summary:

✅ [PASS] - Test case: Bad variable name
❌ [FAIL] - Test case: Exposed secret
✅ [PASS] - Test case: Too many nested loops
✅ [PASS] - Test case: Unawaited Promise

SUMMARY: ✅ PASS: 3 - ⚠️ WARN: 0 - ❌ FAIL: 1


Tests Powered by Code Review GPT

Copy link
Contributor

@lizacullis lizacullis left a comment

Choose a reason for hiding this comment

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

Just a potential improvement fro the bundling! I can also impelement it as part of my ticket if you don't want to do it here.

services/core/helpers/env-helpers/config.ts Outdated Show resolved Hide resolved
@mattzcarey mattzcarey merged commit 98b0d6a into main Sep 6, 2023
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