Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"variables": {
"${LATEST}": "3.324.8"
"${LATEST}": "3.324.11"
},
"endpoints": "https://raw.githubusercontent.com/aws/aws-sdk-php/${LATEST}/src/data/endpoints.json",
"services": {
Expand Down
4 changes: 4 additions & 0 deletions src/Service/CodeBuild/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## NOT RELEASED

### Added

- AWS api-change: AWS CodeBuild now supports automatically retrying failed builds

## 2.5.0

### Added
Expand Down
2 changes: 1 addition & 1 deletion src/Service/CodeBuild/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "2.5-dev"
"dev-master": "2.6-dev"
}
}
}
1 change: 1 addition & 0 deletions src/Service/CodeBuild/src/CodeBuildClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ public function batchGetBuilds($input): BatchGetBuildsOutput
* imagePullCredentialsTypeOverride?: null|ImagePullCredentialsType::*,
* debugSessionEnabled?: null|bool,
* fleetOverride?: null|ProjectFleet|array,
* autoRetryLimitOverride?: null|int,
* '@region'?: string|null,
* }|StartBuildInput $input
*
Expand Down
26 changes: 26 additions & 0 deletions src/Service/CodeBuild/src/Input/StartBuildInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,14 @@ final class StartBuildInput extends Input
*/
private $fleetOverride;

/**
* 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 `RetryBuild` API to automatically retry your build for up to 2 additional times.
*
* @var int|null
*/
private $autoRetryLimitOverride;

/**
* @param array{
* projectName?: string,
Expand Down Expand Up @@ -369,6 +377,7 @@ final class StartBuildInput extends Input
* imagePullCredentialsTypeOverride?: null|ImagePullCredentialsType::*,
* debugSessionEnabled?: null|bool,
* fleetOverride?: null|ProjectFleet|array,
* autoRetryLimitOverride?: null|int,
* '@region'?: string|null,
* } $input
*/
Expand Down Expand Up @@ -406,6 +415,7 @@ public function __construct(array $input = [])
$this->imagePullCredentialsTypeOverride = $input['imagePullCredentialsTypeOverride'] ?? null;
$this->debugSessionEnabled = $input['debugSessionEnabled'] ?? null;
$this->fleetOverride = isset($input['fleetOverride']) ? ProjectFleet::create($input['fleetOverride']) : null;
$this->autoRetryLimitOverride = $input['autoRetryLimitOverride'] ?? null;
parent::__construct($input);
}

Expand Down Expand Up @@ -443,6 +453,7 @@ public function __construct(array $input = [])
* imagePullCredentialsTypeOverride?: null|ImagePullCredentialsType::*,
* debugSessionEnabled?: null|bool,
* fleetOverride?: null|ProjectFleet|array,
* autoRetryLimitOverride?: null|int,
* '@region'?: string|null,
* }|StartBuildInput $input
*/
Expand All @@ -456,6 +467,11 @@ public function getArtifactsOverride(): ?ProjectArtifacts
return $this->artifactsOverride;
}

public function getAutoRetryLimitOverride(): ?int
{
return $this->autoRetryLimitOverride;
}

public function getBuildStatusConfigOverride(): ?BuildStatusConfig
{
return $this->buildStatusConfigOverride;
Expand Down Expand Up @@ -668,6 +684,13 @@ public function setArtifactsOverride(?ProjectArtifacts $value): self
return $this;
}

public function setAutoRetryLimitOverride(?int $value): self
{
$this->autoRetryLimitOverride = $value;

return $this;
}

public function setBuildStatusConfigOverride(?BuildStatusConfig $value): self
{
$this->buildStatusConfigOverride = $value;
Expand Down Expand Up @@ -1041,6 +1064,9 @@ private function requestBody(): array
if (null !== $v = $this->fleetOverride) {
$payload['fleetOverride'] = $v->requestBody();
}
if (null !== $v = $this->autoRetryLimitOverride) {
$payload['autoRetryLimitOverride'] = $v;
}

return $payload;
}
Expand Down
12 changes: 12 additions & 0 deletions src/Service/CodeBuild/src/Result/BatchGetBuildsOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace AsyncAws\CodeBuild\Result;

use AsyncAws\CodeBuild\Enum\CacheMode;
use AsyncAws\CodeBuild\ValueObject\AutoRetryConfig;
use AsyncAws\CodeBuild\ValueObject\Build;
use AsyncAws\CodeBuild\ValueObject\BuildArtifacts;
use AsyncAws\CodeBuild\ValueObject\BuildPhase;
Expand Down Expand Up @@ -72,6 +73,16 @@ protected function populateResult(Response $response): void
$this->buildsNotFound = empty($data['buildsNotFound']) ? [] : $this->populateResultBuildIds($data['buildsNotFound']);
}

private function populateResultAutoRetryConfig(array $json): AutoRetryConfig
{
return new AutoRetryConfig([
'autoRetryLimit' => isset($json['autoRetryLimit']) ? (int) $json['autoRetryLimit'] : null,
'autoRetryNumber' => isset($json['autoRetryNumber']) ? (int) $json['autoRetryNumber'] : null,
'nextAutoRetry' => isset($json['nextAutoRetry']) ? (string) $json['nextAutoRetry'] : null,
'previousAutoRetry' => isset($json['previousAutoRetry']) ? (string) $json['previousAutoRetry'] : null,
]);
}

private function populateResultBuild(array $json): Build
{
return new Build([
Expand Down Expand Up @@ -107,6 +118,7 @@ private function populateResultBuild(array $json): Build
'fileSystemLocations' => !isset($json['fileSystemLocations']) ? null : $this->populateResultProjectFileSystemLocations($json['fileSystemLocations']),
'debugSession' => empty($json['debugSession']) ? null : $this->populateResultDebugSession($json['debugSession']),
'buildBatchArn' => isset($json['buildBatchArn']) ? (string) $json['buildBatchArn'] : null,
'autoRetryConfig' => empty($json['autoRetryConfig']) ? null : $this->populateResultAutoRetryConfig($json['autoRetryConfig']),
]);
}

Expand Down
12 changes: 12 additions & 0 deletions src/Service/CodeBuild/src/Result/StartBuildOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace AsyncAws\CodeBuild\Result;

use AsyncAws\CodeBuild\Enum\CacheMode;
use AsyncAws\CodeBuild\ValueObject\AutoRetryConfig;
use AsyncAws\CodeBuild\ValueObject\Build;
use AsyncAws\CodeBuild\ValueObject\BuildArtifacts;
use AsyncAws\CodeBuild\ValueObject\BuildPhase;
Expand Down Expand Up @@ -51,6 +52,16 @@ protected function populateResult(Response $response): void
$this->build = empty($data['build']) ? null : $this->populateResultBuild($data['build']);
}

private function populateResultAutoRetryConfig(array $json): AutoRetryConfig
{
return new AutoRetryConfig([
'autoRetryLimit' => isset($json['autoRetryLimit']) ? (int) $json['autoRetryLimit'] : null,
'autoRetryNumber' => isset($json['autoRetryNumber']) ? (int) $json['autoRetryNumber'] : null,
'nextAutoRetry' => isset($json['nextAutoRetry']) ? (string) $json['nextAutoRetry'] : null,
'previousAutoRetry' => isset($json['previousAutoRetry']) ? (string) $json['previousAutoRetry'] : null,
]);
}

private function populateResultBuild(array $json): Build
{
return new Build([
Expand Down Expand Up @@ -86,6 +97,7 @@ private function populateResultBuild(array $json): Build
'fileSystemLocations' => !isset($json['fileSystemLocations']) ? null : $this->populateResultProjectFileSystemLocations($json['fileSystemLocations']),
'debugSession' => empty($json['debugSession']) ? null : $this->populateResultDebugSession($json['debugSession']),
'buildBatchArn' => isset($json['buildBatchArn']) ? (string) $json['buildBatchArn'] : null,
'autoRetryConfig' => empty($json['autoRetryConfig']) ? null : $this->populateResultAutoRetryConfig($json['autoRetryConfig']),
]);
}

Expand Down
12 changes: 12 additions & 0 deletions src/Service/CodeBuild/src/Result/StopBuildOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace AsyncAws\CodeBuild\Result;

use AsyncAws\CodeBuild\Enum\CacheMode;
use AsyncAws\CodeBuild\ValueObject\AutoRetryConfig;
use AsyncAws\CodeBuild\ValueObject\Build;
use AsyncAws\CodeBuild\ValueObject\BuildArtifacts;
use AsyncAws\CodeBuild\ValueObject\BuildPhase;
Expand Down Expand Up @@ -51,6 +52,16 @@ protected function populateResult(Response $response): void
$this->build = empty($data['build']) ? null : $this->populateResultBuild($data['build']);
}

private function populateResultAutoRetryConfig(array $json): AutoRetryConfig
{
return new AutoRetryConfig([
'autoRetryLimit' => isset($json['autoRetryLimit']) ? (int) $json['autoRetryLimit'] : null,
'autoRetryNumber' => isset($json['autoRetryNumber']) ? (int) $json['autoRetryNumber'] : null,
'nextAutoRetry' => isset($json['nextAutoRetry']) ? (string) $json['nextAutoRetry'] : null,
'previousAutoRetry' => isset($json['previousAutoRetry']) ? (string) $json['previousAutoRetry'] : null,
]);
}

