Skip to content

Commit

Permalink
feat(client-codebuild): AWS CodeBuild now supports automatically retr…
Browse files Browse the repository at this point in the history
…ying failed builds
  • Loading branch information
awstools committed Oct 25, 2024
1 parent 5cf2e4b commit 0642ee5
Show file tree
Hide file tree
Showing 11 changed files with 169 additions and 1 deletion.
2 changes: 1 addition & 1 deletion clients/client-codebuild/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Guide</a>.</i>

## Installing

To install the this package, simply type add or install @aws-sdk/client-codebuild
To install this package, simply type add or install @aws-sdk/client-codebuild
using your favorite package manager:

- `npm install @aws-sdk/client-codebuild`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,12 @@ export interface BatchGetBuildsCommandOutput extends BatchGetBuildsOutput, __Met
* // sessionTarget: "STRING_VALUE",
* // },
* // buildBatchArn: "STRING_VALUE",
* // autoRetryConfig: { // AutoRetryConfig
* // autoRetryLimit: Number("int"),
* // autoRetryNumber: Number("int"),
* // nextAutoRetry: "STRING_VALUE",
* // previousAutoRetry: "STRING_VALUE",
* // },
* // },
* // ],
* // buildsNotFound: [ // BuildIds
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ export interface BatchGetProjectsCommandOutput extends BatchGetProjectsOutput, _
* // projectVisibility: "PUBLIC_READ" || "PRIVATE",
* // publicProjectAlias: "STRING_VALUE",
* // resourceAccessRole: "STRING_VALUE",
* // autoRetryLimit: Number("int"),
* // },
* // ],
* // projectsNotFound: [ // ProjectNames
Expand Down
2 changes: 2 additions & 0 deletions clients/client-codebuild/src/commands/CreateProjectCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ export interface CreateProjectCommandOutput extends CreateProjectOutput, __Metad
* batchReportMode: "REPORT_INDIVIDUAL_BUILDS" || "REPORT_AGGREGATED_BATCH",
* },
* concurrentBuildLimit: Number("int"),
* autoRetryLimit: Number("int"),
* };
* const command = new CreateProjectCommand(input);
* const response = await client.send(command);
Expand Down Expand Up @@ -395,6 +396,7 @@ export interface CreateProjectCommandOutput extends CreateProjectOutput, __Metad
* // projectVisibility: "PUBLIC_READ" || "PRIVATE",
* // publicProjectAlias: "STRING_VALUE",
* // resourceAccessRole: "STRING_VALUE",
* // autoRetryLimit: Number("int"),
* // },
* // };
*
Expand Down
6 changes: 6 additions & 0 deletions clients/client-codebuild/src/commands/RetryBuildCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,12 @@ export interface RetryBuildCommandOutput extends RetryBuildOutput, __MetadataBea
* // sessionTarget: "STRING_VALUE",
* // },
* // buildBatchArn: "STRING_VALUE",
* // autoRetryConfig: { // AutoRetryConfig
* // autoRetryLimit: Number("int"),
* // autoRetryNumber: Number("int"),
* // nextAutoRetry: "STRING_VALUE",
* // previousAutoRetry: "STRING_VALUE",
* // },
* // },
* // };
*
Expand Down
7 changes: 7 additions & 0 deletions clients/client-codebuild/src/commands/StartBuildCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ export interface StartBuildCommandOutput extends StartBuildOutput, __MetadataBea
* fleetOverride: { // ProjectFleet
* fleetArn: "STRING_VALUE",
* },
* autoRetryLimitOverride: Number("int"),
* };
* const command = new StartBuildCommand(input);
* const response = await client.send(command);
Expand Down Expand Up @@ -346,6 +347,12 @@ export interface StartBuildCommandOutput extends StartBuildOutput, __MetadataBea
* // sessionTarget: "STRING_VALUE",
* // },
* // buildBatchArn: "STRING_VALUE",
* // autoRetryConfig: { // AutoRetryConfig
* // autoRetryLimit: Number("int"),
* // autoRetryNumber: Number("int"),
* // nextAutoRetry: "STRING_VALUE",
* // previousAutoRetry: "STRING_VALUE",
* // },
* // },
* // };
*
Expand Down
6 changes: 6 additions & 0 deletions clients/client-codebuild/src/commands/StopBuildCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,12 @@ export interface StopBuildCommandOutput extends StopBuildOutput, __MetadataBeare
* // sessionTarget: "STRING_VALUE",
* // },
* // buildBatchArn: "STRING_VALUE",
* // autoRetryConfig: { // AutoRetryConfig
* // autoRetryLimit: Number("int"),
* // autoRetryNumber: Number("int"),
* // nextAutoRetry: "STRING_VALUE",
* // previousAutoRetry: "STRING_VALUE",
* // },
* // },
* // };
*
Expand Down
2 changes: 2 additions & 0 deletions clients/client-codebuild/src/commands/UpdateProjectCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ export interface UpdateProjectCommandOutput extends UpdateProjectOutput, __Metad
* batchReportMode: "REPORT_INDIVIDUAL_BUILDS" || "REPORT_AGGREGATED_BATCH",
* },
* concurrentBuildLimit: Number("int"),
* autoRetryLimit: Number("int"),
* };
* const command = new UpdateProjectCommand(input);
* const response = await client.send(command);
Expand Down Expand Up @@ -395,6 +396,7 @@ export interface UpdateProjectCommandOutput extends UpdateProjectOutput, __Metad
* // projectVisibility: "PUBLIC_READ" || "PRIVATE",
* // publicProjectAlias: "STRING_VALUE",
* // resourceAccessRole: "STRING_VALUE",
* // autoRetryLimit: Number("int"),
* // },
* // };
*
Expand Down
72 changes: 72 additions & 0 deletions clients/client-codebuild/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,40 @@ export const AuthType = {
*/
export type AuthType = (typeof AuthType)[keyof typeof AuthType];

/**
* <p>Information about the auto-retry configuration for the build.</p>
* @public
*/
export interface AutoRetryConfig {
/**
* <p>The maximum number of additional automatic retries after a failed build. For example, if the
* auto-retry limit is set to 2, CodeBuild will call the <code>RetryBuild</code> API to automatically
* retry your build for up to 2 additional times.</p>
* @public
*/
autoRetryLimit?: number;

/**
* <p>The number of times that the build has been retried. The initial build will have an auto-retry number of 0.</p>
* @public
*/
autoRetryNumber?: number;

/**
* <p>The build ARN of the auto-retried build triggered by the current build. The next auto-retry
* will be <code>null</code> for builds that don't trigger an auto-retry.</p>
* @public
*/
nextAutoRetry?: string;

/**
* <p>The build ARN of the build that triggered the current auto-retry build. The previous auto-retry will be
* <code>null</code> for the initial build.</p>
* @public
*/
previousAutoRetry?: string;
}

/**
* @public
*/
Expand Down Expand Up @@ -2686,6 +2720,12 @@ export interface Build {
* @public
*/
buildBatchArn?: string;

/**
* <p>Information about the auto-retry configuration for the build.</p>
* @public
*/
autoRetryConfig?: AutoRetryConfig;
}

/**
Expand Down Expand Up @@ -4140,6 +4180,14 @@ export interface Project {
* @public
*/
resourceAccessRole?: string;

/**
* <p>The maximum number of additional automatic retries after a failed build. For example, if the
* auto-retry limit is set to 2, CodeBuild will call the <code>RetryBuild</code> API to automatically
* retry your build for up to 2 additional times.</p>
* @public
*/
autoRetryLimit?: number;
}

