diff --git a/manifest.json b/manifest.json index 9898811aa..0682a9aeb 100644 --- a/manifest.json +++ b/manifest.json @@ -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": { diff --git a/src/Service/CodeBuild/CHANGELOG.md b/src/Service/CodeBuild/CHANGELOG.md index fb174de94..6d83cd291 100644 --- a/src/Service/CodeBuild/CHANGELOG.md +++ b/src/Service/CodeBuild/CHANGELOG.md @@ -2,6 +2,10 @@ ## NOT RELEASED +### Added + +- AWS api-change: AWS CodeBuild now supports automatically retrying failed builds + ## 2.5.0 ### Added diff --git a/src/Service/CodeBuild/composer.json b/src/Service/CodeBuild/composer.json index 457740963..91ac15e9f 100644 --- a/src/Service/CodeBuild/composer.json +++ b/src/Service/CodeBuild/composer.json @@ -28,7 +28,7 @@ }, "extra": { "branch-alias": { - "dev-master": "2.5-dev" + "dev-master": "2.6-dev" } } } diff --git a/src/Service/CodeBuild/src/CodeBuildClient.php b/src/Service/CodeBuild/src/CodeBuildClient.php index 27bce9f71..2b1f60f3d 100644 --- a/src/Service/CodeBuild/src/CodeBuildClient.php +++ b/src/Service/CodeBuild/src/CodeBuildClient.php @@ -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 * diff --git a/src/Service/CodeBuild/src/Input/StartBuildInput.php b/src/Service/CodeBuild/src/Input/StartBuildInput.php index 72877a901..f3e524f5d 100644 --- a/src/Service/CodeBuild/src/Input/StartBuildInput.php +++ b/src/Service/CodeBuild/src/Input/StartBuildInput.php @@ -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, @@ -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 */ @@ -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); } @@ -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 */ @@ -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; @@ -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; @@ -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; } diff --git a/src/Service/CodeBuild/src/Result/BatchGetBuildsOutput.php b/src/Service/CodeBuild/src/Result/BatchGetBuildsOutput.php index d51c873ae..45a9994cb 100644 --- a/src/Service/CodeBuild/src/Result/BatchGetBuildsOutput.php +++ b/src/Service/CodeBuild/src/Result/BatchGetBuildsOutput.php @@ -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; @@ -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([ @@ -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']), ]); } diff --git a/src/Service/CodeBuild/src/Result/StartBuildOutput.php b/src/Service/CodeBuild/src/Result/StartBuildOutput.php index 9d69a778c..0ba6e9005 100644 --- a/src/Service/CodeBuild/src/Result/StartBuildOutput.php +++ b/src/Service/CodeBuild/src/Result/StartBuildOutput.php @@ -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; @@ -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([ @@ -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']), ]); } diff --git a/src/Service/CodeBuild/src/Result/StopBuildOutput.php b/src/Service/CodeBuild/src/Result/StopBuildOutput.php index 4ce453142..5e293588e 100644 --- a/src/Service/CodeBuild/src/Result/StopBuildOutput.php +++ b/src/Service/CodeBuild/src/Result/StopBuildOutput.php @@ -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; @@ -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([ @@ -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']), ]); } diff --git a/src/Service/CodeBuild/src/ValueObject/AutoRetryConfig.php b/src/Service/CodeBuild/src/ValueObject/AutoRetryConfig.php new file mode 100644 index 000000000..060a64081 --- /dev/null +++ b/src/Service/CodeBuild/src/ValueObject/AutoRetryConfig.php @@ -0,0 +1,89 @@ +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; + } +} diff --git a/src/Service/CodeBuild/src/ValueObject/Build.php b/src/Service/CodeBuild/src/ValueObject/Build.php index a3aadb494..3a1150bff 100644 --- a/src/Service/CodeBuild/src/ValueObject/Build.php +++ b/src/Service/CodeBuild/src/ValueObject/Build.php @@ -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, @@ -316,6 +323,7 @@ final class Build * fileSystemLocations?: null|array, * debugSession?: null|DebugSession|array, * buildBatchArn?: null|string, + * autoRetryConfig?: null|AutoRetryConfig|array, * } $input */ public function __construct(array $input) @@ -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; } /** @@ -388,6 +397,7 @@ public function __construct(array $input) * fileSystemLocations?: null|array, * debugSession?: null|DebugSession|array, * buildBatchArn?: null|string, + * autoRetryConfig?: null|AutoRetryConfig|array, * }|Build $input */ public static function create($input): self @@ -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;