-
Notifications
You must be signed in to change notification settings - Fork 4k
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
feat(aws-codepipeline-actions): Add Full Clone support for CodeCommit #12558
feat(aws-codepipeline-actions): Add Full Clone support for CodeCommit #12558
Conversation
…on using an input artifact with CodeCommitCloneRepositoryArn metadata present
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great @DaWyz , thanks so much for the contribution! Couple of minor comments below 😊.
@@ -8,6 +8,7 @@ import { Action } from '../action'; | |||
// keep this import separate from other imports to reduce chance for merge conflicts with v2-main | |||
// eslint-disable-next-line no-duplicate-imports, import/order | |||
import { Construct } from '@aws-cdk/core'; | |||
import { CodeCommitSourceAction } from '../codecommit/source-action'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be moved up, just below the import { BitBucketSourceAction } from '..';
line.
@@ -155,11 +180,23 @@ export class CodeCommitSourceAction extends Action { | |||
], | |||
})); | |||
|
|||
if (this.props.codeBuildCloneOutput === true) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you actually fold this statement into the above one, considering their Resource is the same? Something like this:
actions: [
'codecommit:GetBranch',
'codecommit:GetCommit',
'codecommit:UploadArchive',
'codecommit:GetUploadArchiveStatus',
'codecommit:CancelUploadArchive',
...this.props.codeBuildCloneOutput ? ['codecommit:GetRepository'] : [],
],
}, | ||
{}, | ||
{}, | ||
{}, | ||
{}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you use the helpers we have like objectLike()
and arrayWith()
, you can avoid these empty objects. Here's an example of using them:
expect(supportStack).toHaveResourceLike('AWS::S3::BucketPolicy', { | |
PolicyDocument: { | |
Statement: arrayWith(objectLike({ | |
Action: arrayWith('s3:GetObject*', 's3:GetBucket*', 's3:List*'), | |
Principal: { | |
AWS: { | |
'Fn::Join': ['', [ | |
'arn:', | |
{ Ref: 'AWS::Partition' }, | |
stringLike('*-deploy-role-*'), | |
]], | |
}, | |
}, | |
})), | |
}, | |
}); |
{}, | ||
{}, | ||
{}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment here as above.
Also, please update the ReadMe file of the package! |
Pull request has been modified.
@skinny85 PR updated. Please, double check the section added in the Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is absolutely fantastic work @DaWyz . Thanks so much for the contribution!
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
…aws#12558) Add `codeBuildCloneOutput` property to the CodeCommit source action. It automatically adds the `codecommit:GetRepository` permission to the CodeCommitSourceAction role. It will also add the `codecommit:GitPull` permission to any CodeBuildAction using the artifact from CodeCommitSourceAction as input. Closes aws#12236 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Add
codeBuildCloneOutput
property to the CodeCommit source action.It automatically adds the
codecommit:GetRepository
permission to the CodeCommitSourceAction role.It will also add the
codecommit:GitPull
permission to any CodeBuildAction using the artifact from CodeCommitSourceAction as input.Closes #12236
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license