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

fix(codepipeline): S3 source Action with trigger=Events fails for bucketKey a Token #9575

Merged
merged 2 commits into from
Aug 13, 2020

Conversation

skinny85
Copy link
Contributor

We use bucketKey to differentiate between multiple source actions
that observe the same bucket using trigger=Events.
However, we can't do that if bucketKey is a lazy value,
as Tokens can't be used as parts of identifier for the created Event.
So, check for that case explicitly.

Fixes #9554


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

@skinny85 skinny85 requested a review from rix0rrr August 10, 2020 22:28
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Aug 10, 2020
// however, if bucketKey is not a Token,
// we want it to differentiate between multiple actions
// observing the same Bucket with different keys
(Token.isUnresolved(this.props.bucketKey) ? '' : this.props.bucketKey);
Copy link
Contributor

Choose a reason for hiding this comment

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

Using an empty string here is good enough for now, but I can already taste the next bug report coming in: "hey it doesn't work if I use 2 S3 source triggers based off of tokens"

@rix0rrr rix0rrr added the pr/do-not-merge This PR should not be merged at this time. label Aug 11, 2020
Copy link
Contributor

@rix0rrr rix0rrr left a comment

Choose a reason for hiding this comment

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

I'd prefer you handle the case of multiple tokens as well but up to you.

@skinny85 skinny85 force-pushed the fix/s3-pipeline-action-bucket-key-token branch from ab30f96 to f793244 Compare August 12, 2020 02:31
@skinny85 skinny85 requested a review from rix0rrr August 12, 2020 02:31
@skinny85
Copy link
Contributor Author

I'd prefer you handle the case of multiple tokens as well but up to you.

@rix0rrr done! Let me know how you like it.

…ketKey a Token

We use bucketKey to differentiate between multiple source actions
that observe the same bucket using trigger=Events.
However, we can't do that if bucketKey is a lazy value,
as Tokens can't be used as parts of identifier for the created Event.
So, check for that case explicitly.

Fixes aws#9554
@skinny85 skinny85 force-pushed the fix/s3-pipeline-action-bucket-key-token branch from f793244 to 50d8411 Compare August 12, 2020 21:09
@skinny85
Copy link
Contributor Author

Resolved conflicts related to #9637 . @rix0rrr this is still waiting for your review!

@skinny85 skinny85 removed the pr/do-not-merge This PR should not be merged at this time. label Aug 13, 2020
@mergify
Copy link
Contributor

mergify bot commented Aug 13, 2020

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

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: bd8fe38
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@mergify
Copy link
Contributor

mergify bot commented Aug 13, 2020

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

@mergify mergify bot merged commit 43214b4 into aws:master Aug 13, 2020
@skinny85 skinny85 deleted the fix/s3-pipeline-action-bucket-key-token branch August 13, 2020 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[aws-codepipeline-actions] Not able to use EVENTS based S3 trigger when bucketKey contains a CDK token
3 participants