Skip to content

Commit eca1bcf

Browse files
authored
fix(pipelines): generates warning since CDK 2.128.0 due to addition of v2 pipeline support in aws-codepipeline (#29199)
### Issue # (if applicable) Closes #29190 ### Reason for this change CDK v2.128.0 introduced a warning in aws-codepipeline to warn users of the implicit behavior now that v2 pipelines are supported in CDK. This warning can cause established pipelines to fail if they are using cdk synth --strict. The warning can be suppressed, but the better fix is to have this module supply the `PipelineType` added in CDK v128.0 and set it to `v1`. A future change would have to address adding v2 pipeline support to this module, this only resolves the introduced warning. ### Description of changes - added the optional (and new) `PipelineType` property in the creation of the codepipeline in https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/pipelines/lib/codepipeline/codepipeline.ts#L467-L480 - slightly modified the README where it mentions using aws-codepipeline to include specifically an mention of v2 as a reason to use aws-codepipeline (until of course v2 is added properly in this lib) ### Description of how you validated changes - reverted a change in 40ffe2b as I believe this previously caught the new warning and was changed to fix the test rather than looking into the new warning. This would catch the warning if `PipelineType` is not supplied ### Checklist - [ x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent a7f6b2d commit eca1bcf

File tree

167 files changed

+876
-798
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+876
-798
lines changed

packages/@aws-cdk-testing/framework-integ/test/pipelines/test/integ.newpipeline-with-codebuild-logging.js.snapshot/PipelineStack.assets.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/pipelines/test/integ.newpipeline-with-codebuild-logging.js.snapshot/PipelineStack.template.json

+41-40
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,14 @@
232232
"Pipeline9850B417": {
233233
"Type": "AWS::CodePipeline::Pipeline",
234234
"Properties": {
235+
"ArtifactStore": {
236+
"Location": {
237+
"Ref": "PipelineArtifactsBucketAEA9A052"
238+
},
239+
"Type": "S3"
240+
},
241+
"PipelineType": "V1",
242+
"RestartExecutionOnUpdate": true,
235243
"RoleArn": {
236244
"Fn::GetAtt": [
237245
"PipelineRoleB27FAA37",
@@ -1834,14 +1842,7 @@
18341842
],
18351843
"Name": "Wave2"
18361844
}
1837-
],
1838-
"ArtifactStore": {
1839-
"Location": {
1840-
"Ref": "PipelineArtifactsBucketAEA9A052"
1841-
},
1842-
"Type": "S3"
1843-
},
1844-
"RestartExecutionOnUpdate": true
1845+
]
18451846
},
18461847
"DependsOn": [
18471848
"PipelineRoleDefaultPolicy7BDC1ABB",
@@ -1861,12 +1862,12 @@
18611862
"MatchEquals": "refs/heads/{Branch}"
18621863
}
18631864
],
1865+
"RegisterWithThirdParty": true,
18641866
"TargetAction": "colifran_cdk-pipelines-demo",
18651867
"TargetPipeline": {
18661868
"Ref": "Pipeline9850B417"
18671869
},
1868-
"TargetPipelineVersion": 1,
1869-
"RegisterWithThirdParty": true
1870+
"TargetPipelineVersion": 1
18701871
}
18711872
},
18721873
"PipelineBuildSynthCdkBuildProjectRole231EEA2A": {
@@ -2101,28 +2102,18 @@
21012102
"Artifacts": {
21022103
"Type": "CODEPIPELINE"
21032104
},
2105+
"Cache": {
2106+
"Type": "NO_CACHE"
2107+
},
2108+
"Description": "Pipeline step PipelineStack/Pipeline/Build/Synth",
2109+
"EncryptionKey": "alias/aws/s3",
21042110
"Environment": {
21052111
"ComputeType": "BUILD_GENERAL1_SMALL",
21062112
"Image": "aws/codebuild/standard:7.0",
21072113
"ImagePullCredentialsType": "CODEBUILD",
21082114
"PrivilegedMode": false,
21092115
"Type": "LINUX_CONTAINER"
21102116
},
2111-
"ServiceRole": {
2112-
"Fn::GetAtt": [
2113-
"PipelineBuildSynthCdkBuildProjectRole231EEA2A",
2114-
"Arn"
2115-
]
2116-
},
2117-
"Source": {
2118-
"BuildSpec": "{\n \"version\": \"0.2\",\n \"phases\": {\n \"build\": {\n \"commands\": [\n \"npm ci\",\n \"npm run build\",\n \"npx cdk synth\"\n ]\n }\n },\n \"artifacts\": {\n \"base-directory\": \"cdk.out\",\n \"files\": \"**/*\"\n }\n}",
2119-
"Type": "CODEPIPELINE"
2120-
},
2121-
"Cache": {
2122-
"Type": "NO_CACHE"
2123-
},
2124-
"Description": "Pipeline step PipelineStack/Pipeline/Build/Synth",
2125-
"EncryptionKey": "alias/aws/s3",
21262117
"LogsConfig": {
21272118
"CloudWatchLogs": {
21282119
"GroupName": "log-group-name",
@@ -2132,6 +2123,16 @@
21322123
"Location": "bucket-name",
21332124
"Status": "ENABLED"
21342125
}
2126+
},
2127+
"ServiceRole": {
2128+
"Fn::GetAtt": [
2129+
"PipelineBuildSynthCdkBuildProjectRole231EEA2A",
2130+
"Arn"
2131+
]
2132+
},
2133+
"Source": {
2134+
"BuildSpec": "{\n \"version\": \"0.2\",\n \"phases\": {\n \"build\": {\n \"commands\": [\n \"npm ci\",\n \"npm run build\",\n \"npx cdk synth\"\n ]\n }\n },\n \"artifacts\": {\n \"base-directory\": \"cdk.out\",\n \"files\": \"**/*\"\n }\n}",
2135+
"Type": "CODEPIPELINE"
21352136
}
21362137
}
21372138
},
@@ -2453,28 +2454,18 @@
24532454
"Artifacts": {
24542455
"Type": "CODEPIPELINE"
24552456
},
2457+
"Cache": {
2458+
"Type": "NO_CACHE"
2459+
},
2460+
"Description": "Pipeline step PipelineStack/Pipeline/UpdatePipeline/SelfMutate",
2461+
"EncryptionKey": "alias/aws/s3",
24562462
"Environment": {
24572463
"ComputeType": "BUILD_GENERAL1_SMALL",
24582464
"Image": "aws/codebuild/standard:7.0",
24592465
"ImagePullCredentialsType": "CODEBUILD",
24602466
"PrivilegedMode": false,
24612467
"Type": "LINUX_CONTAINER"
24622468
},
2463-
"ServiceRole": {
2464-
"Fn::GetAtt": [
2465-
"PipelineUpdatePipelineSelfMutationRole57E559E8",
2466-
"Arn"
2467-
]
2468-
},
2469-
"Source": {
2470-
"BuildSpec": "{\n \"version\": \"0.2\",\n \"phases\": {\n \"install\": {\n \"commands\": [\n \"npm install -g aws-cdk@2\"\n ]\n },\n \"build\": {\n \"commands\": [\n \"cdk -a . deploy PipelineStack --require-approval=never --verbose\"\n ]\n }\n }\n}",
2471-
"Type": "CODEPIPELINE"
2472-
},
2473-
"Cache": {
2474-
"Type": "NO_CACHE"
2475-
},
2476-
"Description": "Pipeline step PipelineStack/Pipeline/UpdatePipeline/SelfMutate",
2477-
"EncryptionKey": "alias/aws/s3",
24782469
"LogsConfig": {
24792470
"CloudWatchLogs": {
24802471
"GroupName": "log-group-name",
@@ -2484,6 +2475,16 @@
24842475
"Location": "bucket-name",
24852476
"Status": "ENABLED"
24862477
}
2478+
},
2479+
"ServiceRole": {
2480+
"Fn::GetAtt": [
2481+
"PipelineUpdatePipelineSelfMutationRole57E559E8",
2482+
"Arn"
2483+
]
2484+
},
2485+
"Source": {
2486+
"BuildSpec": "{\n \"version\": \"0.2\",\n \"phases\": {\n \"install\": {\n \"commands\": [\n \"npm install -g aws-cdk@2\"\n ]\n },\n \"build\": {\n \"commands\": [\n \"cdk -a . deploy PipelineStack --require-approval=never --verbose\"\n ]\n }\n }\n}",
2487+
"Type": "CODEPIPELINE"
24872488
}
24882489
}
24892490
}

