Skip to content

Commit

Permalink
fix(pipelines): generates warning since CDK 2.128.0 due to addition o…
Browse files Browse the repository at this point in the history
…f 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*
  • Loading branch information
gossandr authored Feb 21, 2024
1 parent a7f6b2d commit eca1bcf
Show file tree
Hide file tree
Showing 167 changed files with 876 additions and 798 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,14 @@
"Pipeline9850B417": {
"Type": "AWS::CodePipeline::Pipeline",
"Properties": {
"ArtifactStore": {
"Location": {
"Ref": "PipelineArtifactsBucketAEA9A052"
},
"Type": "S3"
},
"PipelineType": "V1",
"RestartExecutionOnUpdate": true,
"RoleArn": {
"Fn::GetAtt": [
"PipelineRoleB27FAA37",
Expand Down Expand Up @@ -1834,14 +1842,7 @@
],
"Name": "Wave2"
}
],
"ArtifactStore": {
"Location": {
"Ref": "PipelineArtifactsBucketAEA9A052"
},
"Type": "S3"
},
"RestartExecutionOnUpdate": true
]
},
"DependsOn": [
"PipelineRoleDefaultPolicy7BDC1ABB",
Expand All @@ -1861,12 +1862,12 @@
"MatchEquals": "refs/heads/{Branch}"
}
],
"RegisterWithThirdParty": true,
"TargetAction": "colifran_cdk-pipelines-demo",
"TargetPipeline": {
"Ref": "Pipeline9850B417"
},
"TargetPipelineVersion": 1,
"RegisterWithThirdParty": true
"TargetPipelineVersion": 1
}
},
"PipelineBuildSynthCdkBuildProjectRole231EEA2A": {
Expand Down Expand Up @@ -2101,28 +2102,18 @@
"Artifacts": {
"Type": "CODEPIPELINE"
},
"Cache": {
"Type": "NO_CACHE"
},
"Description": "Pipeline step PipelineStack/Pipeline/Build/Synth",
"EncryptionKey": "alias/aws/s3",
"Environment": {
"ComputeType": "BUILD_GENERAL1_SMALL",
"Image": "aws/codebuild/standard:7.0",
"ImagePullCredentialsType": "CODEBUILD",
"PrivilegedMode": false,
"Type": "LINUX_CONTAINER"
},
"ServiceRole": {
"Fn::GetAtt": [
"PipelineBuildSynthCdkBuildProjectRole231EEA2A",
"Arn"
]
},
"Source": {
"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}",
"Type": "CODEPIPELINE"
},
"Cache": {
"Type": "NO_CACHE"
},
"Description": "Pipeline step PipelineStack/Pipeline/Build/Synth",
"EncryptionKey": "alias/aws/s3",
"LogsConfig": {
"CloudWatchLogs": {
"GroupName": "log-group-name",
Expand All @@ -2132,6 +2123,16 @@
"Location": "bucket-name",
"Status": "ENABLED"
}
},
"ServiceRole": {
"Fn::GetAtt": [
"PipelineBuildSynthCdkBuildProjectRole231EEA2A",
"Arn"
]
},
"Source": {
"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}",
"Type": "CODEPIPELINE"
}
}
},
Expand Down Expand Up @@ -2453,28 +2454,18 @@
"Artifacts": {
"Type": "CODEPIPELINE"
},
"Cache": {
"Type": "NO_CACHE"
},
"Description": "Pipeline step PipelineStack/Pipeline/UpdatePipeline/SelfMutate",
"EncryptionKey": "alias/aws/s3",
"Environment": {
"ComputeType": "BUILD_GENERAL1_SMALL",
"Image": "aws/codebuild/standard:7.0",
"ImagePullCredentialsType": "CODEBUILD",
"PrivilegedMode": false,
"Type": "LINUX_CONTAINER"
},
"ServiceRole": {
"Fn::GetAtt": [
"PipelineUpdatePipelineSelfMutationRole57E559E8",
"Arn"
]
},
"Source": {
"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}",
"Type": "CODEPIPELINE"
},
"Cache": {
"Type": "NO_CACHE"
},
"Description": "Pipeline step PipelineStack/Pipeline/UpdatePipeline/SelfMutate",
"EncryptionKey": "alias/aws/s3",
"LogsConfig": {
"CloudWatchLogs": {
"GroupName": "log-group-name",
Expand All @@ -2484,6 +2475,16 @@
"Location": "bucket-name",
"Status": "ENABLED"
}
},
"ServiceRole": {
"Fn::GetAtt": [
"PipelineUpdatePipelineSelfMutationRole57E559E8",
"Arn"
]
},
"Source": {
"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}",
"Type": "CODEPIPELINE"
}
}
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit eca1bcf

Please sign in to comment.