aws-cdk icon indicating copy to clipboard operation
aws-cdk copied to clipboard

fix(iam): incorrect input for AccountPrincipal is building successfully

Open duranbe opened this issue 1 year ago • 10 comments

Reason for this change

There is no validation and test that the AWS Account Id when creating AccountPrincipal Object. In my case I missed a digit when copy pasting an account id and the build still passed, the typo has been caught only during the code review process

Description of changes

Adding simple regex to check that AWS Id is 12 digits long & update error message

Description of how you validated changes

Existing tests are passing and added 2 of them

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

duranbe avatar Jun 15 '24 21:06 duranbe

Logs are quite odd

[4/4] Building fresh packages...
error /codebuild/output/src3225815236/src/github.com/aws/aws-cdk/node_modules/@lerna/create/node_modules/nx, /codebuild/output/src3225815236/src/github.com/aws/aws-cdk/node_modules/@nx/devkit/node_modules/nx, /codebuild/output/src3225815236/src/github.com/aws/aws-cdk/node_modules/lerna/node_modules/nx: Command failed.
Exit code: 135
Command: node ./bin/post-install
Arguments: 
Directory: /codebuild/output/src3225815236/src/github.com/aws/aws-cdk/node_modules/@lerna/create/node_modules/nx
Output:
Bus error (core dumped)
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Seems issue with yarn/nx

duranbe avatar Jun 15 '24 21:06 duranbe

This build failure can't possibly have anything to do with this change... I'll retrigger it.

TheRealAmazonKendra avatar Jun 21 '24 21:06 TheRealAmazonKendra

@Mergifyio update

TheRealAmazonKendra avatar Jun 21 '24 21:06 TheRealAmazonKendra

update

✅ Branch has been successfully updated

mergify[bot] avatar Jun 21 '24 21:06 mergify[bot]

For fixes, the title should describe the bug, not the solution. Could you please update it?

TheRealAmazonKendra avatar Jun 21 '24 21:06 TheRealAmazonKendra

Hey Kendra, thanks for the review and restarting the build

For fixes, the title should describe the bug, not the solution. Could you please update it?

Done ! Is it better with this ?

fix(iam): incorrect input for AccountPrincipal is building successfully

duranbe avatar Jun 24 '24 15:06 duranbe

Seems this PR is breaking lots of existing test ... I'll look into it, if it's too complex or there is actual use case where the an AWS ID is not 12 digits (which should not be the case ?) I'll close it.

duranbe avatar Jun 29 '24 10:06 duranbe

Had to refactor/fix in bunch of test files but now they use proper mock AWS Accound id 🙌

duranbe avatar Jul 01 '24 20:07 duranbe

Bump !

duranbe avatar Jul 09 '24 08:07 duranbe

Test updated :)

duranbe avatar Jul 10 '24 20:07 duranbe

Good on my side :) 👍

duranbe avatar Jul 11 '24 09:07 duranbe

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

aws-cdk-automation avatar Jul 14 '24 00:07 aws-cdk-automation

@TheRealAmazonKendra can you take a quick look ? PR seems big (🥲) but 99% is just updating existing test

duranbe avatar Jul 17 '24 18:07 duranbe

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

aws-cdk-automation avatar Aug 19 '24 00:08 aws-cdk-automation

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

aws-cdk-automation avatar Aug 25 '24 00:08 aws-cdk-automation

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: eb7276b17123ff5320104a2421916e7c6ba56c5b
  • Result: FAILED
  • Build Logs (available for 30 days)

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

aws-cdk-automation avatar Aug 25 '24 18:08 aws-cdk-automation

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

aws-cdk-automation avatar Sep 01 '24 00:09 aws-cdk-automation

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

aws-cdk-automation avatar Sep 02 '24 00:09 aws-cdk-automation

Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one.

github-actions[bot] avatar Sep 04 '24 19:09 github-actions[bot]