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

chore(all): reduce cognitive complexity #1009

Merged
merged 3 commits into from
Sep 15, 2023
Merged

Conversation

biffgaut
Copy link
Contributor

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@aws-solutions-constructs-team
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: githubautobuild-for-cdk-v2
  • Commit ID: 6962fde
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-solutions-constructs-team
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: githubautobuild-for-cdk-v2
  • Commit ID: 2a1222f
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-solutions-constructs-team
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: githubautobuild-for-cdk-v2
  • Commit ID: 7f6f349
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Copy link
Contributor

@georgebearden georgebearden left a comment

Choose a reason for hiding this comment

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

Great addition of tests and clean up.

Comment on lines +604 to +618
const containerName = "custom-container-name";
const serviceName = "custom-service-name";
const familyName = "custom-family-name";

const props: FargateToKinesisStreamsProps = {
publicApi,
ecrRepositoryArn: defaults.fakeEcrRepoArn,
clusterProps: { clusterName },
containerDefinitionProps: { containerName },
fargateTaskDefinitionProps: { family: familyName },
fargateServiceProps: { serviceName },
existingVpc: defaults.getTestVpc(stack),
vpcProps: { },
};
Copy link
Contributor

Choose a reason for hiding this comment

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

This code is duplicated in many tests. May be worth creating a function that takes in stack and returns this props object?

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm.... Now I see below that its the same fargate-based params, but the other service making up the construct is in there too. Perhaps still creating the default set of fargate props and passing them to the construct props object with a ...fargateProps call?

@biffgaut biffgaut merged commit 73172bb into main Sep 15, 2023
2 checks passed
@biffgaut biffgaut deleted the CognitiveComplexityTwo branch September 15, 2023 12:13
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.

3 participants