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

CodePipeline onStateChange for Actions generates wrong detail-type #3614

Closed
1 task done
PeterBengtson opened this issue Aug 11, 2019 · 0 comments · Fixed by #5721
Closed
1 task done

CodePipeline onStateChange for Actions generates wrong detail-type #3614

PeterBengtson opened this issue Aug 11, 2019 · 0 comments · Fixed by #5721
Assignees
Labels
@aws-cdk/aws-codepipeline Related to AWS CodePipeline bug This issue is a bug. in-progress This issue is being actively worked on. p1

Comments

@PeterBengtson
Copy link

PeterBengtson commented Aug 11, 2019

  • I'm submitting a ...

    • 🪲 bug report
  • What is the current behavior?

Create a CodePipeline with stages and actions. Set up on_state_change handlers for all three levels, like this (code is in Python, but I believe the situation is the same for all supported languages):

        my_pipeline.on_state_change(
            'MyPipelineStateChanges',
            target=events_targets.SnsTopic(internal_sns_topic)
        )

        my_stage.on_state_change(
            'MyStageStateChanges',
            target=events_targets.SnsTopic(internal_sns_topic)
        )

        my_action.on_state_change(
            'MyActionStateChanges',
            target=events_targets.SnsTopic(internal_sns_topic)
        )

This will set up three CloudWatch Event Rules.

  • What is the expected behavior (or behavior of feature suggested)?

The three Event Rules should have different detail-type fields:

  • The Pipeline rule should have "CodePipeline Pipeline Execution State Change"
  • The Stage rule should have "CodePipeline Stage Execution State Change"
  • The Action rule should have "CodePipeline Action Execution State Change"

However, the Action rule gets "CodePipeline Stage Execution State Change" and thus never will trigger, given that there also are conditions for the action's action name to match. This means that it's impossible to define on_state_change events for pipeline Actions in AWS-CDK 1.3.0.

@PeterBengtson PeterBengtson added the needs-triage This issue or PR still needs to be triaged. label Aug 11, 2019
@eladb eladb added bug This issue is a bug. @aws-cdk/aws-codepipeline Related to AWS CodePipeline and removed needs-triage This issue or PR still needs to be triaged. labels Aug 12, 2019
@skinny85 skinny85 added the p0 label Aug 12, 2019
@skinny85 skinny85 added p1 and removed p0 labels Oct 31, 2019
@SomayaB SomayaB added the in-progress This issue is being actively worked on. label Jan 8, 2020
skinny85 added a commit to skinny85/aws-cdk that referenced this issue Jan 8, 2020
The method onStateChange() in Action,
the common superclass for all CDK-vended actions,
incorrectly set the `detailType` of the CloudWatch event rule it created to
'CodePipeline Stage Execution State Change',
when it should be 'CodePipeline Action Execution State Change'.

Fixes aws#3614
@mergify mergify bot closed this as completed in #5721 Jan 9, 2020
mergify bot added a commit that referenced this issue Jan 9, 2020
The method onStateChange() in Action,
the common superclass for all CDK-vended actions,
incorrectly set the `detailType` of the CloudWatch event rule it created to
'CodePipeline Stage Execution State Change',
when it should be 'CodePipeline Action Execution State Change'.

Fixes #3614

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-codepipeline Related to AWS CodePipeline bug This issue is a bug. in-progress This issue is being actively worked on. p1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants