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

feat(codepipeline-action): add support for externalEntityLink in the manual approval action #5558

Merged
merged 9 commits into from
Jan 8, 2020

Conversation

michaelbrewer
Copy link
Contributor

Fixes issue #5557


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

@mergify
Copy link
Contributor

mergify bot commented Dec 26, 2019

Title does not follow the guidelines of Conventional Commits. Please adjust title before merge.

@michaelbrewer michaelbrewer changed the title Add support for externalEntityLink in the manual approval action feat(codepipeline-action): add support for externalEntityLink in the manual approval action Dec 26, 2019
@michaelbrewer michaelbrewer marked this pull request as ready for review December 26, 2019 16:57
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

Copy link
Contributor

@skinny85 skinny85 left a 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.

packages/@aws-cdk/aws-codepipeline-actions/package.json Outdated Show resolved Hide resolved
@@ -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://'.
Copy link
Contributor

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?

Copy link
Contributor Author

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?

Copy link
Contributor Author

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://'");
      }
    }

Copy link
Contributor

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!

Copy link
Contributor Author

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-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

Copy link
Contributor

@skinny85 skinny85 left a 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!

Copy link
Contributor Author

@michaelbrewer michaelbrewer left a 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://'.
Copy link
Contributor Author

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.

@mergify mergify bot dismissed skinny85’s stale review January 8, 2020 19:50

Pull request has been modified.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@skinny85
Copy link
Contributor

skinny85 commented Jan 8, 2020

@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.

Sorry, by "APL", do you mean the CodePipeline API?

@michaelbrewer
Copy link
Contributor Author

CodePipeline API?

Yes, i tried sending through a url without https:// or http:// and the Codepipeline API allowed for it.

@skinny85
Copy link
Contributor

skinny85 commented Jan 8, 2020

Thanks @michaelbrewer !

@skinny85 skinny85 merged commit be2e3e3 into aws:master Jan 8, 2020
@michaelbrewer michaelbrewer deleted the michaelbrewer/feature-5557 branch January 15, 2020 00:55
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