/**
Expand Down Expand Up @@ -5089,6 +5137,14 @@ export interface CreateProjectInput {
* @public
*/
concurrentBuildLimit?: number;

/**
* <p>The maximum number of additional automatic retries after a failed build. For example, if the
* auto-retry limit is set to 2, CodeBuild will call the <code>RetryBuild</code> API to automatically
* retry your build for up to 2 additional times.</p>
* @public
*/
autoRetryLimit?: number;
}

/**
Expand Down Expand Up @@ -7528,6 +7584,14 @@ export interface StartBuildInput {
* @public
*/
fleetOverride?: ProjectFleet;

/**
* <p>The maximum number of additional automatic retries after a failed build. For example, if the
* auto-retry limit is set to 2, CodeBuild will call the <code>RetryBuild</code> API to automatically
* retry your build for up to 2 additional times.</p>
* @public
*/
autoRetryLimitOverride?: number;
}

/**
Expand Down Expand Up @@ -8280,6 +8344,14 @@ export interface UpdateProjectInput {
* @public
*/
concurrentBuildLimit?: number;

/**
* <p>The maximum number of additional automatic retries after a failed build. For example, if the
* auto-retry limit is set to 2, CodeBuild will call the <code>RetryBuild</code> API to automatically
* retry your build for up to 2 additional times.</p>
* @public
*/
autoRetryLimit?: number;
}

