Skip to content

Commit

Permalink
feat(aws-codepipeline, aws-codecommit, aws-s3): change the convention…
Browse files Browse the repository at this point in the history
… 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.
  • Loading branch information
skinny85 authored Sep 21, 2018
1 parent 0b28886 commit 9c3ce7f
Show file tree
Hide file tree
Showing 21 changed files with 51 additions and 51 deletions.
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-codebuild/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const pipeline = new codepipeline.Pipeline(this, 'MyPipeline');
const sourceStage = new codepipeline.Stage(this, 'Source', {
pipeline,
});
const sourceAction = new codecommit.PipelineSource(this, 'CodeCommit', {
const sourceAction = new codecommit.PipelineSourceAction(this, 'CodeCommit', {
stage: sourceStage,
artifactName: 'SourceOutput',
repository,
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-codebuild/lib/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export abstract class ProjectRef extends cdk.Construct implements events.IEventR
* @param stage the Pipeline Stage to add the new Action to
* @param name the name of the newly created Action
* @param props the properties of the new Action
* @returns the newly created {@link PipelineSource} Action
* @returns the newly created {@link PipelineBuildAction} build Action
*/
public addBuildToPipeline(stage: codepipeline.IStage, name: string, props: CommonPipelineBuildActionProps): PipelineBuildAction {
return new PipelineBuildAction(this.parent!, name, {
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-codecommit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const pipeline = new codepipeline.Pipeline(this, 'MyPipeline', {
const sourceStage = new codepipeline.Stage(this, 'Source', {
pipeline,
}));
const sourceAction = new codecommit.PipelineSource(this, 'CodeCommit', {
const sourceAction = new codecommit.PipelineSourceAction(this, 'CodeCommit', {
stage: sourceStage,
artifactName: 'SourceOutput', // name can be arbitrary
repository,
Expand Down
12 changes: 6 additions & 6 deletions packages/@aws-cdk/aws-codecommit/lib/pipeline-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import cdk = require('@aws-cdk/cdk');
import { RepositoryRef } from './repository';

/**
* Common properties for creating {@link PipelineSource} -
* Common properties for creating {@link PipelineSourceAction} -
* either directly, through its constructor,
* or through {@link RepositoryRef#addToPipeline}.
*/
export interface CommonPipelineSourceProps {
export interface CommonPipelineSourceActionProps {
/**
* The name of the source's output artifact.
* Output artifacts are used by CodePipeline as inputs into other actions.
Expand All @@ -29,9 +29,9 @@ export interface CommonPipelineSourceProps {
}

/**
* Construction properties of the {@link PipelineSource CodeCommit source CodePipeline Action}.
* Construction properties of the {@link PipelineSourceAction CodeCommit source CodePipeline Action}.
*/
export interface PipelineSourceProps extends CommonPipelineSourceProps, codepipeline.CommonActionProps {
export interface PipelineSourceActionProps extends CommonPipelineSourceActionProps, codepipeline.CommonActionProps {
/**
* The CodeCommit repository.
*/
Expand All @@ -41,8 +41,8 @@ export interface PipelineSourceProps extends CommonPipelineSourceProps, codepipe
/**
* CodePipeline Source that is provided by an AWS CodeCommit repository.
*/
export class PipelineSource extends codepipeline.SourceAction {
constructor(parent: cdk.Construct, name: string, props: PipelineSourceProps) {
export class PipelineSourceAction extends codepipeline.SourceAction {
constructor(parent: cdk.Construct, name: string, props: PipelineSourceActionProps) {
super(parent, name, {
stage: props.stage,
provider: 'CodeCommit',
Expand Down
10 changes: 5 additions & 5 deletions packages/@aws-cdk/aws-codecommit/lib/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import actions = require('@aws-cdk/aws-codepipeline-api');
import events = require('@aws-cdk/aws-events');
import cdk = require('@aws-cdk/cdk');
import { cloudformation } from './codecommit.generated';
import { CommonPipelineSourceProps, PipelineSource } from './pipeline-action';
import { CommonPipelineSourceActionProps, PipelineSourceAction } from './pipeline-action';

/**
* Properties for the {@link RepositoryRef.import} method.
Expand Down Expand Up @@ -56,16 +56,16 @@ export abstract class RepositoryRef extends cdk.Construct {
}

/**
* Convenience method for creating a new {@link PipelineSource} Action,
* Convenience method for creating a new {@link PipelineSourceAction},
* and adding it to the given Stage.
*
* @param stage the Pipeline Stage to add the new Action to
* @param name the name of the newly created Action
* @param props the properties of the new Action
* @returns the newly created {@link PipelineSource} Action
* @returns the newly created {@link PipelineSourceAction}
*/
public addToPipeline(stage: actions.IStage, name: string, props: CommonPipelineSourceProps): PipelineSource {
return new PipelineSource(this.parent!, name, {
public addToPipeline(stage: actions.IStage, name: string, props: CommonPipelineSourceActionProps): PipelineSourceAction {
return new PipelineSourceAction(this.parent!, name, {
stage,
repository: this,
...props,
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-codepipeline-api/lib/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export interface ActionProps extends CommonActionProps {

/**
* Low-level class for generic CodePipeline Actions.
* It is recommended that concrete types are used instead, such as {@link codecommit.PipelineSource} or
* It is recommended that concrete types are used instead, such as {@link codecommit.PipelineSourceAction} or
* {@link codebuild.PipelineBuildAction}.
*/
export abstract class Action extends cdk.Construct {
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-codepipeline-api/lib/source-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ export interface SourceActionProps extends CommonActionProps {
/**
* Low-level class for source actions.
* It is recommended that concrete types are used instead,
* such as {@link s3.PipelineSource} or
* {@link codecommit.PipelineSource}.
* such as {@link s3.PipelineSourceAction} or
* {@link codecommit.PipelineSourceAction}.
*/
export abstract class SourceAction extends Action {
public readonly artifact: Artifact;
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-codepipeline/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const sourceStage = pipeline.addStage('Source', {
Add an Action to a Stage:

```ts
new codecommit.PipelineSource(this, 'Source', {
new codecommit.PipelineSourceAction(this, 'Source', {
stage: sourceStage,
artifactName: 'MyPackageSourceArtifact',
repository: codecommit.RepositoryRef.import(this, 'MyExistingRepository', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import actions = require('@aws-cdk/aws-codepipeline-api');
import cdk = require('@aws-cdk/cdk');

/**
* Construction properties of the {@link GitHubSource GitHub source action}.
* Construction properties of the {@link GitHubSourceAction GitHub source action}.
*/
export interface GitHubSourceProps extends actions.CommonActionProps {
export interface GitHubSourceActionProps extends actions.CommonActionProps {
/**
* The name of the source's output artifact. Output artifacts are used by CodePipeline as
* inputs into other actions.
Expand Down Expand Up @@ -51,8 +51,8 @@ export interface GitHubSourceProps extends actions.CommonActionProps {
/**
* Source that is provided by a GitHub repository.
*/
export class GitHubSource extends actions.SourceAction {
constructor(parent: cdk.Construct, name: string, props: GitHubSourceProps) {
export class GitHubSourceAction extends actions.SourceAction {
constructor(parent: cdk.Construct, name: string, props: GitHubSourceActionProps) {
super(parent, name, {
stage: props.stage,
owner: 'ThirdParty',
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-codepipeline/lib/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export interface PipelineProps {
* const sourceStage = new Stage(pipeline, 'Source');
*
* // add a source action to the stage
* new codecommit.PipelineSource(sourceStage, 'Source', {
* new codecommit.PipelineSourceAction(sourceStage, 'Source', {
* artifactName: 'SourceArtifact',
* repository: repo,
* });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const repo = new codecommit.Repository(stack, 'TemplateRepo', {
repositoryName: 'template-repo'
});
const sourceStage = new codepipeline.Stage(pipeline, 'Source', { pipeline });
const source = new codecommit.PipelineSource(stack, 'Source', {
const source = new codecommit.PipelineSourceAction(stack, 'Source', {
stage: sourceStage,
repository: repo,
artifactName: 'SourceArtifact',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const sourceStage = new codepipeline.Stage(pipeline, 'Source', { pipeline });
const bucket = new s3.Bucket(stack, 'PipelineBucket', {
versioned: true,
});
new s3.PipelineSource(stack, 'Source', {
new s3.PipelineSourceAction(stack, 'Source', {
stage: sourceStage,
artifactName: 'SourceArtifact',
bucket,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const sourceStage = new codepipeline.Stage(pipeline, 'Source', { pipeline });
const bucket = new s3.Bucket(stack, 'PipelineBucket', {
versioned: true,
});
const source = new s3.PipelineSource(stack, 'Source', {
const source = new s3.PipelineSourceAction(stack, 'Source', {
stage: sourceStage,
artifactName: 'SourceArtifact',
bucket,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const repository = new codecommit.Repository(stack, 'MyRepo', {
const pipeline = new codepipeline.Pipeline(stack, 'Pipeline');

const sourceStage = new codepipeline.Stage(pipeline, 'source', { pipeline });
const source = new codecommit.PipelineSource(stack, 'source', {
const source = new codecommit.PipelineSourceAction(stack, 'source', {
stage: sourceStage,
artifactName: 'SourceArtifact',
repository,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const repository = new codecommit.Repository(stack, 'CodeCommitRepo', {
});
const project = new codebuild.PipelineProject(stack, 'BuildProject');

const sourceAction = new codecommit.PipelineSource(pipeline, 'CodeCommitSource', {
const sourceAction = new codecommit.PipelineSourceAction(pipeline, 'CodeCommitSource', {
stage: sourceStage,
artifactName: 'Source',
repository,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect, haveResource } from '@aws-cdk/assert';
import { CreateReplaceChangeSet, CreateUpdateStack, ExecuteChangeSet } from '@aws-cdk/aws-cloudformation';
import { CodePipelineBuildArtifacts, CodePipelineSource, PipelineBuildAction, Project } from '@aws-cdk/aws-codebuild';
import { PipelineSource, Repository } from '@aws-cdk/aws-codecommit';
import { PipelineSourceAction, Repository } from '@aws-cdk/aws-codecommit';
import { ArtifactPath } from '@aws-cdk/aws-codepipeline-api';
import { Role } from '@aws-cdk/aws-iam';
import cdk = require('@aws-cdk/cdk');
Expand All @@ -26,7 +26,7 @@ export = {

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

const source = new PipelineSource(stack, 'source', {
const source = new PipelineSourceAction(stack, 'source', {
stage: sourceStage,
artifactName: 'SourceArtifact',
repository: repo,
Expand Down Expand Up @@ -360,7 +360,7 @@ class TestFixture extends cdk.Stack {
public readonly sourceStage: Stage;
public readonly deployStage: Stage;
public readonly repo: Repository;
public readonly source: PipelineSource;
public readonly source: PipelineSourceAction;

constructor() {
super();
Expand All @@ -369,7 +369,7 @@ class TestFixture extends cdk.Stack {
this.sourceStage = new Stage(this.pipeline, 'Source', { pipeline: this.pipeline });
this.deployStage = new Stage(this.pipeline, 'Deploy', { pipeline: this.pipeline });
this.repo = new Repository(this, 'MyVeryImportantRepo', { repositoryName: 'my-very-important-repo' });
this.source = new PipelineSource(this, 'Source', {
this.source = new PipelineSourceAction(this, 'Source', {
stage: this.sourceStage,
artifactName: 'SourceArtifact',
repository: this.repo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ export = {
const secondStage = new Stage(stack, 'SecondStage', { pipeline });

const bucket = new s3.Bucket(stack, 'PipelineBucket');
new s3.PipelineSource(stack, 'FirstAction', {
new s3.PipelineSourceAction(stack, 'FirstAction', {
stage: firstStage,
artifactName: 'FirstArtifact',
bucket,
bucketKey: 'key',
});
new s3.PipelineSource(stack, 'SecondAction', {
new s3.PipelineSourceAction(stack, 'SecondAction', {
stage: secondStage,
artifactName: 'SecondAction',
bucket,
Expand Down
10 changes: 5 additions & 5 deletions packages/@aws-cdk/aws-codepipeline/test/test.pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export = {

const pipeline = new codepipeline.Pipeline(stack, 'Pipeline');
const sourceStage = new codepipeline.Stage(pipeline, 'source', { pipeline });
const source = new codecommit.PipelineSource(stack, 'source', {
const source = new codecommit.PipelineSourceAction(stack, 'source', {
stage: sourceStage,
artifactName: 'SourceArtifact',
repository,
Expand Down Expand Up @@ -49,7 +49,7 @@ export = {
const p = new codepipeline.Pipeline(stack, 'P');

const s1 = new codepipeline.Stage(stack, 'Source', { pipeline: p });
new codepipeline.GitHubSource(stack, 'GH', {
new codepipeline.GitHubSourceAction(stack, 'GH', {
stage: s1,
artifactName: 'A',
branch: 'branch',
Expand Down Expand Up @@ -137,7 +137,7 @@ export = {
const pipeline = new codepipeline.Pipeline(stack, 'PL');

const stage1 = new codepipeline.Stage(stack, 'S1', { pipeline });
new s3.PipelineSource(stack, 'A1', {
new s3.PipelineSourceAction(stack, 'A1', {
stage: stage1,
artifactName: 'Artifact',
bucket: new s3.Bucket(stack, 'Bucket'),
Expand Down Expand Up @@ -340,7 +340,7 @@ export = {
'does not poll for changes'(test: Test) {
const stack = new cdk.Stack();

const result = new codecommit.PipelineSource(stack, 'stage', {
const result = new codecommit.PipelineSourceAction(stack, 'stage', {
stage: stageForTesting(stack),
artifactName: 'SomeArtifact',
repository: repositoryForTesting(stack),
Expand All @@ -353,7 +353,7 @@ export = {
'polls for changes'(test: Test) {
const stack = new cdk.Stack();

const result = new codecommit.PipelineSource(stack, 'stage', {
const result = new codecommit.PipelineSourceAction(stack, 'stage', {
stage: stageForTesting(stack),
artifactName: 'SomeArtifact',
repository: repositoryForTesting(stack),
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-s3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const pipeline = new codepipeline.Pipeline(this, 'MyPipeline');
const sourceStage = new codepipeline.Stage(this, 'Source', {
pipeline,
});
const sourceAction = new s3.PipelineSource(this, 'S3Source', {
const sourceAction = new s3.PipelineSourceAction(this, 'S3Source', {
stage: sourceStage,
bucket: sourceBucket,
bucketKey: 'path/to/file.zip',
Expand Down
10 changes: 5 additions & 5 deletions packages/@aws-cdk/aws-s3/lib/bucket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import cdk = require('@aws-cdk/cdk');
import { BucketPolicy } from './bucket-policy';
import { BucketNotifications } from './notifications-resource';
import perms = require('./perms');
import { CommonPipelineSourceProps, PipelineSource } from './pipeline-action';
import { CommonPipelineSourceActionProps, PipelineSourceAction } from './pipeline-action';
import { LifecycleRule } from './rule';
import { cloudformation } from './s3.generated';
import { parseBucketArn, parseBucketName } from './util';
Expand Down Expand Up @@ -102,16 +102,16 @@ export abstract class BucketRef extends cdk.Construct {
}

/**
* Convenience method for creating a new {@link PipelineSource} Action,
* Convenience method for creating a new {@link PipelineSourceAction},
* and adding it to the given Stage.
*
* @param stage the Pipeline Stage to add the new Action to
* @param name the name of the newly created Action
* @param props the properties of the new Action
* @returns the newly created {@link PipelineSource} Action
* @returns the newly created {@link PipelineSourceAction}
*/
public addToPipeline(stage: actions.IStage, name: string, props: CommonPipelineSourceProps): PipelineSource {
return new PipelineSource(this.parent!, name, {
public addToPipeline(stage: actions.IStage, name: string, props: CommonPipelineSourceActionProps): PipelineSourceAction {
return new PipelineSourceAction(this.parent!, name, {
stage,
bucket: this,
...props,
Expand Down
12 changes: 6 additions & 6 deletions packages/@aws-cdk/aws-s3/lib/pipeline-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import cdk = require('@aws-cdk/cdk');
import { BucketRef } from './bucket';

/**
* Common properties for creating {@link PipelineSource} -
* Common properties for creating {@link PipelineSourceAction} -
* either directly, through its constructor,
* or through {@link BucketRef#addToPipeline}.
*/
export interface CommonPipelineSourceProps {
export interface CommonPipelineSourceActionProps {
/**
* The name of the source's output artifact. Output artifacts are used by CodePipeline as
* inputs into other actions.
Expand All @@ -31,9 +31,9 @@ export interface CommonPipelineSourceProps {
}

/**
* Construction properties of the {@link PipelineSource S3 source Action}.
* Construction properties of the {@link PipelineSourceAction S3 source Action}.
*/
export interface PipelineSourceProps extends CommonPipelineSourceProps, actions.CommonActionProps {
export interface PipelineSourceActionProps extends CommonPipelineSourceActionProps, actions.CommonActionProps {
/**
* The Amazon S3 bucket that stores the source code
*/
Expand All @@ -43,8 +43,8 @@ export interface PipelineSourceProps extends CommonPipelineSourceProps, actions.
/**
* Source that is provided by a specific Amazon S3 object.
*/
export class PipelineSource extends actions.SourceAction {
constructor(parent: cdk.Construct, name: string, props: PipelineSourceProps) {
export class PipelineSourceAction extends actions.SourceAction {
constructor(parent: cdk.Construct, name: string, props: PipelineSourceActionProps) {
super(parent, name, {
stage: props.stage,
provider: 'S3',
Expand Down

0 comments on commit 9c3ce7f

Please sign in to comment.