Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update references for conformance #158

Closed
wants to merge 10 commits into from
Closed
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
2 changes: 2 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ To update dependencies such as `SwiftProtobuf` in this repository:
[`Connect-Swift-Mocks.podspec`](../Connect-Swift-Mocks.podspec) files.
4. Open the [Swift package example app](../Examples/ElizaSwiftPackageApp) to ensure its `Package.resolved` file gets updated.
5. Run `pod update` in the [CocoaPods example app's directory](../Examples/ElizaCocoaPodsApp).
6. Update remote plugin entries (such as `buf.build/apple/swift`) in all `buf.gen.yaml` files to be in sync with their respective runtime libraries.
7. Run `make generate` to apply any generated diffs from the newly updated plugins.

## Releasing

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- uses: bufbuild/buf-setup-action@v1.22.0
- uses: bufbuild/buf-setup-action@v1.26.1
with:
github_token: ${{ github.token }}
- name: Build plugins
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- uses: bufbuild/buf-setup-action@v1.22.0
- uses: bufbuild/buf-setup-action@v1.26.1
with:
github_token: ${{ github.token }}
- name: Build plugins
Expand Down
2 changes: 1 addition & 1 deletion Connect-Swift-Mocks.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Pod::Spec.new do |spec|
spec.tvos.deployment_target = '13.0'

spec.dependency 'Connect-Swift', "#{spec.version.to_s}"
spec.dependency 'SwiftProtobuf', '~> 1.22.0'
spec.dependency 'SwiftProtobuf', '~> 1.23.0'

spec.source_files = 'Libraries/ConnectMocks/**/*.swift'

Expand Down
2 changes: 1 addition & 1 deletion Connect-Swift.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Pod::Spec.new do |spec|
spec.osx.deployment_target = '10.15'
spec.tvos.deployment_target = '13.0'

spec.dependency 'SwiftProtobuf', '~> 1.22.0'
spec.dependency 'SwiftProtobuf', '~> 1.23.0'

spec.source_files = 'Libraries/Connect/**/*.swift'

Expand Down
8 changes: 4 additions & 4 deletions Examples/ElizaCocoaPodsApp/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PODS:
- Connect-Swift (0.6.0):
- SwiftProtobuf (~> 1.22.0)
- SwiftProtobuf (1.22.0)
- SwiftProtobuf (~> 1.23.0)
- SwiftProtobuf (1.23.0)

DEPENDENCIES:
- Connect-Swift (from `../..`)
Expand All @@ -15,8 +15,8 @@ EXTERNAL SOURCES:
:path: "../.."

SPEC CHECKSUMS:
Connect-Swift: ba76bc64b2153cacce4f7985a21d4d81473dac90
SwiftProtobuf: 40bd808372cb8706108f22d28f8ab4a6b9bc6989
Connect-Swift: ca072ef1a95341460bcc08074fc5d46ecc055fb9
SwiftProtobuf: b70d65f419fbfe61a2d58003456ca5da58e337d6

PODFILE CHECKSUM: b598f373a6ab5add976b09c2ac79029bf2200d48

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-protobuf.git",
"state" : {
"revision" : "f25867a208f459d3c5a06935dceb9083b11cd539",
"version" : "1.22.0"
"revision" : "cf62cdaea48b77f1a631e5cb3aeda6047c2cba1d",
"version" : "1.23.0"
}
}
],
Expand Down
2 changes: 1 addition & 1 deletion Examples/buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: v1
plugins:
- plugin: buf.build/apple/swift
- plugin: buf.build/apple/swift:v1.23.0
opt: Visibility=Internal
out: ./ElizaSharedSources/GeneratedSources
- name: connect-swift
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import Foundation
/// Stream implementation that wraps a `URLSession` stream.
final class URLSessionStream: NSObject {
private var closedByServer = false
private let readStream: Foundation.InputStream
private let responseCallbacks: ResponseCallbacks
private let task: URLSessionUploadTask
private let writeStream: Foundation.OutputStream
Expand All @@ -26,6 +27,10 @@ final class URLSessionStream: NSObject {
case unableToWriteData
}

var requestBodyStream: Foundation.InputStream {
return self.readStream
}

var taskID: Int {
return self.task.taskIdentifier
}
Expand All @@ -44,11 +49,8 @@ final class URLSessionStream: NSObject {
)

self.responseCallbacks = responseCallbacks
self.readStream = readStream
self.writeStream = writeStream

var request = request
request.httpBodyStream = readStream

self.task = session.uploadTask(withStreamedRequest: request)
super.init()

Expand Down
9 changes: 9 additions & 0 deletions Libraries/Connect/Implementation/URLSessionHTTPClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,15 @@ extension URLSessionHTTPClient: URLSessionDataDelegate {
let stream = self.lock.perform { self.streams[dataTask.taskIdentifier] }
stream?.handleResponseData(data)
}

open func urlSession(
_ session: URLSession, task: URLSessionTask,
needNewBodyStream completionHandler: @escaping (InputStream?) -> Void
) {
completionHandler(
self.lock.perform { self.streams[task.taskIdentifier]?.requestBodyStream }
)
}
}

