-
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(codepipeline-action): add support for externalEntityLink in the manual approval action #5558
Conversation
Title does not follow the guidelines of Conventional Commits. Please adjust title before merge. |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
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.
Thanks for the contribution @michaelbrewer ! 2 simple comments from me.
@@ -24,6 +24,11 @@ export interface ManualApprovalActionProps extends codepipeline.CommonAwsActionP | |||
* Any additional information that you want to include in the notification email message. | |||
*/ | |||
readonly additionalInformation?: string; | |||
|
|||
/** | |||
* URL you want to provide to the reviewer as part of the approval request. The URL must begin with 'http://' or 'https://'. |
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.
Is that condition ("must begin with 'http://' or 'https://'") checked by the CodePipeline API? Should we add some validation on our side that errors out if that is not the case?
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.
@skinny85
I am not sure, i know that the AWS console does this kind of validation. Are there some common examples of this kind of validation in CDK?
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.
@skinny85 - Would something like this work?
if (this.props.externalEntityLink) {
const pattern = /^((http|https):\/\/)/;
if (!pattern.test(this.props.externalEntityLink)) {
throw Error("'externalEntityLink' - The URL must begin with 'http://' or 'https://'");
}
}
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.
Yep, that could work :) (+ a unit test for this behavior, of course 😃). However, I'd rather not add this validation unless the CodePipeline API performs it as well (I don't think we should disallows things that the API accepts). Can you verify whether the CodePipeline API fails if you provide something that does not start with 'http://' or 'https://'? 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.
@skinny85 - APL does allow for urls without http:// or https://, so i updated the docs to reflect this.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
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.
@michaelbrewer any updates on that server-side validation?
I'm requesting changes so that this is removed from my To-Do list, let me know, and I'll get back to it!
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.
@michaelbrewer any updates on that server-side validation?
I'm requesting changes so that this is removed from my To-Do list, let me know, and I'll get back to it!
APL does allow for urls without http:// or https://, so i updated the docs to reflect this.
@@ -24,6 +24,11 @@ export interface ManualApprovalActionProps extends codepipeline.CommonAwsActionP | |||
* Any additional information that you want to include in the notification email message. | |||
*/ | |||
readonly additionalInformation?: string; | |||
|
|||
/** | |||
* URL you want to provide to the reviewer as part of the approval request. The URL must begin with 'http://' or 'https://'. |
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.
@skinny85 - APL does allow for urls without http:// or https://, so i updated the docs to reflect this.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Sorry, by "APL", do you mean the CodePipeline API? |
Yes, i tried sending through a url without https:// or http:// and the Codepipeline API allowed for it. |
Thanks @michaelbrewer ! |
Fixes issue #5557
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license