payload: {"action":"created","issue":{"url":"https://api.github.com/repos/grpc/grpc-swift/issues/402","repository_url":"https://api.github.com/repos/grpc/grpc-swift","labels_url":"https://api.github.com/repos/grpc/grpc-swift/issues/402/labels{/name}","comments_url":"https://api.github.com/repos/grpc/grpc-swift/issues/402/comments","events_url":"https://api.github.com/repos/grpc/grpc-swift/issues/402/events","html_url":"https://github.com/grpc/grpc-swift/pull/402","id":420218054,"node_id":"MDExOlB1bGxSZXF1ZXN0MjYwNTQ3MTM5","number":402,"title":"Allow generating test stubs separately from the client implementation","user":{"login":"mpetrov","id":357181,"node_id":"MDQ6VXNlcjM1NzE4MQ==","avatar_url":"https://avatars3.githubusercontent.com/u/357181?v=4","gravatar_id":"","url":"https://api.github.com/users/mpetrov","html_url":"https://github.com/mpetrov","followers_url":"https://api.github.com/users/mpetrov/followers","following_url":"https://api.github.com/users/mpetrov/following{/other_user}","gists_url":"https://api.github.com/users/mpetrov/gists{/gist_id}","starred_url":"https://api.github.com/users/mpetrov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpetrov/subscriptions","organizations_url":"https://api.github.com/users/mpetrov/orgs","repos_url":"https://api.github.com/users/mpetrov/repos","events_url":"https://api.github.com/users/mpetrov/events{/privacy}","received_events_url":"https://api.github.com/users/mpetrov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2019-03-12T21:39:42Z","updated_at":"2019-03-14T12:45:39Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/grpc/grpc-swift/pulls/402","html_url":"https://github.com/grpc/grpc-swift/pull/402","diff_url":"https://github.com/grpc/grpc-swift/pull/402.diff","patch_url":"https://github.com/grpc/grpc-swift/pull/402.patch"},"body":"This allows generating test stubs in a separate file. Previously test stubs would only be generated if `Client=false`.\r\n\r\nA new `ExtraModuleImports` option allows adding import statement for the implementation. This enables generating test stubs in a separate module from implementation files. The name of the implementation module might very depending on the build system, so it can't be reliably inferred.\r\n\r\nOne use case for this would be generating different bazel build targets: a `client` target that's usable in production, and a `stub` target that's `testonly = True` (and only usable from test targets).\r\n\r\nFor example, a client could be generated in a `echo_swift_grpc_client` module follows:\r\n```\r\nprotoc Sources/Examples/Echo/echo.proto \\\r\n--proto_path=Sources/Examples/Echo \\\r\n--plugin=.build/debug/protoc-gen-swift \\\r\n--plugin=.build/debug/protoc-gen-swiftgrpc \\\r\n--swiftgrpc_out=/tmp/echo_swift_grpc_client \\\r\n--swiftgrpc_opt=Client=true \\\r\n--swiftgrpc_opt=Server=false \\\r\n--swiftgrpc_opt=Visibility=Public\r\n```\r\n\r\nWith a separate module for test stubs:\r\n```\r\nprotoc Sources/Examples/Echo/echo.proto \\\r\n--proto_path=Sources/Examples/Echo \\\r\n--plugin=.build/debug/protoc-gen-swift \\\r\n--plugin=.build/debug/protoc-gen-swiftgrpc\\\r\n--swiftgrpc_out=/tmp/echo_swift_grpc_stub \\\r\n--swiftgrpc_opt=TestStubs=true \\\r\n--swiftgrpc_opt=Client=false \\\r\n--swiftgrpc_opt=Server=false \\\r\n--swiftgrpc_opt=ExtraModuleImports=echo_swift_grpc_client\r\n```"},"comment":{"url":"https://api.github.com/repos/grpc/grpc-swift/issues/comments/472837333","html_url":"https://github.com/grpc/grpc-swift/pull/402#issuecomment-472837333","issue_url":"https://api.github.com/repos/grpc/grpc-swift/issues/402","id":472837333,"node_id":"MDEyOklzc3VlQ29tbWVudDQ3MjgzNzMzMw==","user":{"login":"mpetrov","id":357181,"node_id":"MDQ6VXNlcjM1NzE4MQ==","avatar_url":"https://avatars3.githubusercontent.com/u/357181?v=4","gravatar_id":"","url":"https://api.github.com/users/mpetrov","html_url":"https://github.com/mpetrov","followers_url":"https://api.github.com/users/mpetrov/followers","following_url":"https://api.github.com/users/mpetrov/following{/other_user}","gists_url":"https://api.github.com/users/mpetrov/gists{/gist_id}","starred_url":"https://api.github.com/users/mpetrov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpetrov/subscriptions","organizations_url":"https://api.github.com/users/mpetrov/orgs","repos_url":"https://api.github.com/users/mpetrov/repos","events_url":"https://api.github.com/users/mpetrov/events{/privacy}","received_events_url":"https://api.github.com/users/mpetrov/received_events","type":"User","site_admin":false},"created_at":"2019-03-14T12:45:39Z","updated_at":"2019-03-14T12:45:39Z","author_association":"CONTRIBUTOR","body":"Thanks for the feedback @MrMage \r\n\r\nI split out the client generator updates (1.) in #403 since that's the bulk of the deltas in this PR.\r\n\r\nAn `Impls` or `Implementations` flag sounds good to me. I don't have strong preferences on naming, so happy to take suggestions.\r\n"}}
other: {"actor":{"display_login":"mpetrov"}}