Skip to content

[SDTEST-3768] Async API wrappers for the test-optimization backend#251

Merged
ypopovych merged 1 commit into
mainfrom
SDTEST-3768-async-api-wrappers
May 15, 2026
Merged

[SDTEST-3768] Async API wrappers for the test-optimization backend#251
ypopovych merged 1 commit into
mainfrom
SDTEST-3768-async-api-wrappers

Conversation

@ypopovych

@ypopovych ypopovych commented May 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds a typed-throwing async API layer under Sources/EventsExporter/API/ (SettingsApi, KnownTestsApi, GitUploadApi, TestImpactAnalysisApi, TestManagementApi, SpansApi, LogsApi) composed by TestOptimizationApiService. All methods use async throws(APICallError) (or HTTPClient.RequestError at the transport boundary).
  • Deletes the four sync service classes (SettingsService, KnownTestsService, TestManagementService, ITRService) and the legacy *Format.swift payload types. EventsExporter now owns a single TestOptimizationApiService and drives it from its synchronous public surface via waitForAsync.
  • Moves waitForAsync from DatadogSDKTesting into EventsExporter/Utils/Async.swift so the exporter can call it directly, removing the cross-module dependency for the bridge.
  • Relocates the transport primitives (HTTPClient, HTTPHeader, Endpoint, MultipartFormURLRequest) into the API/ group alongside their consumers. HTTPClient.RequestError.http now carries response headers; APICallError.encoding carries the offending any Encodable; APICallError.decoding carries the raw body so LibraryConfigurationCommunicationError.responseDecodingFailed(body:error:) can preserve the response payload end-to-end.
  • Public types kept compatible: TracerSettings (with EFD.TimeTable), SkipTests/SkipTestPublicFormat, KnownTestsResult/KnownTestsPageInfo/KnownTestsMap, TestManagementTestsInfo, ITRTestLevel, LibraryConfigurationCommunicationError. Pagination for known tests is preserved.

Test plan

  • xcodebuild test for EventsExporter on macOS arm64 — 95/95 passing
  • xcodebuild test for DatadogSDKTesting on macOS arm64 — 360/360 passing
  • Updated LibraryConfigurationServiceThrowTests to drive EventsExporter directly; the success-path test uses a new request-id-echoing mock server to satisfy the restored isIdValid check
  • Manual smoke run on a real CI build to verify backend communication

🤖 Generated with Claude Code

…backend

Replace the four synchronous service classes (Settings, KnownTests,
TestManagement, ITR) with a typed-throwing async API layer under
Sources/EventsExporter/API/. The new TestOptimizationApiService composes
SettingsApi/KnownTestsApi/GitUploadApi/TestImpactAnalysisApi/
TestManagementApi/SpansApi/LogsApi; EventsExporter drives them
synchronously through waitForAsync, which moves from DatadogSDKTesting
into EventsExporter/Utils/Async.swift so it can be shared.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@ypopovych
ypopovych requested review from a team as code owners May 14, 2026 17:43
@ypopovych
ypopovych requested a review from calvinbayer May 14, 2026 17:46
@ypopovych
ypopovych merged commit 03fd3cd into main May 15, 2026
17 checks passed
@ypopovych
ypopovych deleted the SDTEST-3768-async-api-wrappers branch May 15, 2026 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants