-
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(stepfunctions-tasks): support overriding all properties of CodeBuild StartBuild integration #10356
feat(stepfunctions-tasks): support overriding all properties of CodeBuild StartBuild integration #10356
Conversation
ff616b1
to
f603627
Compare
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 getting this started @zxkane - I think rather than directly translate out all of the potential overrides, we should strive to reuse and simplify wherever we can. take a look at some of my initial observations (I did not dive super deep into this one yet) and let me know what you think.
Also adding @skinny85 as a reviewer as he will have additional insights/feedback on how to structure overrides as the owner of the codebuild
module
packages/@aws-cdk/aws-stepfunctions-tasks/lib/codebuild/start-build.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-stepfunctions-tasks/lib/codebuild/start-build.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-stepfunctions-tasks/lib/codebuild/start-build.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-stepfunctions-tasks/lib/codebuild/start-build.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-stepfunctions-tasks/lib/codebuild/start-build.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-stepfunctions-tasks/lib/codebuild/start-build.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-stepfunctions-tasks/lib/codebuild/start-build.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-stepfunctions-tasks/lib/codebuild/start-build.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-stepfunctions-tasks/lib/codebuild/start-build.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-stepfunctions-tasks/lib/codebuild/start-build.ts
Outdated
Show resolved
Hide resolved
f603627
to
45cc7d5
Compare
Pull request has been modified.
45cc7d5
to
903fe69
Compare
@zxkane I have not had a chance to look at the proposed changes. I will likely only be able to take a pass towards the end of the week. stay tuned! |
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 contribution @zxkane ! This is a very difficult feature, as it involves a very heavy integration with a different module.
I think the main problem here is the duplication between the CodeBuild and StepFunctions-Tasks modules. Here's my proposed solution to this problem.
Extract a (public) interface in @aws-cdk/aws-codebuild
that will contain the property that can be overridden in the StartBuild
call, let's call it StartBuildOptions
. Make the existing ProjectProps
and PipelineProjectProps
extend that interface (you might do some interface dance because of CommonProjectProps
, but I trust you to figure it out - ping me if you can't).
Then, in the @aws-cdk/aws-stepfunctions-tasks
module, you create an interface that contains all those things that you can set for StartBuild
, but you can't set when creating the Project:
export interface OverrideProjectProps extends codebuild.StartBuildOptions {
readonly idempotencyToken?: string;
// ... other properties that you can set in StartBuild,
// but can't set when creating a Project
}
Then, in CodeBuildStartBuildProps
, you add:
readonly overrides?: OverrideProjectProps;
And the implementation is basically the same as you currently have.
packages/@aws-cdk/aws-stepfunctions-tasks/lib/codebuild/start-build.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-stepfunctions-tasks/lib/codebuild/start-build.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-stepfunctions-tasks/lib/codebuild/start-build.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-stepfunctions-tasks/lib/codebuild/start-build.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-stepfunctions-tasks/lib/codebuild/start-build.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-stepfunctions-tasks/lib/codebuild/start-build.ts
Outdated
Show resolved
Hide resolved
903fe69
to
b87f930
Compare
Pull request has been modified.
2076882
to
c8b27d3
Compare
@skinny85 Adam, thanks for your comments. There are few properties not supported by CodeBuild L2 construct yet, I leave them not supported in overriding properties as well. I think they should be supported in a separated PR. Let me know what you think. |
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.
packages/@aws-cdk/aws-stepfunctions-tasks/lib/codebuild/start-build.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-stepfunctions-tasks/test/codebuild/integ.start-build.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-stepfunctions-tasks/test/codebuild/start-build.test.ts
Show resolved
Hide resolved
0b5faa9
to
2072874
Compare
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.
@zxkane nice work!!
I think we're missing a few tests for error scenarios added on the overrides in stepfunctions-tasks. otherwise, made some minor suggestions.
packages/@aws-cdk/aws-stepfunctions-tasks/lib/codebuild/start-build.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-stepfunctions-tasks/lib/codebuild/start-build.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-stepfunctions-tasks/lib/codebuild/start-build.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-stepfunctions-tasks/test/codebuild/start-build.test.ts
Show resolved
Hide resolved
…build of codebuild.
2072874
to
f6ab45c
Compare
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.
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). |
… of CodeBuild StartBuild integration (#10356)" (#11448) This reverts commit 58efbad. We have a latent issue which fails on generating the `Java` code with: > ProjectProps.java:[10,8] interface software.amazon.awscdk.services.codebuild.ProjectProps inherits unrelated defaults for getTimeout() from types software.amazon.awscdk.services.codebuild.StartBuildOptions and software.amazon.awscdk.services.codebuild.CommonProjectProps Reverting for now so we can sort the issue out and then we can re-introduce it. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Thanks for the contribution @zxkane. I was about to ask if this feature could be implemented 👍 It seems like this Pull Request has been reverted by @shivlaks because of the issue in aws/jsii#2256. Will this Pull Request merged back into master after that issue has been resolved? We are eager to use the new overrides. |
@siduenho - we're working on it! the idea is to get it merged back in. we're still sorting out whether this can be resolved at the |
Hi @shivlaks, do you have any updates on this topic? |
@siduenho since we cannot use diamond dependencies as per the related isssue, we'll pick this back up. It will likely need another interface that doesn't duplicate any properties and to break up the diamond. |
@shivlaks are there any updates regarding this issue? We are currently resorting to multiple CodeBuild job instances in order to compensate the missing attributes. Thus adding quite some complexity and manual work to our workflow. |
are there any updates on this issue? |
closes #10302
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license