/**
Expand Down
4 changes: 4 additions & 0 deletions clients/client-codebuild/src/protocols/Aws_json1_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2294,6 +2294,8 @@ const se_UpdateFleetInput = (input: UpdateFleetInput, context: __SerdeContext):

// de_AccountLimitExceededException omitted.

// de_AutoRetryConfig omitted.

// de_BatchDeleteBuildsOutput omitted.

/**
Expand Down Expand Up @@ -2365,6 +2367,7 @@ const de_Build = (output: any, context: __SerdeContext): Build => {
return take(output, {
arn: __expectString,
artifacts: _json,
autoRetryConfig: _json,
buildBatchArn: __expectString,
buildComplete: __expectBoolean,
buildNumber: __expectLong,
Expand Down Expand Up @@ -2833,6 +2836,7 @@ const de_Project = (output: any, context: __SerdeContext): Project => {
return take(output, {
arn: __expectString,
artifacts: _json,
autoRetryLimit: __expectInt32,
badge: _json,
buildBatchConfig: _json,
cache: _json,
Expand Down
62 changes: 62 additions & 0 deletions codegen/sdk-codegen/aws-models/codebuild.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,38 @@
}
}
},
"com.amazonaws.codebuild#AutoRetryConfig": {
"type": "structure",
"members": {
"autoRetryLimit": {
"target": "com.amazonaws.codebuild#WrapperInt",
"traits": {
"smithy.api#documentation": "<p>The maximum number of additional automatic retries after a failed build. For example, if the \n auto-retry limit is set to 2, CodeBuild will call the <code>RetryBuild</code> API to automatically \n retry your build for up to 2 additional times.</p>"
}
},
"autoRetryNumber": {
"target": "com.amazonaws.codebuild#WrapperInt",
"traits": {
"smithy.api#documentation": "<p>The number of times that the build has been retried. The initial build will have an auto-retry number of 0.</p>"
}
},
"nextAutoRetry": {
"target": "com.amazonaws.codebuild#String",
"traits": {
"smithy.api#documentation": "<p>The build ARN of the auto-retried build triggered by the current build. The next auto-retry \n will be <code>null</code> for builds that don't trigger an auto-retry.</p>"
}
},
"previousAutoRetry": {
"target": "com.amazonaws.codebuild#String",
"traits": {
"smithy.api#documentation": "<p>The build ARN of the build that triggered the current auto-retry build. The previous auto-retry will be \n <code>null</code> for the initial build.</p>"
}
}
},
"traits": {
"smithy.api#documentation": "<p>Information about the auto-retry configuration for the build.</p>"
}
},
"com.amazonaws.codebuild#BatchDeleteBuilds": {
"type": "operation",
"input": {
Expand Down Expand Up @@ -761,6 +793,12 @@
"traits": {
"smithy.api#documentation": "<p>The ARN of the batch build that this build is a member of, if applicable.</p>"
}
},
"autoRetryConfig": {
"target": "com.amazonaws.codebuild#AutoRetryConfig",
"traits": {
"smithy.api#documentation": "<p>Information about the auto-retry configuration for the build.</p>"
}
}
},
"traits": {
Expand Down Expand Up @@ -3101,6 +3139,12 @@
"traits": {
"smithy.api#documentation": "<p>The maximum number of concurrent builds that are allowed for this project.</p>\n <p>New builds are only started if the current number of builds is less than or equal to this limit. \n If the current build count meets this limit, new builds are throttled and are not run.</p>"
}
},
"autoRetryLimit": {
"target": "com.amazonaws.codebuild#WrapperInt",
"traits": {
"smithy.api#documentation": "<p>The maximum number of additional automatic retries after a failed build. For example, if the \n auto-retry limit is set to 2, CodeBuild will call the <code>RetryBuild</code> API to automatically \n retry your build for up to 2 additional times.</p>"
}
}
},
"traits": {
Expand Down Expand Up @@ -6175,6 +6219,12 @@
"traits": {
"smithy.api#documentation": "<p>The ARN of the IAM role that enables CodeBuild to access the CloudWatch Logs and Amazon S3 artifacts for\n the project's builds.</p>"
}
},
"autoRetryLimit": {
"target": "com.amazonaws.codebuild#WrapperInt",
"traits": {
"smithy.api#documentation": "<p>The maximum number of additional automatic retries after a failed build. For example, if the \n auto-retry limit is set to 2, CodeBuild will call the <code>RetryBuild</code> API to automatically \n retry your build for up to 2 additional times.</p>"
}
}
},
"traits": {
Expand Down Expand Up @@ -8297,6 +8347,12 @@
"traits": {
"smithy.api#documentation": "<p>A ProjectFleet object specified for this build that overrides the one defined in the\n build project.</p>"
}
},
"autoRetryLimitOverride": {
"target": "com.amazonaws.codebuild#WrapperInt",
"traits": {
"smithy.api#documentation": "<p>The maximum number of additional automatic retries after a failed build. For example, if the \n auto-retry limit is set to 2, CodeBuild will call the <code>RetryBuild</code> API to automatically \n retry your build for up to 2 additional times.</p>"
}
}
},
"traits": {
Expand Down Expand Up @@ -8904,6 +8960,12 @@
"traits": {
"smithy.api#documentation": "<p>The maximum number of concurrent builds that are allowed for this project.</p>\n <p>New builds are only started if the current number of builds is less than or equal to this limit. \n If the current build count meets this limit, new builds are throttled and are not run.</p>\n <p>To remove this limit, set this value to -1.</p>"
}
},
"autoRetryLimit": {
"target": "com.amazonaws.codebuild#WrapperInt",
"traits": {
"smithy.api#documentation": "<p>The maximum number of additional automatic retries after a failed build. For example, if the \n auto-retry limit is set to 2, CodeBuild will call the <code>RetryBuild</code> API to automatically \n retry your build for up to 2 additional times.</p>"
}
}
},
"traits": {
Expand Down

0 comments on commit 0642ee5

Please sign in to comment.