Skip to content

Commit 196c2c6

Browse files
Align server SDK compatibility metadata
Align server SDK compatibility metadata
1 parent 8081923 commit 196c2c6

3 files changed

Lines changed: 28 additions & 9 deletions

File tree

app/Http/Controllers/Api/HealthController.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,7 @@ public function clusterInfo(Request $request): JsonResponse
101101
'server_id' => config('server.server_id'),
102102
'version' => env('APP_VERSION', '2.0.0'),
103103
'default_namespace' => config('server.default_namespace'),
104-
'supported_sdk_versions' => [
105-
'php' => '>=1.0',
106-
'python' => '>=0.2,<1.0',
107-
'cli' => '>=0.1,<1.0',
108-
],
104+
'supported_sdk_versions' => ClientCompatibility::supportedSdkVersions(),
109105
'capabilities' => $capabilities,
110106
'worker_fleet' => StandaloneWorkerVisibility::fleetSummary($namespace),
111107
'task_repair' => $this->taskRepairDiagnostics(),

app/Support/ClientCompatibility.php

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,20 @@ final class ClientCompatibility
88

99
public const VERSION = 1;
1010

11+
private const SUPPORTED_SDK_VERSIONS = [
12+
'php' => '>=1.0',
13+
'python' => '>=0.2,<1.0',
14+
'cli' => '>=0.1,<1.0',
15+
];
16+
17+
/**
18+
* @return array{php: string, python: string, cli: string}
19+
*/
20+
public static function supportedSdkVersions(): array
21+
{
22+
return self::SUPPORTED_SDK_VERSIONS;
23+
}
24+
1125
/**
1226
* @return array<string, mixed>
1327
*/
@@ -55,15 +69,15 @@ public static function info(): array
5569
],
5670
'clients' => [
5771
'cli' => [
58-
'supported_versions' => '0.1.x',
72+
'supported_versions' => self::SUPPORTED_SDK_VERSIONS['cli'],
5973
'requires' => [
6074
'auth_composition.version',
6175
'control_plane.version',
6276
'control_plane.request_contract',
6377
],
6478
],
6579
'sdk-python' => [
66-
'supported_versions' => '0.2.x',
80+
'supported_versions' => self::SUPPORTED_SDK_VERSIONS['python'],
6781
'requires' => [
6882
'auth_composition.version',
6983
'control_plane.version',

tests/Feature/ClusterInfoCompatibilityTest.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,17 @@ public function test_cluster_info_names_protocol_manifests_as_client_compatibili
119119
'client_compatibility.required_protocols.worker_protocol.external_task_result_contract.version',
120120
1,
121121
)
122-
->assertJsonPath('client_compatibility.clients.cli.supported_versions', '0.1.x')
123-
->assertJsonPath('client_compatibility.clients.sdk-python.supported_versions', '0.2.x');
122+
->assertJsonPath('client_compatibility.clients.cli.supported_versions', '>=0.1,<1.0')
123+
->assertJsonPath('client_compatibility.clients.sdk-python.supported_versions', '>=0.2,<1.0');
124+
125+
$this->assertSame(
126+
$response->json('supported_sdk_versions.cli'),
127+
$response->json('client_compatibility.clients.cli.supported_versions'),
128+
);
129+
$this->assertSame(
130+
$response->json('supported_sdk_versions.python'),
131+
$response->json('client_compatibility.clients.sdk-python.supported_versions'),
132+
);
124133

125134
$this->assertContains(
126135
'auth_composition.version',

0 commit comments

Comments
 (0)