extension URLSessionHTTPClient: URLSessionTaskDelegate {
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Connect/buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version: v1
plugins:
- plugin: buf.build/apple/swift
- plugin: buf.build/apple/swift:v1.23.0
opt: Visibility=Internal
out: ./Implementation/Generated
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ MAKEFLAGS += --no-builtin-rules
MAKEFLAGS += --no-print-directory
BIN := .tmp/bin
LICENSE_HEADER_YEAR_RANGE := 2022-2023
CONFORMANCE_VERSION := 4f4e96d8fea3ed9473b90a964a5ba429e7ea5649
CONFORMANCE_VERSION := 0b07f579cb61ad89de24524d62f804a2b03b1acf
LICENSE_HEADER_VERSION := v1.12.0
LICENSE_IGNORE := -e Package.swift \
-e $(BIN)\/ \
Expand Down Expand Up @@ -57,7 +57,7 @@ conformanceserverrun: conformanceserverstop ## Start the conformance server
generate: cleangenerated ## Regenerate outputs for all .proto files
cd Examples; buf generate
cd Libraries/Connect; buf generate
cd Tests/ConnectLibraryTests; buf generate
cd Tests/ConnectLibraryTests; buf generate https://github.com/connectrpc/conformance.git#ref=$(CONFORMANCE_VERSION),subdir=proto

.PHONY: help
help: ## Describe useful make targets
Expand Down
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-protobuf.git",
"state" : {
"revision" : "f25867a208f459d3c5a06935dceb9083b11cd539",
"version" : "1.22.0"
"revision" : "cf62cdaea48b77f1a631e5cb3aeda6047c2cba1d",
"version" : "1.23.0"
}
}
],
Expand Down
4 changes: 1 addition & 3 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ let package = Package(
),
.package(
url: "https://github.com/apple/swift-protobuf.git",
from: "1.22.0"
from: "1.23.0"
),
],
targets: [
Expand Down Expand Up @@ -89,8 +89,6 @@ let package = Package(
path: "Tests/ConnectLibraryTests",
exclude: [
"buf.gen.yaml",
"buf.work.yaml",
"proto",
],
resources: [
.copy("TestResources"),
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ for details.
- [connect-go][connect-go]: Go service stubs for servers
- [connect-es][connect-es]: Type-safe APIs with Protobuf and TypeScript
- [Buf Studio][buf-studio]: Web UI for ad-hoc RPCs
- [connect-conformance][connect-conformance]: Connect, gRPC, and gRPC-Web
- [conformance][connect-conformance]: Connect, gRPC, and gRPC-Web
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- [conformance][connect-conformance]: Connect, gRPC, and gRPC-Web
- [connect-conformance][connect-conformance]: Connect, gRPC, and gRPC-Web

Copy link
Member Author

Choose a reason for hiding this comment

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

It was actually decided to use just conformance for this link (see here and here). But I can make the link reference also be conformance for consistency if you like?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't have a super strong opinion, good to keep it consistent across repos

interoperability tests

## Status
Expand Down
Loading
Loading