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): add construct for registering custom Actions #17041
feat(codepipeline): add construct for registering custom Actions #17041
Conversation
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.
Thanks for the PR @rayjanwilson, but things are not that simple (aren't they always 😜).
We will need to make some changes to custom-action-registration.ts
- the build currently fails with:
@aws-cdk/aws-codepipeline-actions: �[96mlib/custom-action-registration.ts�[0m:�[93m105�[0m:�[93m3�[0m - �[91merror�[0m�[90m JSII3008: �[0mThe "actionProperties" property of struct "@aws-cdk/aws-codepipeline-actions.CustomActionRegistrationProps" must be "readonly". Rename "@aws-cdk/aws-codepipeline-actions.CustomActionRegistrationProps" to "ICustomActionRegistrationProps" if it is meant to be a behavioral interface.
We need to make all of the properties of CustomActionProperty
readonly
. While we're in the area, we'll probably have to make a few more adjustments before we make this a public part of the API of the module (and hence we'll have to maintain it going forwards).
Are you up for that @rayjanwilson? 🙂
Thanks,
Adam
@@ -18,3 +18,5 @@ export * from './s3/source-action'; | |||
export * from './stepfunctions/invoke-action'; | |||
export * from './servicecatalog/deploy-action-beta1'; | |||
export * from './action'; | |||
export * from './common'; |
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 the export of common? Why do you need it?
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.
oh just figured it helped when making custom source actions
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.
Let's leave it out then please 🙂.
Pull request has been modified.
yep happy to give it a go and iterate towards what it should be. first time doing this =) |
Sweet. Let's start by adding those |
removed common and changed CustomActionProperty to be readonly |
@rayjanwilson Now you need to do the same for
|
oh, derp. fixed |
Still some errors:
@rayjanwilson did you go through our "Contributing" guide? You should be able to see these errors when |
i'll go through it again |
k, i had to flush all the old docker images and volumes. that was causing the devcontainer to crash when doing the post-create command. it's building now and i'll be able to go through the contributing section correctly now. cheers |
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.
Looks great @rayjanwilson! Let's add some JSDocs to the fileds, and let's get this merged in!
Would you mind also updating the ReadMe of the module, showing an example of how to use this class?
@@ -172,7 +172,9 @@ | |||
"docs-public-apis:@aws-cdk/aws-codepipeline-actions.GitHubTrigger.POLL", | |||
"docs-public-apis:@aws-cdk/aws-codepipeline-actions.GitHubTrigger.WEBHOOK", | |||
"docs-public-apis:@aws-cdk/aws-codepipeline-actions.CodeDeployEcsDeployAction", | |||
"props-default-doc:@aws-cdk/aws-codepipeline-actions.CodeDeployEcsDeployActionProps.containerImageInputs" | |||
"props-default-doc:@aws-cdk/aws-codepipeline-actions.CodeDeployEcsDeployActionProps.containerImageInputs", | |||
"props-default-doc:@aws-cdk/aws-codepipeline-actions.CustomActionRegistrationProps.entityUrl", |
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.
Instead of adding an exemption here, let's actually fill out this documentation:
/**
* The URL shown for the entire Action in the Pipeline UI.
*
* @default - none
*/
readonly entityUrl?: string;
"props-default-doc:@aws-cdk/aws-codepipeline-actions.CodeDeployEcsDeployActionProps.containerImageInputs" | ||
"props-default-doc:@aws-cdk/aws-codepipeline-actions.CodeDeployEcsDeployActionProps.containerImageInputs", | ||
"props-default-doc:@aws-cdk/aws-codepipeline-actions.CustomActionRegistrationProps.entityUrl", | ||
"props-default-doc:@aws-cdk/aws-codepipeline-actions.CustomActionRegistrationProps.executionUrl" |
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.
Same here:
/**
* The URL shown for a particular execution of an Action in the Pipeline UI.
*
* @default - none
*/
readonly executionUrl?: string;
Actually @rayjanwilson, since you're doing work in this are anyway... Can you please move these classes to the |
yes for sure |
Thanks! |
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.
Putting in "Request changes" to clear this one from my To-Do list. @rayjanwilson please re-request my review when this is ready!
Pull request has been modified.
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.
Thanks for the effort @rayjanwilson, but, like I mentioned before, let's leave common.ts
exactly where it is now, unchanged.
@@ -1,10 +1,10 @@ | |||
import * as codepipeline from '@aws-cdk/aws-codepipeline'; | |||
import { ActionArtifactBounds } from './action'; | |||
|
|||
/** |
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 thought we resolved this already? 😃
Do not touch this file - leave it where it is, don't move it to the @aws-cdk/aws-codepipeline
module, and do not make it public.
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.
we had, my bad. it's what i get for picking back up after a week or so. apologies. reverted
Pull request has been modified.
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.
Looks great, thanks @rayjanwilson!
@@ -109,6 +109,40 @@ or you can use the `IStage.addAction()` method to mutate an existing Stage: | |||
sourceStage.addAction(someAction); | |||
``` | |||
|
|||
## Custom Action Registration | |||
|
|||
To make your own custom CodePipeline Action requires registering the action provider. Look to the `JenkinsProvider` in `@aws-cdk/aws-codepipeline-actions` for an implementation example. |
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.
Be wary of long lines in this file:
To make your own custom CodePipeline Action requires registering the action provider. Look to the `JenkinsProvider` in `@aws-cdk/aws-codepipeline-actions` for an implementation example. | |
To make your own custom CodePipeline Action requires registering the action provider. | |
Look to the `JenkinsProvider` in `@aws-cdk/aws-codepipeline-actions` for an implementation example. |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
fixes #17039
all it does is add
./common
and./custom-action-registration
to the modulesindex.ts
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license