packages/@aws-cdk-testing/framework-integ/test/pipelines/test/integ.newpipeline-with-codebuild-logging.js.snapshot/PipelineWithCustomStepStackOutputTestDefaultTestDeployAssert6C17E8C5.assets.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/pipelines/test/integ.newpipeline-with-codebuild-logging.js.snapshot/assembly-PipelineStack-Beta/PipelineStackBetaStack1E6541489.assets.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/pipelines/test/integ.newpipeline-with-codebuild-logging.js.snapshot/assembly-PipelineStack-Beta/PipelineStackBetaStack2C79AD00A.assets.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/pipelines/test/integ.newpipeline-with-codebuild-logging.js.snapshot/assembly-PipelineStack-Beta/cdk.out

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/pipelines/test/integ.newpipeline-with-codebuild-logging.js.snapshot/assembly-PipelineStack-Beta/manifest.json

+3-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/pipelines/test/integ.newpipeline-with-codebuild-logging.js.snapshot/assembly-PipelineStack-Prod1/PipelineStackProd1Stack14013D698.assets.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/pipelines/test/integ.newpipeline-with-codebuild-logging.js.snapshot/assembly-PipelineStack-Prod1/PipelineStackProd1Stack2F0681AFF.assets.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/pipelines/test/integ.newpipeline-with-codebuild-logging.js.snapshot/assembly-PipelineStack-Prod1/cdk.out

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/pipelines/test/integ.newpipeline-with-codebuild-logging.js.snapshot/assembly-PipelineStack-Prod1/manifest.json

