Skip to content

chore: Port ContractTestService from Kitura to Hummingbird#110

Merged
keelerm84 merged 1 commit into
4.xfrom
mk/SDK-2666/contract-tests-hummingbird
Jul 15, 2026
Merged

chore: Port ContractTestService from Kitura to Hummingbird#110
keelerm84 merged 1 commit into
4.xfrom
mk/SDK-2666/contract-tests-hummingbird

Conversation

@keelerm84

@keelerm84 keelerm84 commented Jul 15, 2026

Copy link
Copy Markdown
Member

Kitura is archived and its transitive BlueSSLService uses the OpenSSL 1.1
SSL_get_peer_certificate API removed in OpenSSL 3, so the contract-test
service could not build on a modern Linux (Ubuntu 24.04 / OpenSSL 3) swift
container. Replace it with Hummingbird (swift-nio based, vendored BoringSSL).

The SDK-facing logic (CreateStreamReq, CallbackForwarder, EventSource usage) is
unchanged; only the HTTP server layer moves:

  • The 4 routes port to Hummingbird's async router.
  • Stream state moves to an actor (EventSource is Sendable).
  • DELETE / stops the service via graceful ServiceGroup shutdown.
  • URLSession/URLRequest are gated behind FoundationNetworking for Linux.

Verified: builds in the swift:6.1 Linux container (which Kitura could not) and
smoke-tested (GET / capabilities, 404/400 paths, graceful shutdown via DELETE /).
CI is unchanged: contract-tests still runs on macOS and validates the full
protocol against this service.


Note

Medium Risk
Full HTTP server swap for the contract harness; protocol-facing routes must stay compatible with existing macOS contract-tests despite async/concurrency changes.

Overview
Replaces the archived Kitura stack in ContractTestService with Hummingbird and the swift-server ecosystem so the contract-test binary builds on modern Linux (OpenSSL 3) while keeping the same SSE harness behavior.

Package.swift bumps to Swift 6.0, raises minimum OS versions for Hummingbird, swaps dependencies (Hummingbird, ServiceLifecycle, Logging, HTTPTypes), and pins a new Package.resolved graph (NIO/async-http-client instead of Kitura/OpenSSL 1.1).

main.swift reimplements the four control routes on Hummingbird’s async Router (ResponseEncodable, request.decode, HTTPError for 404). Active streams move from a DispatchQueue-guarded dictionary to a StreamStore actor; DELETE / triggers ServiceGroup graceful shutdown via a ShutdownHandle instead of Kitura.stop(). FoundationNetworking is imported on Linux for URLSession. CreateStreamReq, CallbackForwarder, and EventSource usage are intentionally unchanged.

Reviewed by Cursor Bugbot for commit 9e9fbe3. Bugbot is set up for automated code reviews on this repo. Configure here.

@keelerm84 keelerm84 force-pushed the mk/SDK-2666/contract-tests-hummingbird branch from 79ca9d3 to 6734207 Compare July 15, 2026 15:03
Kitura is archived and its transitive BlueSSLService uses the OpenSSL 1.1
`SSL_get_peer_certificate` API removed in OpenSSL 3, so the contract-test
service could not build on a modern Linux (Ubuntu 24.04 / OpenSSL 3) swift
container. Replace it with Hummingbird (swift-nio based, vendored BoringSSL).

The SDK-facing logic (CreateStreamReq, CallbackForwarder, EventSource usage) is
unchanged; only the HTTP server layer moves:
- The 4 routes port to Hummingbird's async router.
- Stream state moves to an actor (EventSource is Sendable).
- DELETE / stops the service via graceful ServiceGroup shutdown.
- URLSession/URLRequest are gated behind FoundationNetworking for Linux.

Verified: builds in the swift:6.1 Linux container (which Kitura could not) and
smoke-tested (GET / capabilities, 404/400 paths, graceful shutdown via DELETE /).
CI is unchanged: contract-tests still runs on macOS and validates the full
protocol against this service.
@keelerm84 keelerm84 force-pushed the mk/SDK-2666/contract-tests-hummingbird branch from 6734207 to 9e9fbe3 Compare July 15, 2026 15:09
@keelerm84 keelerm84 marked this pull request as ready for review July 15, 2026 15:36
@keelerm84 keelerm84 requested a review from a team as a code owner July 15, 2026 15:36
@keelerm84 keelerm84 merged commit 5d82ba0 into 4.x Jul 15, 2026
17 checks passed
@keelerm84 keelerm84 deleted the mk/SDK-2666/contract-tests-hummingbird branch July 15, 2026 20:30
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