Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,17 @@ jobs:
name: License Header and Formatting Checks
runs-on: ubuntu-latest
container:
image: swift
image: swiftlang/swift:nightly-6.0-jammy
steps:
- uses: actions/checkout@v4
- uses: actions/cache/restore@v4
with:
path: scripts/.swift-format-source
key: ${{ runner.os }}-swift-format
- name: "Formatting and License Headers check"
- name: "Checkout repository"
uses: actions/checkout@v4
- name: Mark the workspace as safe
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
- name: "Install protoc"
run: apt update && apt install -y protobuf-compiler
- name: "Formatting, License Headers, and Generated Code check"
run: |
./scripts/sanity.sh
- uses: actions/cache/save@v4
with:
path: scripts/.swift-format-source
key: ${{ runner.os }}-swift-format
unit-tests:
strategy:
fail-fast: false
Expand Down
2 changes: 1 addition & 1 deletion Protos/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ function generate_reflection_service {
mv "$output_v1/reflection.grpc.swift" "$output_v1/reflection-v1.grpc.swift"

local proto_v1alpha="$here/upstream/grpc/reflection/v1alpha/reflection.proto"
local output_v1alpha="$root/Sources/GRPCReflectionService/v1alpha"
local output_v1alpha="$root/Sources/GRPCReflectionService/v1Alpha"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

FWIW this wasn't an issue on macOS as AFPS is case-insensitive by default.


# Messages were accidentally leaked into public API, they shouldn't be but we
# can't undo that change until the next major version.
Expand Down
38 changes: 19 additions & 19 deletions Sources/Examples/v2/Echo/Generated/echo.grpc.swift
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,13 @@ extension ServiceDescriptor {
internal protocol Echo_EchoStreamingServiceProtocol: GRPCCore.RegistrableRPCService {
/// Immediately returns an echo of a request.
func get(request: ServerRequest.Stream<Echo_EchoRequest>) async throws -> ServerResponse.Stream<Echo_EchoResponse>

/// Splits a request into words and returns each word in a stream of messages.
func expand(request: ServerRequest.Stream<Echo_EchoRequest>) async throws -> ServerResponse.Stream<Echo_EchoResponse>

/// Collects a stream of messages and returns them concatenated when the caller closes.
func collect(request: ServerRequest.Stream<Echo_EchoRequest>) async throws -> ServerResponse.Stream<Echo_EchoResponse>

/// Streams back messages as they are received in an input stream.
func update(request: ServerRequest.Stream<Echo_EchoRequest>) async throws -> ServerResponse.Stream<Echo_EchoResponse>
}
Expand Down Expand Up @@ -142,13 +142,13 @@ extension Echo_Echo.StreamingServiceProtocol {
internal protocol Echo_EchoServiceProtocol: Echo_Echo.StreamingServiceProtocol {
/// Immediately returns an echo of a request.
func get(request: ServerRequest.Single<Echo_EchoRequest>) async throws -> ServerResponse.Single<Echo_EchoResponse>

/// Splits a request into words and returns each word in a stream of messages.
func expand(request: ServerRequest.Single<Echo_EchoRequest>) async throws -> ServerResponse.Stream<Echo_EchoResponse>

/// Collects a stream of messages and returns them concatenated when the caller closes.
func collect(request: ServerRequest.Stream<Echo_EchoRequest>) async throws -> ServerResponse.Single<Echo_EchoResponse>

/// Streams back messages as they are received in an input stream.
func update(request: ServerRequest.Stream<Echo_EchoRequest>) async throws -> ServerResponse.Stream<Echo_EchoResponse>
}
Expand All @@ -160,12 +160,12 @@ extension Echo_Echo.ServiceProtocol {
let response = try await self.get(request: ServerRequest.Single(stream: request))
return ServerResponse.Stream(single: response)
}

internal func expand(request: ServerRequest.Stream<Echo_EchoRequest>) async throws -> ServerResponse.Stream<Echo_EchoResponse> {
let response = try await self.expand(request: ServerRequest.Single(stream: request))
return response
}

internal func collect(request: ServerRequest.Stream<Echo_EchoRequest>) async throws -> ServerResponse.Stream<Echo_EchoResponse> {
let response = try await self.collect(request: request)
return ServerResponse.Stream(single: response)
Expand All @@ -182,7 +182,7 @@ internal protocol Echo_EchoClientProtocol: Sendable {
options: CallOptions,
_ body: @Sendable @escaping (ClientResponse.Single<Echo_EchoResponse>) async throws -> R
) async throws -> R where R: Sendable

/// Splits a request into words and returns each word in a stream of messages.
func expand<R>(
request: ClientRequest.Single<Echo_EchoRequest>,
Expand All @@ -191,7 +191,7 @@ internal protocol Echo_EchoClientProtocol: Sendable {
options: CallOptions,
_ body: @Sendable @escaping (ClientResponse.Stream<Echo_EchoResponse>) async throws -> R
) async throws -> R where R: Sendable

/// Collects a stream of messages and returns them concatenated when the caller closes.
func collect<R>(
request: ClientRequest.Stream<Echo_EchoRequest>,
Expand All @@ -200,7 +200,7 @@ internal protocol Echo_EchoClientProtocol: Sendable {
options: CallOptions,
_ body: @Sendable @escaping (ClientResponse.Single<Echo_EchoResponse>) async throws -> R
) async throws -> R where R: Sendable

/// Streams back messages as they are received in an input stream.
func update<R>(
request: ClientRequest.Stream<Echo_EchoRequest>,
Expand All @@ -226,7 +226,7 @@ extension Echo_Echo.ClientProtocol {
body
)
}

internal func expand<R>(
request: ClientRequest.Single<Echo_EchoRequest>,
options: CallOptions = .defaults,
Expand All @@ -240,7 +240,7 @@ extension Echo_Echo.ClientProtocol {
body
)
}

internal func collect<R>(
request: ClientRequest.Stream<Echo_EchoRequest>,
options: CallOptions = .defaults,
Expand All @@ -254,7 +254,7 @@ extension Echo_Echo.ClientProtocol {
body
)
}

internal func update<R>(
request: ClientRequest.Stream<Echo_EchoRequest>,
options: CallOptions = .defaults,
Expand All @@ -273,11 +273,11 @@ extension Echo_Echo.ClientProtocol {
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
internal struct Echo_EchoClient: Echo_Echo.ClientProtocol {
private let client: GRPCCore.GRPCClient

internal init(wrapping client: GRPCCore.GRPCClient) {
self.client = client
}

/// Immediately returns an echo of a request.
internal func get<R>(
request: ClientRequest.Single<Echo_EchoRequest>,
Expand All @@ -295,7 +295,7 @@ internal struct Echo_EchoClient: Echo_Echo.ClientProtocol {
handler: body
)
}

/// Splits a request into words and returns each word in a stream of messages.
internal func expand<R>(
request: ClientRequest.Single<Echo_EchoRequest>,
Expand All @@ -313,7 +313,7 @@ internal struct Echo_EchoClient: Echo_Echo.ClientProtocol {
handler: body
)
}

/// Collects a stream of messages and returns them concatenated when the caller closes.
internal func collect<R>(
request: ClientRequest.Stream<Echo_EchoRequest>,
Expand All @@ -331,7 +331,7 @@ internal struct Echo_EchoClient: Echo_Echo.ClientProtocol {
handler: body
)
}

/// Streams back messages as they are received in an input stream.
internal func update<R>(
request: ClientRequest.Stream<Echo_EchoRequest>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ extension Grpc_Testing_EmptyService.ClientProtocol {
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
public struct Grpc_Testing_EmptyServiceClient: Grpc_Testing_EmptyService.ClientProtocol {
private let client: GRPCCore.GRPCClient

public init(wrapping client: GRPCCore.GRPCClient) {
self.client = client
}
Expand Down
Loading
Loading