Skip to content

Conversation

@dayaffe
Copy link
Contributor

@dayaffe dayaffe commented Nov 20, 2025

Issue #

Description of changes

Scope

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@dayaffe dayaffe requested a review from jbelkins November 20, 2025 22:54
Copy link
Contributor

@jbelkins jbelkins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See recommended adjustments to module membership. Also let's try to see if we can make the SwiftNIO client not depend on CRT.

.package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"),
.package(url: "https://github.com/open-telemetry/opentelemetry-swift", from: "1.13.0"),
.package(url: "https://github.com/swift-server/async-http-client.git", from: "1.26.0"),
.package(url: "https://github.com/swift-server/async-http-client.git", exact: "1.22.0"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just noting that this needs to be switched to from: for release...
IIRC this is exact for testing the minimum supported version?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup exactly, will switch it to from since we can see it passed all integration tests

"Smithy",
"SmithyHTTPAPI",
"SmithyTelemetry",
.product(name: "AwsCommonRuntimeKit", package: "aws-crt-swift"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This CRT dependency is not needed & should be removed.

(also, any "API" package shouldn't depend on an external implementation like CRT, per SRA)

}
/// Typealias for backward compatibility.
/// The actual implementation is now in SmithyTelemetry.
public typealias TelemetryContext = SmithyTelemetry.TelemetryContext
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check what appears in IDE help when you put the cursor on ClientRuntime.TelemetryContext.

We might need to preserve the original doc comment here.

import enum Smithy.URIScheme
import struct SmithyHTTPAPI.Headers

public class HttpClientConfiguration {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: HTTPClientConfiguration (note the caps)

As long as we're moving this to a new module, might as well make the naming consistent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a breaking change since it was a public class, so we'll have to bump the minimum

// All Rights Reserved.
//
// SPDX-License-Identifier: Apache-2.0
//
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Presuming these Sources/SmithyTelemetry files are all largely identical to the ones that were in ClientRuntime?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup

// SPDX-License-Identifier: Apache-2.0
//

import protocol Smithy.LogAgent
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't really bring Smithy.LogAgent into this module without a breaking change, can we?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dont think so

Package.swift Outdated
dependencies: [
"Smithy",
"SmithyHTTPAPI",
"SmithyHTTPClient",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SmithyHTTPClient depends on CRT, which means that SmithySwiftNIO depends on CRT.

We need to find a way to break that dependency.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use some CRT interfaces within this package, that is the likely cause of this dependency.

We've already replaced many of those - in particular, for GA I got rid of all the CRT references in generated code - but there are still some between modules in this package & aws-sdk-swift.

import struct Smithy.Attributes
import protocol Smithy.LogAgent
import struct Smithy.SwiftLogger
import SmithyTelemetry
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move DefaultTelemetry from ClientRuntime to SmithyTelemetry, then typealias it here to prevent the breaking change.

Even though it is technically an "implementation", it has no dependencies other than Smithy and SmithyTelemetry so SmithyTelemetry is the right place for it.

Also, consider renaming SmithyTelemetry to SmithyTelemetryAPI, which would follow the SRA naming pattern for packages that contain interfaces but not implementations (at least not implementations with dependencies.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@jbelkins jbelkins self-requested a review November 24, 2025 21:34
@dayaffe dayaffe merged commit 8e67c51 into feat/async-http Nov 24, 2025
30 checks passed
@dayaffe dayaffe deleted the day/refactor-swift-nio branch November 24, 2025 21:36
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