[cdk-pipelines] Every asset update mutates the pipeline
See original GitHub issueThe UpdatePipepline
stage fails although the SelfMutate
action has completed successfully and causes the pipeline to start over again. This leads to the pipeline getting caught in an infinite loop.
Reproduction Steps
I have a CDK app with a PipelineStack
containing a CdkPipeline
(with two Cdk.Stages
). I committed my CDK code to git, and then run cdk deploy PipelineStack --profile ...
(all environments were bootstrapped before).
Error Log
After creating the pipeline, the first pipeline execution is being triggered by a CreatePipeline
event. Source
and Build
stage succeed, the SelfMutate
action succeeds, but the UpdatePipeline
stage fails. The next execution gets triggered by a StartPipelineExecution
event (probably triggered by the pipeline itself?).
I don’t know where to find more detailed error messages of what causes the stage to fail. Please point me to the releavnt locations and I will provide more information.
Environment
- CLI Version : 1.51.0 (build 8c2d53c)
- Framework Version: 1.51.0 (build 8c2d53c)
- Node.js Version: v12.18.0
- OS : aws/codebuild/standard:4.0
- Language (Version): TypeScript (3.9.5)
Other
Other users have reported the same issue on Gitter, but no resolution has been provided so far.
This is 🐛 Bug Report
Issue Analytics
- State:
- Created 3 years ago
- Reactions:13
- Comments:19 (12 by maintainers)
Top GitHub Comments
If we only use the path to calculate the hash, the asset won’t be invalidated when it changes and will never be updated.
As I mentioned, I think we need to figure out a way to avoid pipeline updates when assets are changed and the way to do that would probably be to define publishing actions that are not coupled directly with the asset hash but rather with the number of assets in the app. If a new asset is added, the pipeline will be updated (another publish action is needed) but if assets are only updated, the pipeline won’t need to change because we will already have a publishing action for each asset, and only the ones that changes will actually upload data (the rest will succeed with no-op).
Alright. I plan to change that, but it is what it is for now