feat(codebuild): attribute-based compute type for Fleet#32251
feat(codebuild): attribute-based compute type for Fleet#32251mergify[bot] merged 34 commits intoaws:mainfrom
Conversation
aws-cdk-automation
left a comment
There was a problem hiding this comment.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #32251 +/- ##
=======================================
Coverage 80.83% 80.83%
=======================================
Files 236 236
Lines 14253 14253
Branches 2490 2490
=======================================
Hits 11522 11522
Misses 2446 2446
Partials 285 285
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
CodeQL job has failed, but this is caused by automatically generated test code and I think this is not a problem. |
|
I swear I searched for issues and PRs before starting #32574 🤦 I'll close mine and give yours a review today |
nmussy
left a comment
There was a problem hiding this comment.
Had a quick first look by comparing our implementations, I'll try again with a more neutral outlook later. Thanks!
| disk: props.computeConfiguration.disk?.toGibibytes(), | ||
| machineType: props.computeConfiguration.machineType, | ||
| memory: props.computeConfiguration.memory?.toGibibytes(), | ||
| vCpu: props.computeConfiguration.vCpu, |
There was a problem hiding this comment.
Despite what the CloudFormation documentation says, the numeric props are not optional, see https://github.com/nmussy/aws-cdk/blob/6120d8f54103f81c4ec601221c1f56e5a4549236/packages/%40aws-cdk-testing/framework-integ/test/aws-codebuild/test/integ.project-fleet-attribute-based-compute.ts#L67-L73
Could you give them a default value, like this for example, and add an integ with just { machineType: GENERAL }?
| throw new Error('baseCapacity must be greater than or equal to 1'); | ||
| } | ||
|
|
||
| if (props.computeConfiguration) { |
There was a problem hiding this comment.
I also had this validation to make sure the user saw how ATTRIBUTE_BASED_COMPUTE worked, leaving it up to you if you want to add it as well:
| if (props.computeConfiguration) { | |
| if (props.computeType === FleetComputeType.ATTRIBUTE_BASED && | |
| (!props.computeConfiguration || Object.keys(props.computeConfiguration).length === 0)) { | |
| throw new Error('At least one compute configuration criteria must be specified if computeType is "ATTRIBUTE_BASED"'); | |
| } | |
| if (props.computeConfiguration) { |
There was a problem hiding this comment.
You're missing a getter for the fromFleetArn Import class:
public get computeConfiguration(): FleetComputeConfiguration | undefined {
throw new Error('Cannot retrieve computeConfiguration property from an imported Fleet');
}| const listFleets = test.assertions.awsApiCall('Codebuild', 'listFleets'); | ||
| for (const { fleet, project } of stacks) { | ||
| listFleets.expect(integ.ExpectedResult.objectLike({ | ||
| fleets: integ.Match.arrayWith([fleet.fleetArn]), | ||
| })); | ||
|
|
||
| const startBuild = test.assertions.awsApiCall('Codebuild', 'startBuild', { projectName: project.projectName }); |
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
@Mergifyio dequeue |
|
This pull request has been removed from the queue for the following reason: Pull request #32251 has been dequeued by a You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. If you want to requeue this pull request, you need to post a comment with the text: |
✅ The pull request has been removed from the queue
|
|
@Mergifyio dequeue |
☑️ The pull request is not queued |
|
@Mergifyio requeue |
✅ The queue state of this pull request has been cleaned. It can be re-embarked automatically |
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 main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
Comments on closed issues and PRs are hard for our team to see. |
Issue # (if applicable)
None
Reason for this change
AWS Codebuild supports for creating Fleet with attribute based compute type.
https://docs.aws.amazon.com/codebuild/latest/userguide/fleets.html#fleets.attribute-compute
You can specify minimum vCPU, disk and memory sizes. Codebuild automatically selects the instance type based on the compute configuration.
Description of changes
Add
computeConfiguraionprop toFleetProps.Description of how you validated changes
Add both unit and integ tests.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license