Skip to content

Commit 9c3ce7f

Browse files
authored
feat(aws-codepipeline, aws-codecommit, aws-s3): change the convention for naming the source Actions to XxxSourceAction. (#753)
BREAKING CHANGE: change the names of the source Actions from XxxSource to XxxSourceAction. This is to align them with the other Actions, like Build. Also, CodeBuild has the concept of Sources, so it makes sense to strongly differentiate between the two.
1 parent 0b28886 commit 9c3ce7f

21 files changed

+51
-51
lines changed

packages/@aws-cdk/aws-codebuild/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const pipeline = new codepipeline.Pipeline(this, 'MyPipeline');
5353
const sourceStage = new codepipeline.Stage(this, 'Source', {
5454
pipeline,
5555
});
56-
const sourceAction = new codecommit.PipelineSource(this, 'CodeCommit', {
56+
const sourceAction = new codecommit.PipelineSourceAction(this, 'CodeCommit', {
5757
stage: sourceStage,
5858
artifactName: 'SourceOutput',
5959
repository,

packages/@aws-cdk/aws-codebuild/lib/project.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export abstract class ProjectRef extends cdk.Construct implements events.IEventR
8787
* @param stage the Pipeline Stage to add the new Action to
8888
* @param name the name of the newly created Action
8989
* @param props the properties of the new Action
90-
* @returns the newly created {@link PipelineSource} Action
90+
* @returns the newly created {@link PipelineBuildAction} build Action
9191
*/
9292
public addBuildToPipeline(stage: codepipeline.IStage, name: string, props: CommonPipelineBuildActionProps): PipelineBuildAction {
9393
return new PipelineBuildAction(this.parent!, name, {

packages/@aws-cdk/aws-codecommit/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const pipeline = new codepipeline.Pipeline(this, 'MyPipeline', {
4141
const sourceStage = new codepipeline.Stage(this, 'Source', {
4242
pipeline,
4343
}));
44-
const sourceAction = new codecommit.PipelineSource(this, 'CodeCommit', {
44+
const sourceAction = new codecommit.PipelineSourceAction(this, 'CodeCommit', {
4545
stage: sourceStage,
4646
artifactName: 'SourceOutput', // name can be arbitrary
4747
repository,

packages/@aws-cdk/aws-codecommit/lib/pipeline-action.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import cdk = require('@aws-cdk/cdk');
33
import { RepositoryRef } from './repository';
44

55
/**
6-
* Common properties for creating {@link PipelineSource} -
6+
* Common properties for creating {@link PipelineSourceAction} -
77
* either directly, through its constructor,
88
* or through {@link RepositoryRef#addToPipeline}.
99
*/
10-
export interface CommonPipelineSourceProps {
10+
export interface CommonPipelineSourceActionProps {
1111
/**
1212
* The name of the source's output artifact.
1313
* Output artifacts are used by CodePipeline as inputs into other actions.
@@ -29,9 +29,9 @@ export interface CommonPipelineSourceProps {
2929
}
3030

3131
/**
32-
* Construction properties of the {@link PipelineSource CodeCommit source CodePipeline Action}.
32+
* Construction properties of the {@link PipelineSourceAction CodeCommit source CodePipeline Action}.
3333
*/
34-
export interface PipelineSourceProps extends CommonPipelineSourceProps, codepipeline.CommonActionProps {
34+
export interface PipelineSourceActionProps extends CommonPipelineSourceActionProps, codepipeline.CommonActionProps {
3535
/**
3636
* The CodeCommit repository.
3737
*/
@@ -41,8 +41,8 @@ export interface PipelineSourceProps extends CommonPipelineSourceProps, codepipe
4141
/**
4242
* CodePipeline Source that is provided by an AWS CodeCommit repository.
4343
*/
44-
export class PipelineSource extends codepipeline.SourceAction {
45-
constructor(parent: cdk.Construct, name: string, props: PipelineSourceProps) {
44+
export class PipelineSourceAction extends codepipeline.SourceAction {
45+
constructor(parent: cdk.Construct, name: string, props: PipelineSourceActionProps) {
4646
super(parent, name, {
4747
stage: props.stage,
4848
provider: 'CodeCommit',

packages/@aws-cdk/aws-codecommit/lib/repository.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import actions = require('@aws-cdk/aws-codepipeline-api');
22
import events = require('@aws-cdk/aws-events');
33
import cdk = require('@aws-cdk/cdk');
44
import { cloudformation } from './codecommit.generated';
5-
import { CommonPipelineSourceProps, PipelineSource } from './pipeline-action';
5+
import { CommonPipelineSourceActionProps, PipelineSourceAction } from './pipeline-action';
66

77
/**
88
* Properties for the {@link RepositoryRef.import} method.
@@ -56,16 +56,16 @@ export abstract class RepositoryRef extends cdk.Construct {
5656
}
5757

5858
/**
59-
* Convenience method for creating a new {@link PipelineSource} Action,
59+
* Convenience method for creating a new {@link PipelineSourceAction},
6060
* and adding it to the given Stage.
6161
*
6262
* @param stage the Pipeline Stage to add the new Action to
6363
* @param name the name of the newly created Action
6464
* @param props the properties of the new Action
65-
* @returns the newly created {@link PipelineSource} Action
65+
* @returns the newly created {@link PipelineSourceAction}
6666
*/
67-
public addToPipeline(stage: actions.IStage, name: string, props: CommonPipelineSourceProps): PipelineSource {
68-
return new PipelineSource(this.parent!, name, {
67+
public addToPipeline(stage: actions.IStage, name: string, props: CommonPipelineSourceActionProps): PipelineSourceAction {
68+
return new PipelineSourceAction(this.parent!, name, {
6969
stage,
7070
repository: this,
7171
...props,

packages/@aws-cdk/aws-codepipeline-api/lib/action.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export interface ActionProps extends CommonActionProps {
9797

9898
/**
9999
* Low-level class for generic CodePipeline Actions.
100-
* It is recommended that concrete types are used instead, such as {@link codecommit.PipelineSource} or
100+
* It is recommended that concrete types are used instead, such as {@link codecommit.PipelineSourceAction} or
101101
* {@link codebuild.PipelineBuildAction}.
102102
*/
103103
export abstract class Action extends cdk.Construct {

packages/@aws-cdk/aws-codepipeline-api/lib/source-action.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ export interface SourceActionProps extends CommonActionProps {
4444
/**
4545
* Low-level class for source actions.
4646
* It is recommended that concrete types are used instead,
47-
* such as {@link s3.PipelineSource} or
48-
* {@link codecommit.PipelineSource}.
47+
* such as {@link s3.PipelineSourceAction} or
48+
* {@link codecommit.PipelineSourceAction}.
4949
*/
5050
export abstract class SourceAction extends Action {
5151
public readonly artifact: Artifact;

packages/@aws-cdk/aws-codepipeline/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const sourceStage = pipeline.addStage('Source', {
3434
Add an Action to a Stage:
3535

3636
```ts
37-
new codecommit.PipelineSource(this, 'Source', {
37+
new codecommit.PipelineSourceAction(this, 'Source', {
3838
stage: sourceStage,
3939
artifactName: 'MyPackageSourceArtifact',
4040
repository: codecommit.RepositoryRef.import(this, 'MyExistingRepository', {

packages/@aws-cdk/aws-codepipeline/lib/github-source-action.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import actions = require('@aws-cdk/aws-codepipeline-api');
22
import cdk = require('@aws-cdk/cdk');
33

44
/**
5-
* Construction properties of the {@link GitHubSource GitHub source action}.
5+
* Construction properties of the {@link GitHubSourceAction GitHub source action}.
66
*/
7-
export interface GitHubSourceProps extends actions.CommonActionProps {
7+
export interface GitHubSourceActionProps extends actions.CommonActionProps {
88
/**
99
* The name of the source's output artifact. Output artifacts are used by CodePipeline as
1010
* inputs into other actions.
@@ -51,8 +51,8 @@ export interface GitHubSourceProps extends actions.CommonActionProps {
5151
/**
5252
* Source that is provided by a GitHub repository.
5353
*/
54-
export class GitHubSource extends actions.SourceAction {
55-
constructor(parent: cdk.Construct, name: string, props: GitHubSourceProps) {
54+
export class GitHubSourceAction extends actions.SourceAction {
55+
constructor(parent: cdk.Construct, name: string, props: GitHubSourceActionProps) {
5656
super(parent, name, {
5757
stage: props.stage,
5858
owner: 'ThirdParty',

packages/@aws-cdk/aws-codepipeline/lib/pipeline.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export interface PipelineProps {
3737
* const sourceStage = new Stage(pipeline, 'Source');
3838
*
3939
* // add a source action to the stage
40-
* new codecommit.PipelineSource(sourceStage, 'Source', {
40+
* new codecommit.PipelineSourceAction(sourceStage, 'Source', {
4141
* artifactName: 'SourceArtifact',
4242
* repository: repo,
4343
* });

packages/@aws-cdk/aws-codepipeline/test/integ.cfn-template-from-repo.lit.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const repo = new codecommit.Repository(stack, 'TemplateRepo', {
1414
repositoryName: 'template-repo'
1515
});
1616
const sourceStage = new codepipeline.Stage(pipeline, 'Source', { pipeline });
17-
const source = new codecommit.PipelineSource(stack, 'Source', {
17+
const source = new codecommit.PipelineSourceAction(stack, 'Source', {
1818
stage: sourceStage,
1919
repository: repo,
2020
artifactName: 'SourceArtifact',

packages/@aws-cdk/aws-codepipeline/test/integ.lambda-pipeline.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const sourceStage = new codepipeline.Stage(pipeline, 'Source', { pipeline });
1313
const bucket = new s3.Bucket(stack, 'PipelineBucket', {
1414
versioned: true,
1515
});
16-
new s3.PipelineSource(stack, 'Source', {
16+
new s3.PipelineSourceAction(stack, 'Source', {
1717
stage: sourceStage,
1818
artifactName: 'SourceArtifact',
1919
bucket,

packages/@aws-cdk/aws-codepipeline/test/integ.pipeline-cfn.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const sourceStage = new codepipeline.Stage(pipeline, 'Source', { pipeline });
1616
const bucket = new s3.Bucket(stack, 'PipelineBucket', {
1717
versioned: true,
1818
});
19-
const source = new s3.PipelineSource(stack, 'Source', {
19+
const source = new s3.PipelineSourceAction(stack, 'Source', {
2020
stage: sourceStage,
2121
artifactName: 'SourceArtifact',
2222
bucket,

packages/@aws-cdk/aws-codepipeline/test/integ.pipeline-code-commit-build.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const repository = new codecommit.Repository(stack, 'MyRepo', {
1414
const pipeline = new codepipeline.Pipeline(stack, 'Pipeline');
1515

1616
const sourceStage = new codepipeline.Stage(pipeline, 'source', { pipeline });
17-
const source = new codecommit.PipelineSource(stack, 'source', {
17+
const source = new codecommit.PipelineSourceAction(stack, 'source', {
1818
stage: sourceStage,
1919
artifactName: 'SourceArtifact',
2020
repository,

packages/@aws-cdk/aws-codepipeline/test/integ.pipeline-events.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const repository = new codecommit.Repository(stack, 'CodeCommitRepo', {
1919
});
2020
const project = new codebuild.PipelineProject(stack, 'BuildProject');
2121

22-
const sourceAction = new codecommit.PipelineSource(pipeline, 'CodeCommitSource', {
22+
const sourceAction = new codecommit.PipelineSourceAction(pipeline, 'CodeCommitSource', {
2323
stage: sourceStage,
2424
artifactName: 'Source',
2525
repository,

packages/@aws-cdk/aws-codepipeline/test/test.cloudformation-pipeline-actions.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { expect, haveResource } from '@aws-cdk/assert';
22
import { CreateReplaceChangeSet, CreateUpdateStack, ExecuteChangeSet } from '@aws-cdk/aws-cloudformation';
33
import { CodePipelineBuildArtifacts, CodePipelineSource, PipelineBuildAction, Project } from '@aws-cdk/aws-codebuild';
4-
import { PipelineSource, Repository } from '@aws-cdk/aws-codecommit';
4+
import { PipelineSourceAction, Repository } from '@aws-cdk/aws-codecommit';
55
import { ArtifactPath } from '@aws-cdk/aws-codepipeline-api';
66
import { Role } from '@aws-cdk/aws-iam';
77
import cdk = require('@aws-cdk/cdk');
@@ -26,7 +26,7 @@ export = {
2626

2727
const sourceStage = new Stage(pipeline, 'source', { pipeline });
2828

29-
const source = new PipelineSource(stack, 'source', {
29+
const source = new PipelineSourceAction(stack, 'source', {
3030
stage: sourceStage,
3131
artifactName: 'SourceArtifact',
3232
repository: repo,
@@ -360,7 +360,7 @@ class TestFixture extends cdk.Stack {
360360
public readonly sourceStage: Stage;
361361
public readonly deployStage: Stage;
362362
public readonly repo: Repository;
363-
public readonly source: PipelineSource;
363+
public readonly source: PipelineSourceAction;
364364

365365
constructor() {
366366
super();
@@ -369,7 +369,7 @@ class TestFixture extends cdk.Stack {
369369
this.sourceStage = new Stage(this.pipeline, 'Source', { pipeline: this.pipeline });
370370
this.deployStage = new Stage(this.pipeline, 'Deploy', { pipeline: this.pipeline });
371371
this.repo = new Repository(this, 'MyVeryImportantRepo', { repositoryName: 'my-very-important-repo' });
372-
this.source = new PipelineSource(this, 'Source', {
372+
this.source = new PipelineSourceAction(this, 'Source', {
373373
stage: this.sourceStage,
374374
artifactName: 'SourceArtifact',
375375
repository: this.repo,

packages/@aws-cdk/aws-codepipeline/test/test.general-validation.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@ export = {
6060
const secondStage = new Stage(stack, 'SecondStage', { pipeline });
6161

6262
const bucket = new s3.Bucket(stack, 'PipelineBucket');
63-
new s3.PipelineSource(stack, 'FirstAction', {
63+
new s3.PipelineSourceAction(stack, 'FirstAction', {
6464
stage: firstStage,
6565
artifactName: 'FirstArtifact',
6666
bucket,
6767
bucketKey: 'key',
6868
});
69-
new s3.PipelineSource(stack, 'SecondAction', {
69+
new s3.PipelineSourceAction(stack, 'SecondAction', {
7070
stage: secondStage,
7171
artifactName: 'SecondAction',
7272
bucket,

packages/@aws-cdk/aws-codepipeline/test/test.pipeline.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export = {
2020

2121
const pipeline = new codepipeline.Pipeline(stack, 'Pipeline');
2222
const sourceStage = new codepipeline.Stage(pipeline, 'source', { pipeline });
23-
const source = new codecommit.PipelineSource(stack, 'source', {
23+
const source = new codecommit.PipelineSourceAction(stack, 'source', {
2424
stage: sourceStage,
2525
artifactName: 'SourceArtifact',
2626
repository,
@@ -49,7 +49,7 @@ export = {
4949
const p = new codepipeline.Pipeline(stack, 'P');
5050

5151
const s1 = new codepipeline.Stage(stack, 'Source', { pipeline: p });
52-
new codepipeline.GitHubSource(stack, 'GH', {
52+
new codepipeline.GitHubSourceAction(stack, 'GH', {
5353
stage: s1,
5454
artifactName: 'A',
5555
branch: 'branch',
@@ -137,7 +137,7 @@ export = {
137137
const pipeline = new codepipeline.Pipeline(stack, 'PL');
138138

139139
const stage1 = new codepipeline.Stage(stack, 'S1', { pipeline });
140-
new s3.PipelineSource(stack, 'A1', {
140+
new s3.PipelineSourceAction(stack, 'A1', {
141141
stage: stage1,
142142
artifactName: 'Artifact',
143143
bucket: new s3.Bucket(stack, 'Bucket'),
@@ -340,7 +340,7 @@ export = {
340340
'does not poll for changes'(test: Test) {
341341
const stack = new cdk.Stack();
342342

343-
const result = new codecommit.PipelineSource(stack, 'stage', {
343+
const result = new codecommit.PipelineSourceAction(stack, 'stage', {
344344
stage: stageForTesting(stack),
345345
artifactName: 'SomeArtifact',
346346
repository: repositoryForTesting(stack),
@@ -353,7 +353,7 @@ export = {
353353
'polls for changes'(test: Test) {
354354
const stack = new cdk.Stack();
355355

356-
const result = new codecommit.PipelineSource(stack, 'stage', {
356+
const result = new codecommit.PipelineSourceAction(stack, 'stage', {
357357
stage: stageForTesting(stack),
358358
artifactName: 'SomeArtifact',
359359
repository: repositoryForTesting(stack),

packages/@aws-cdk/aws-s3/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ const pipeline = new codepipeline.Pipeline(this, 'MyPipeline');
9090
const sourceStage = new codepipeline.Stage(this, 'Source', {
9191
pipeline,
9292
});
93-
const sourceAction = new s3.PipelineSource(this, 'S3Source', {
93+
const sourceAction = new s3.PipelineSourceAction(this, 'S3Source', {
9494
stage: sourceStage,
9595
bucket: sourceBucket,
9696
bucketKey: 'path/to/file.zip',

packages/@aws-cdk/aws-s3/lib/bucket.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import cdk = require('@aws-cdk/cdk');
66
import { BucketPolicy } from './bucket-policy';
77
import { BucketNotifications } from './notifications-resource';
88
import perms = require('./perms');
9-
import { CommonPipelineSourceProps, PipelineSource } from './pipeline-action';
9+
import { CommonPipelineSourceActionProps, PipelineSourceAction } from './pipeline-action';
1010
import { LifecycleRule } from './rule';
1111
import { cloudformation } from './s3.generated';
1212
import { parseBucketArn, parseBucketName } from './util';
@@ -102,16 +102,16 @@ export abstract class BucketRef extends cdk.Construct {
102102
}
103103

104104
/**
105-
* Convenience method for creating a new {@link PipelineSource} Action,
105+
* Convenience method for creating a new {@link PipelineSourceAction},
106106
* and adding it to the given Stage.
107107
*
108108
* @param stage the Pipeline Stage to add the new Action to
109109
* @param name the name of the newly created Action
110110
* @param props the properties of the new Action
111-
* @returns the newly created {@link PipelineSource} Action
111+
* @returns the newly created {@link PipelineSourceAction}
112112
*/
113-
public addToPipeline(stage: actions.IStage, name: string, props: CommonPipelineSourceProps): PipelineSource {
114-
return new PipelineSource(this.parent!, name, {
113+
public addToPipeline(stage: actions.IStage, name: string, props: CommonPipelineSourceActionProps): PipelineSourceAction {
114+
return new PipelineSourceAction(this.parent!, name, {
115115
stage,
116116
bucket: this,
117117
...props,

packages/@aws-cdk/aws-s3/lib/pipeline-action.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import cdk = require('@aws-cdk/cdk');
33
import { BucketRef } from './bucket';
44

55
/**
6-
* Common properties for creating {@link PipelineSource} -
6+
* Common properties for creating {@link PipelineSourceAction} -
77
* either directly, through its constructor,
88
* or through {@link BucketRef#addToPipeline}.
99
*/
10-
export interface CommonPipelineSourceProps {
10+
export interface CommonPipelineSourceActionProps {
1111
/**
1212
* The name of the source's output artifact. Output artifacts are used by CodePipeline as
1313
* inputs into other actions.
@@ -31,9 +31,9 @@ export interface CommonPipelineSourceProps {
3131
}
3232

3333
/**
34-
* Construction properties of the {@link PipelineSource S3 source Action}.
34+
* Construction properties of the {@link PipelineSourceAction S3 source Action}.
3535
*/
36-
export interface PipelineSourceProps extends CommonPipelineSourceProps, actions.CommonActionProps {
36+
export interface PipelineSourceActionProps extends CommonPipelineSourceActionProps, actions.CommonActionProps {
3737
/**
3838
* The Amazon S3 bucket that stores the source code
3939
*/
@@ -43,8 +43,8 @@ export interface PipelineSourceProps extends CommonPipelineSourceProps, actions.
4343
/**
4444
* Source that is provided by a specific Amazon S3 object.
4545
*/
46-
export class PipelineSource extends actions.SourceAction {
47-
constructor(parent: cdk.Construct, name: string, props: PipelineSourceProps) {
46+
export class PipelineSourceAction extends actions.SourceAction {
47+
constructor(parent: cdk.Construct, name: string, props: PipelineSourceActionProps) {
4848
super(parent, name, {
4949
stage: props.stage,
5050
provider: 'S3',

0 commit comments

Comments
 (0)