Skip to content

Commit

Permalink
feat(codepipeline): change default pipeline type to V2 (under feature…
Browse files Browse the repository at this point in the history
… flag) (#29096)

### Reason for this change

We discussed about the default pipeline type, it was concluded that the new type (V2) should be the default.

#28538 (comment)

https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-codepipeline/lib/pipeline.ts#L492

### Description of changes

Change the default value using a feature flag so as not to affect existing processing.

### Description of how you validated changes

Bot unit and integ tests

### 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
go-to-k authored Mar 12, 2024
1 parent a1fbd51 commit e85231c
Show file tree
Hide file tree
Showing 63 changed files with 2,284 additions and 63 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ def handler(event, context):
print('This is my dummy validator')
`;

const app = new App();
const app = new App({
postCliContext: {
'@aws-cdk/aws-codepipeline:defaultPipelineTypeToV2': false,
},
});

const stack = new Stack(app, 'aws-appconfig-configuration');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ export class StackSetPipelineStack extends Stack {
}
}

const app = new App();
const app = new App({
postCliContext: {
'@aws-cdk/aws-codepipeline:defaultPipelineTypeToV2': false,
},
});
const stack = new StackSetPipelineStack(app, 'StackSetPipelineStack');
new IntegTest(app, 'StackSetPipelineStackInteg', {
testCases: [stack],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import * as codepipeline from 'aws-cdk-lib/aws-codepipeline';
import * as cdk from 'aws-cdk-lib';
import * as cpactions from 'aws-cdk-lib/aws-codepipeline-actions';

const app = new cdk.App();
const app = new cdk.App({
postCliContext: {
'@aws-cdk/aws-codepipeline:defaultPipelineTypeToV2': false,
},
});
const stack = new cdk.Stack(app, 'aws-cdk-codepipeline-cloudformation');

/// !show
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ import * as cdk from 'aws-cdk-lib';
import * as codepipeline_actions from 'aws-cdk-lib/aws-codepipeline-actions';
import { STANDARD_NODEJS_RUNTIME } from '../../config';

const app = new cdk.App();
const app = new cdk.App({
postCliContext: {
'@aws-cdk/aws-codepipeline:defaultPipelineTypeToV2': false,
},
});

/// !show
const lambdaStack = new cdk.Stack(app, 'LambdaStack');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ import * as cdk from 'aws-cdk-lib';
import * as cpactions from 'aws-cdk-lib/aws-codepipeline-actions';
import { STANDARD_NODEJS_RUNTIME } from '../../config';

const app = new cdk.App();
const app = new cdk.App({
postCliContext: {
'@aws-cdk/aws-codepipeline:defaultPipelineTypeToV2': false,
},
});

const stack = new cdk.Stack(app, 'aws-cdk-codepipeline-lambda');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ import * as s3 from 'aws-cdk-lib/aws-s3';
import { App, RemovalPolicy, SecretValue, Stack } from 'aws-cdk-lib';
import * as cpactions from 'aws-cdk-lib/aws-codepipeline-actions';

const app = new App();

const app = new App({
postCliContext: {
'@aws-cdk/aws-codepipeline:defaultPipelineTypeToV2': false,
},
});
const stack = new Stack(app, 'aws-cdk-codepipeline-alexa-deploy');

const bucket = new s3.Bucket(stack, 'PipelineBucket', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import * as s3 from 'aws-cdk-lib/aws-s3';
import * as cdk from 'aws-cdk-lib';
import * as cpactions from 'aws-cdk-lib/aws-codepipeline-actions';

const app = new cdk.App();
const app = new cdk.App({
postCliContext: {
'@aws-cdk/aws-codepipeline:defaultPipelineTypeToV2': false,
},
});

const region = 'us-west-2'; // hardcode the region
const stack = new cdk.Stack(app, 'aws-cdk-codepipeline-cloudformation-cross-region', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ import * as s3 from 'aws-cdk-lib/aws-s3';
import * as cdk from 'aws-cdk-lib';
import * as cpactions from 'aws-cdk-lib/aws-codepipeline-actions';

const app = new cdk.App();
const app = new cdk.App({
postCliContext: {
'@aws-cdk/aws-codepipeline:defaultPipelineTypeToV2': false,
},
});

const stack = new cdk.Stack(app, 'aws-cdk-codepipeline-cloudformation-cross-region-with-action-role', {});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ import * as s3 from 'aws-cdk-lib/aws-s3';
import * as cdk from 'aws-cdk-lib';
import * as cpactions from 'aws-cdk-lib/aws-codepipeline-actions';

const app = new cdk.App();
const app = new cdk.App({
postCliContext: {
'@aws-cdk/aws-codepipeline:defaultPipelineTypeToV2': false,
},
});

const stack = new cdk.Stack(app, 'aws-cdk-codepipeline-cloudformation');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ import * as s3 from 'aws-cdk-lib/aws-s3';
import * as cdk from 'aws-cdk-lib';
import * as cpactions from 'aws-cdk-lib/aws-codepipeline-actions';

const app = new cdk.App();
const app = new cdk.App({
postCliContext: {
'@aws-cdk/aws-codepipeline:defaultPipelineTypeToV2': false,
},
});

const stack = new cdk.Stack(app, 'aws-cdk-codepipeline-codebuild-batch');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ import * as s3 from 'aws-cdk-lib/aws-s3';
import * as cdk from 'aws-cdk-lib';
import * as cpactions from 'aws-cdk-lib/aws-codepipeline-actions';

const app = new cdk.App();
const app = new cdk.App({
postCliContext: {
'@aws-cdk/aws-codepipeline:defaultPipelineTypeToV2': false,
},
});

const stack = new cdk.Stack(app, 'aws-cdk-codepipeline-codebuild-multiple-inputs-outputs');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ import * as cpactions from 'aws-cdk-lib/aws-codepipeline-actions';

/* eslint-disable quote-props */

const app = new cdk.App();
const app = new cdk.App({
postCliContext: {
'@aws-cdk/aws-codepipeline:defaultPipelineTypeToV2': false,
},
});

const stack = new cdk.Stack(app, 'aws-cdk-codepipeline-codecommit-codebuild');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@ import * as codecommit from 'aws-cdk-lib/aws-codecommit';
import * as codepipeline from 'aws-cdk-lib/aws-codepipeline';
import * as cdk from 'aws-cdk-lib';
import * as cpactions from 'aws-cdk-lib/aws-codepipeline-actions';
import { CODECOMMIT_SOURCE_ACTION_DEFAULT_BRANCH_NAME } from 'aws-cdk-lib/cx-api';
import { CODECOMMIT_SOURCE_ACTION_DEFAULT_BRANCH_NAME, CODEPIPELINE_DEFAULT_PIPELINE_TYPE_TO_V2 } from 'aws-cdk-lib/cx-api';
import { ExpectedResult, IntegTest } from '@aws-cdk/integ-tests-alpha';
import { LambdaFunction } from 'aws-cdk-lib/aws-events-targets';
import { Code, Runtime, Function } from 'aws-cdk-lib/aws-lambda';
import { PolicyStatement } from 'aws-cdk-lib/aws-iam';
import * as path from 'path';

const defaultBranchFeatureFlag = { [CODECOMMIT_SOURCE_ACTION_DEFAULT_BRANCH_NAME]: true };
const app = new cdk.App({ postCliContext: defaultBranchFeatureFlag });
const defaultFeatureFlag = {
[CODECOMMIT_SOURCE_ACTION_DEFAULT_BRANCH_NAME]: true,
[CODEPIPELINE_DEFAULT_PIPELINE_TYPE_TO_V2]: false,
};
const app = new cdk.App({ postCliContext: defaultFeatureFlag });

const stack = new cdk.Stack(app, 'aws-cdk-codepipeline-codecommit-custom-event');
const branch = 'test-branch';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ import * as codecommit from 'aws-cdk-lib/aws-codecommit';
import * as codepipeline from 'aws-cdk-lib/aws-codepipeline';
import * as cdk from 'aws-cdk-lib';
import * as cpactions from 'aws-cdk-lib/aws-codepipeline-actions';
import { CODECOMMIT_SOURCE_ACTION_DEFAULT_BRANCH_NAME } from 'aws-cdk-lib/cx-api';
import { CODECOMMIT_SOURCE_ACTION_DEFAULT_BRANCH_NAME, CODEPIPELINE_DEFAULT_PIPELINE_TYPE_TO_V2 } from 'aws-cdk-lib/cx-api';
import { IntegTest } from '@aws-cdk/integ-tests-alpha';

const defaultBranchFeatureFlag = { [CODECOMMIT_SOURCE_ACTION_DEFAULT_BRANCH_NAME]: true };
const app = new cdk.App({ postCliContext: defaultBranchFeatureFlag });
const defaultFeatureFlag = {
[CODECOMMIT_SOURCE_ACTION_DEFAULT_BRANCH_NAME]: true,
[CODEPIPELINE_DEFAULT_PIPELINE_TYPE_TO_V2]: false,
};
const app = new cdk.App({ postCliContext: defaultFeatureFlag });

const stack = new cdk.Stack(app, 'aws-cdk-codepipeline-codecommit-main');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ import * as codecommit from 'aws-cdk-lib/aws-codecommit';
import * as codepipeline from 'aws-cdk-lib/aws-codepipeline';
import * as cdk from 'aws-cdk-lib';
import * as cpactions from 'aws-cdk-lib/aws-codepipeline-actions';
import { CODECOMMIT_SOURCE_ACTION_DEFAULT_BRANCH_NAME } from 'aws-cdk-lib/cx-api';
import { CODECOMMIT_SOURCE_ACTION_DEFAULT_BRANCH_NAME, CODEPIPELINE_DEFAULT_PIPELINE_TYPE_TO_V2 } from 'aws-cdk-lib/cx-api';

const defaultBranchFeatureFlag = { [CODECOMMIT_SOURCE_ACTION_DEFAULT_BRANCH_NAME]: false };
const app = new cdk.App({
postCliContext: defaultBranchFeatureFlag,
});
const defaultFeatureFlag = {
[CODECOMMIT_SOURCE_ACTION_DEFAULT_BRANCH_NAME]: false,
[CODEPIPELINE_DEFAULT_PIPELINE_TYPE_TO_V2]: false,
};
const app = new cdk.App({ postCliContext: defaultFeatureFlag });

const stack = new cdk.Stack(app, 'aws-cdk-codepipeline-codecommit');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ import * as s3 from 'aws-cdk-lib/aws-s3';
import * as cdk from 'aws-cdk-lib';
import * as cpactions from 'aws-cdk-lib/aws-codepipeline-actions';

const app = new cdk.App();
const app = new cdk.App({
postCliContext: {
'@aws-cdk/aws-codepipeline:defaultPipelineTypeToV2': false,
},
});

const stack = new cdk.Stack(app, 'aws-cdk-codepipeline-codedeploy-ecs');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ import * as s3 from 'aws-cdk-lib/aws-s3';
import * as cdk from 'aws-cdk-lib';
import * as cpactions from 'aws-cdk-lib/aws-codepipeline-actions';

const app = new cdk.App();
const app = new cdk.App({
postCliContext: {
'@aws-cdk/aws-codepipeline:defaultPipelineTypeToV2': false,
},
});

const stack = new cdk.Stack(app, 'aws-cdk-codepipeline-codedeploy');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ import * as cpactions from 'aws-cdk-lib/aws-codepipeline-actions';
* was triggered successfully.
*/

const app = new cdk.App();
const app = new cdk.App({
postCliContext: {
'@aws-cdk/aws-codepipeline:defaultPipelineTypeToV2': false,
},
});

const stack = new cdk.Stack(app, 'aws-cdk-codepipeline-ecr-source');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ import * as cpactions from 'aws-cdk-lib/aws-codepipeline-actions';

/* eslint-disable quote-props */

const app = new cdk.App();
const app = new cdk.App({
postCliContext: {
'@aws-cdk/aws-codepipeline:defaultPipelineTypeToV2': false,
},
});

const stack = new cdk.Stack(app, 'aws-cdk-codepipeline-ecs-deploy');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ import * as cpactions from 'aws-cdk-lib/aws-codepipeline-actions';
* 5. Manually delete the 'aws-cdk-codepipeline-elastic-beanstalk-deploy' stack
*/

const app = new App();
const app = new App({
postCliContext: {
'@aws-cdk/aws-codepipeline:defaultPipelineTypeToV2': false,
},
});

const stack = new Stack(app, 'aws-cdk-codepipeline-elastic-beanstalk-deploy');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ import * as sns from 'aws-cdk-lib/aws-sns';
import * as cdk from 'aws-cdk-lib';
import * as cpactions from 'aws-cdk-lib/aws-codepipeline-actions';

const app = new cdk.App();
const app = new cdk.App({
postCliContext: {
'@aws-cdk/aws-codepipeline:defaultPipelineTypeToV2': false,
},
});

const stack = new cdk.Stack(app, 'aws-cdk-pipeline-event-target');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import * as s3 from 'aws-cdk-lib/aws-s3';
import * as cdk from 'aws-cdk-lib';
import * as cpactions from 'aws-cdk-lib/aws-codepipeline-actions';

const app = new cdk.App();
const app = new cdk.App({
postCliContext: {
'@aws-cdk/aws-codepipeline:defaultPipelineTypeToV2': false,
},
});

const stack = new cdk.Stack(app, 'aws-cdk-codepipeline-jenkins');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import * as s3 from 'aws-cdk-lib/aws-s3';
import * as cdk from 'aws-cdk-lib';
import * as cpactions from 'aws-cdk-lib/aws-codepipeline-actions';

const app = new cdk.App();
const app = new cdk.App({
postCliContext: {
'@aws-cdk/aws-codepipeline:defaultPipelineTypeToV2': false,
},
});

const stack = new cdk.Stack(app, 'aws-cdk-codepipeline-manual-approval');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ import { Duration } from 'aws-cdk-lib';
import { IntegTest, ExpectedResult, Match } from '@aws-cdk/integ-tests-alpha';
import * as cpactions from 'aws-cdk-lib/aws-codepipeline-actions';

const app = new cdk.App();
const app = new cdk.App({
postCliContext: {
'@aws-cdk/aws-codepipeline:defaultPipelineTypeToV2': false,
},
});

const stack = new cdk.Stack(app, 'aws-cdk-codepipeline-s3-deploy');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ import * as stepfunctions from 'aws-cdk-lib/aws-stepfunctions';
import * as cdk from 'aws-cdk-lib';
import * as cpactions from 'aws-cdk-lib/aws-codepipeline-actions';

const app = new cdk.App();
const app = new cdk.App({
postCliContext: {
'@aws-cdk/aws-codepipeline:defaultPipelineTypeToV2': false,
},
});

const stack = new cdk.Stack(app, 'aws-cdk-codepipeline-stepfunctions');

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.

Loading

0 comments on commit e85231c

Please sign in to comment.