+3-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/pipelines/test/integ.newpipeline-with-codebuild-logging.js.snapshot/assembly-PipelineStack-Prod2/PipelineStackProd2Stack1FD464162.assets.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/pipelines/test/integ.newpipeline-with-codebuild-logging.js.snapshot/assembly-PipelineStack-Prod2/PipelineStackProd2Stack2176123EB.assets.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/pipelines/test/integ.newpipeline-with-codebuild-logging.js.snapshot/assembly-PipelineStack-Prod2/cdk.out

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/pipelines/test/integ.newpipeline-with-codebuild-logging.js.snapshot/assembly-PipelineStack-Prod2/manifest.json

+3-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/pipelines/test/integ.newpipeline-with-codebuild-logging.js.snapshot/assembly-PipelineStack-Prod3/PipelineStackProd3Stack1795F3D43.assets.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/pipelines/test/integ.newpipeline-with-codebuild-logging.js.snapshot/assembly-PipelineStack-Prod3/PipelineStackProd3Stack2DFBBA0B2.assets.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/pipelines/test/integ.newpipeline-with-codebuild-logging.js.snapshot/assembly-PipelineStack-Prod3/cdk.out

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/pipelines/test/integ.newpipeline-with-codebuild-logging.js.snapshot/assembly-PipelineStack-Prod3/manifest.json

+3-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/pipelines/test/integ.newpipeline-with-codebuild-logging.js.snapshot/assembly-PipelineStack-Prod4/PipelineStackProd4Stack118F74ADB.assets.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/pipelines/test/integ.newpipeline-with-codebuild-logging.js.snapshot/assembly-PipelineStack-Prod4/PipelineStackProd4Stack2E2CB4ED3.assets.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/pipelines/test/integ.newpipeline-with-codebuild-logging.js.snapshot/assembly-PipelineStack-Prod4/cdk.out

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/pipelines/test/integ.newpipeline-with-codebuild-logging.js.snapshot/assembly-PipelineStack-Prod4/manifest.json

+3-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/pipelines/test/integ.newpipeline-with-codebuild-logging.js.snapshot/assembly-PipelineStack-Prod5/PipelineStackProd5Stack1E7E4E4C6.assets.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/pipelines/test/integ.newpipeline-with-codebuild-logging.js.snapshot/assembly-PipelineStack-Prod5/PipelineStackProd5Stack2C39BEE5B.assets.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)