-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(codepipeline): change to stand-alone Artifacts #2338
feat(codepipeline): change to stand-alone Artifacts #2338
Conversation
4c60f74
to
39b87e9
Compare
@@ -305,7 +304,7 @@ class FakeAction extends codepipeline.Action { | |||
constructor(actionName: string) { | |||
super({ | |||
actionName, | |||
artifactBounds: codepipeline.defaultBounds(), | |||
artifactBounds: { minInputs: 0, maxInputs: 5, minOutputs: 0, maxOutputs: 5 }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did we get rid of the defaultBounds
helper?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It wasn't really useful, and I don't even think the name was accurate (having 0 to 5 inputs & outputs is definitely not a default for Actions).
packages/@aws-cdk/aws-codepipeline-actions/lib/codebuild/build-action.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-codepipeline-actions/lib/codebuild/build-action.ts
Outdated
Show resolved
Hide resolved
|
||
private _artifactName?: string; | ||
|
||
constructor(artifactName?: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess make this private
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't - it's used in Artifact
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?! It's used in the static method, no?
class Foo {
public static makeFoo(): Foo { return new Foo() ; }
private constructor() { }
}
Now only Foo.makeFoo
can be used to make foo and not new Foo()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, except the static method is not that simple in this case:
public static artifactPath(artifactName: string, fileName: string): ArtifactPath {
return new ArtifactPath(Artifact.artifact(artifactName), fileName);
}
So it's not simply equivalent to new ArtifactPath(artifact, fileName)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am taking about the ctor of Artifact
... I feel I am missing something... But nevermind, I don't really care
353ab4c
to
4a40736
Compare
Changes after review comments. |
This commit changes the way Artifacts are used in CodePipeline. Instead of being properties on the Actions, they are now stand-alone objects, created independently of the Actions, and referenced when instantiating them. This is to not force users to assign Actions to intermediate variables when defining a Pipeline. This change had a few interesting consequences: * We no longer needed the abstract subclasses of Action like SourceAction, DeployAction, etc., and so they were removed. * The old naming convention of `inputArtifacts` and `outputArtifactNames` was shortened to be simply `inputs` and `outputs`. * There was no longer any need to differentiate Build and Test Actions, and so the two CodeBuild and Jenkins Actions were merged into one. BREAKING CHANGE: CodePipeline Actions no longer have the `outputArtifact` and `outputArtifacts` properties. * `inputArtifact(s)` and `additionalInputArtifacts` properties were renamed to `input(s)` and `extraInputs`. * `outputArtifactName(s)` and `additionalOutputArtifactNames` properties were renamed to `output(s)` and `extraOutputs`. * The classes `CodeBuildBuildAction` and `CodeBuildTestAction` were merged into one class `CodeBuildAction`. * The classes `JenkinsBuildAction` and `JenkinsTestAction` were merged into one class `JenkinsAction`.
4a40736
to
75e5e6c
Compare
Added a missing test for action Artifacts bound validation. |
This commit changes the way Artifacts are used in CodePipeline. Instead of being properties on the Actions, they are now stand-alone objects, created independently of the Actions, and referenced when instantiating them. This is to not force users to assign Actions to intermediate variables when defining a Pipeline. This change had a few interesting consequences: * We no longer needed the abstract subclasses of Action like SourceAction, DeployAction, etc., and so they were removed. * The old naming convention of `inputArtifacts` and `outputArtifactNames` was shortened to be simply `inputs` and `outputs`. * There was no longer any need to differentiate Build and Test Actions, and so the two CodeBuild and Jenkins Actions were merged into one. BREAKING CHANGE: CodePipeline Actions no longer have the `outputArtifact` and `outputArtifacts` properties. * `inputArtifact(s)` and `additionalInputArtifacts` properties were renamed to `input(s)` and `extraInputs`. * `outputArtifactName(s)` and `additionalOutputArtifactNames` properties were renamed to `output(s)` and `extraOutputs`. * The classes `CodeBuildBuildAction` and `CodeBuildTestAction` were merged into one class `CodeBuildAction`. * The classes `JenkinsBuildAction` and `JenkinsTestAction` were merged into one class `JenkinsAction`.
This commit changes the way Artifacts are used in CodePipeline. Instead of being properties on the Actions, they are now stand-alone objects, created independently of the Actions, and referenced when instantiating them. This is to not force users to assign Actions to intermediate variables when defining a Pipeline. This change had a few interesting consequences: * We no longer needed the abstract subclasses of Action like SourceAction, DeployAction, etc., and so they were removed. * The old naming convention of `inputArtifacts` and `outputArtifactNames` was shortened to be simply `inputs` and `outputs`. * There was no longer any need to differentiate Build and Test Actions, and so the two CodeBuild and Jenkins Actions were merged into one. BREAKING CHANGE: CodePipeline Actions no longer have the `outputArtifact` and `outputArtifacts` properties. * `inputArtifact(s)` and `additionalInputArtifacts` properties were renamed to `input(s)` and `extraInputs`. * `outputArtifactName(s)` and `additionalOutputArtifactNames` properties were renamed to `output(s)` and `extraOutputs`. * The classes `CodeBuildBuildAction` and `CodeBuildTestAction` were merged into one class `CodeBuildAction`. * The classes `JenkinsBuildAction` and `JenkinsTestAction` were merged into one class `JenkinsAction`.
This commit changes the way Artifacts are used in CodePipeline.
Instead of being properties on the Actions,
they are now stand-alone objects,
created independently of the Actions,
and referenced when instantiating them.
This is to not force users to assign Actions to intermediate variables
when defining a Pipeline.
This change had a few interesting consequences:
DeployAction, etc., and so they were removed.
inputArtifacts
andoutputArtifactNames
was shortened to be simply
inputs
andoutputs
.and so the two CodeBuild and Jenkins Actions were merged into one.
BREAKING CHANGE: CodePipeline Actions no longer have the
outputArtifact
and
outputArtifacts
properties.inputArtifact(s)
andadditionalInputArtifacts
properties were renamedto
input(s)
andextraInputs
.outputArtifactName(s)
andadditionalOutputArtifactNames
propertieswere renamed to
output(s)
andextraOutputs
.CodeBuildBuildAction
andCodeBuildTestAction
were mergedinto one class
CodeBuildAction
.JenkinsBuildAction
andJenkinsTestAction
were mergedinto one class
JenkinsAction
.Fixes #2230
Pull Request Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license.