private function populateResultBuild(array $json): Build
{
return new Build([
Expand Down Expand Up @@ -86,6 +97,7 @@ private function populateResultBuild(array $json): Build
'fileSystemLocations' => !isset($json['fileSystemLocations']) ? null : $this->populateResultProjectFileSystemLocations($json['fileSystemLocations']),
'debugSession' => empty($json['debugSession']) ? null : $this->populateResultDebugSession($json['debugSession']),
'buildBatchArn' => isset($json['buildBatchArn']) ? (string) $json['buildBatchArn'] : null,
'autoRetryConfig' => empty($json['autoRetryConfig']) ? null : $this->populateResultAutoRetryConfig($json['autoRetryConfig']),
]);
}

Expand Down
89 changes: 89 additions & 0 deletions src/Service/CodeBuild/src/ValueObject/AutoRetryConfig.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<?php

namespace AsyncAws\CodeBuild\ValueObject;

/**
* Information about the auto-retry configuration for the build.
*/
final class AutoRetryConfig
{
/**
* 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 `RetryBuild` API to automatically retry your build for up to 2 additional times.
*
* @var int|null
*/
private $autoRetryLimit;

/**
* The number of times that the build has been retried. The initial build will have an auto-retry number of 0.
*
* @var int|null
*/
private $autoRetryNumber;

/**
* The build ARN of the auto-retried build triggered by the current build. The next auto-retry will be `null` for builds
* that don't trigger an auto-retry.
*
* @var string|null
*/
private $nextAutoRetry;

/**
* The build ARN of the build that triggered the current auto-retry build. The previous auto-retry will be `null` for
* the initial build.
*
* @var string|null
*/
private $previousAutoRetry;

/**
* @param array{
* autoRetryLimit?: null|int,
* autoRetryNumber?: null|int,
* nextAutoRetry?: null|string,
* previousAutoRetry?: null|string,
* } $input
*/
public function __construct(array $input)
{
$this->autoRetryLimit = $input['autoRetryLimit'] ?? null;
$this->autoRetryNumber = $input['autoRetryNumber'] ?? null;
$this->nextAutoRetry = $input['nextAutoRetry'] ?? null;
$this->previousAutoRetry = $input['previousAutoRetry'] ?? null;
}

/**
* @param array{
* autoRetryLimit?: null|int,
* autoRetryNumber?: null|int,
* nextAutoRetry?: null|string,
* previousAutoRetry?: null|string,
* }|AutoRetryConfig $input
*/
public static function create($input): self
{
return $input instanceof self ? $input : new self($input);
}

public function getAutoRetryLimit(): ?int
{
return $this->autoRetryLimit;
}

public function getAutoRetryNumber(): ?int
{
return $this->autoRetryNumber;
}

public function getNextAutoRetry(): ?string
{
return $this->nextAutoRetry;
}

public function getPreviousAutoRetry(): ?string
{
return $this->previousAutoRetry;
}
}
15 changes: 15 additions & 0 deletions src/Service/CodeBuild/src/ValueObject/Build.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,13 @@ final class Build
*/
private $buildBatchArn;

/**
* Information about the auto-retry configuration for the build.
*
* @var AutoRetryConfig|null
*/
private $autoRetryConfig;

/**
* @param array{
* id?: null|string,
Expand Down Expand Up @@ -316,6 +323,7 @@ final class Build
* fileSystemLocations?: null|array<ProjectFileSystemLocation|array>,
* debugSession?: null|DebugSession|array,
* buildBatchArn?: null|string,
* autoRetryConfig?: null|AutoRetryConfig|array,
* } $input
*/
public function __construct(array $input)
Expand Down Expand Up @@ -352,6 +360,7 @@ public function __construct(array $input)
$this->fileSystemLocations = isset($input['fileSystemLocations']) ? array_map([ProjectFileSystemLocation::class, 'create'], $input['fileSystemLocations']) : null;
$this->debugSession = isset($input['debugSession']) ? DebugSession::create($input['debugSession']) : null;
$this->buildBatchArn = $input['buildBatchArn'] ?? null;
$this->autoRetryConfig = isset($input['autoRetryConfig']) ? AutoRetryConfig::create($input['autoRetryConfig']) : null;
}

/**
Expand Down Expand Up @@ -388,6 +397,7 @@ public function __construct(array $input)
* fileSystemLocations?: null|array<ProjectFileSystemLocation|array>,
* debugSession?: null|DebugSession|array,
* buildBatchArn?: null|string,
* autoRetryConfig?: null|AutoRetryConfig|array,
* }|Build $input
*/
public static function create($input): self
Expand All @@ -405,6 +415,11 @@ public function getArtifacts(): ?BuildArtifacts
return $this->artifacts;
}

public function getAutoRetryConfig(): ?AutoRetryConfig
{
return $this->autoRetryConfig;
}

public function getBuildBatchArn(): ?string
{
return $this->buildBatchArn;
Expand Down
Loading