Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: grpc/grpc-node
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: @grpc/grpc-js@1.12.6
Choose a base ref
...
head repository: grpc/grpc-node
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: @grpc/grpc-js@1.13.0
Choose a head ref
Loading
Showing with 8,043 additions and 2,569 deletions.
  1. +7 −7 .github/workflows/grpc-tools-build.yml
  2. +0 −1 README.md
  3. +5 −3 doc/environment_variables.md
  4. +57 −0 examples/retry/README.md
  5. +75 −0 examples/retry/client.js
  6. +73 −0 examples/retry/server.js
  7. +1 −1 gulpfile.ts
  8. +1 −0 packages/grpc-health-check/package.json
  9. +2 −1 packages/grpc-js-xds/README.md
  10. +1 −1 packages/grpc-js-xds/deps/envoy-api
  11. +9 −1 packages/grpc-js-xds/gulpfile.ts
  12. +9 −2 packages/grpc-js-xds/interop/{Dockerfile → test-client.Dockerfile}
  13. +54 −0 packages/grpc-js-xds/interop/test-server.Dockerfile
  14. +10 −7 packages/grpc-js-xds/interop/xds-interop-client.ts
  15. +314 −0 packages/grpc-js-xds/interop/xds-interop-server.ts
  16. +6 −3 packages/grpc-js-xds/package.json
  17. +3 −2 packages/grpc-js-xds/scripts/psm-interop-build-node.sh
  18. +6 −0 packages/grpc-js-xds/scripts/xds.sh
  19. +1 −0 packages/grpc-js-xds/src/environment.ts
  20. +3 −0 packages/grpc-js-xds/src/generated/ads.ts
  21. +6 −0 packages/grpc-js-xds/src/generated/cluster.ts
  22. +4 −0 packages/grpc-js-xds/src/generated/csds.ts
  23. +6 −0 packages/grpc-js-xds/src/generated/endpoint.ts
  24. +1 −1 packages/grpc-js-xds/src/generated/envoy/config/accesslog/v3/AccessLog.ts
  25. +1 −1 packages/grpc-js-xds/src/generated/envoy/config/accesslog/v3/AccessLogFilter.ts
  26. +1 −1 packages/grpc-js-xds/src/generated/envoy/config/accesslog/v3/ExtensionFilter.ts
  27. +63 −23 packages/grpc-js-xds/src/generated/envoy/config/cluster/v3/Cluster.ts
  28. +27 −6 packages/grpc-js-xds/src/generated/envoy/config/cluster/v3/OutlierDetection.ts
  29. +65 −0 packages/grpc-js-xds/src/generated/envoy/config/cluster/v3/UpstreamConnectionOptions.ts
  30. +1 −1 packages/grpc-js-xds/src/generated/envoy/config/core/v3/Address.ts
  31. +4 −9 packages/grpc-js-xds/src/generated/envoy/config/core/v3/ApiVersion.ts
  32. +1 −1 packages/grpc-js-xds/src/generated/envoy/config/core/v3/AsyncDataSource.ts
  33. +1 −1 packages/grpc-js-xds/src/generated/envoy/config/core/v3/ConfigSource.ts
  34. +38 −1 packages/grpc-js-xds/src/generated/envoy/config/core/v3/DataSource.ts
  35. +1 −1 packages/grpc-js-xds/src/generated/envoy/config/core/v3/EnvoyInternalAddress.ts
  36. +1 −1 packages/grpc-js-xds/src/generated/envoy/config/core/v3/EventServiceConfig.ts
  37. +52 −8 packages/grpc-js-xds/src/generated/envoy/config/core/v3/GrpcService.ts
  38. +34 −5 packages/grpc-js-xds/src/generated/envoy/config/core/v3/HealthCheck.ts
  39. +1 −1 packages/grpc-js-xds/src/generated/envoy/config/core/v3/Http1ProtocolOptions.ts
  40. +4 −4 packages/grpc-js-xds/src/generated/envoy/config/core/v3/Http2ProtocolOptions.ts
  41. +20 −2 packages/grpc-js-xds/src/generated/envoy/config/core/v3/Http3ProtocolOptions.ts
  42. +6 −8 packages/grpc-js-xds/src/generated/envoy/config/core/v3/HttpProtocolOptions.ts
  43. +1 −1 packages/grpc-js-xds/src/generated/envoy/config/core/v3/HttpUri.ts
  44. +24 −0 packages/grpc-js-xds/src/generated/envoy/config/core/v3/KeyValue.ts
  45. +109 −0 packages/grpc-js-xds/src/generated/envoy/config/core/v3/KeyValueAppend.ts
  46. +31 −0 packages/grpc-js-xds/src/generated/envoy/config/core/v3/KeyValueMutation.ts
  47. +1 −1 packages/grpc-js-xds/src/generated/envoy/config/core/v3/Node.ts
  48. +23 −8 packages/grpc-js-xds/src/generated/envoy/config/core/v3/QuicProtocolOptions.ts
  49. +72 −0 packages/grpc-js-xds/src/generated/envoy/config/core/v3/RetryPolicy.ts
  50. +17 −1 packages/grpc-js-xds/src/generated/envoy/config/core/v3/SchemeHeaderTransformation.ts
  51. +1 −1 packages/grpc-js-xds/src/generated/envoy/config/core/v3/SocketAddress.ts
  52. +1 −1 packages/grpc-js-xds/src/generated/envoy/config/core/v3/SocketOption.ts
  53. +1 −1 packages/grpc-js-xds/src/generated/envoy/config/core/v3/SubstitutionFormatString.ts
  54. +1 −1 packages/grpc-js-xds/src/generated/envoy/config/core/v3/TransportSocket.ts
  55. +12 −0 packages/grpc-js-xds/src/generated/envoy/config/endpoint/v3/ClusterLoadAssignment.ts
  56. +1 −1 packages/grpc-js-xds/src/generated/envoy/config/endpoint/v3/LbEndpoint.ts
  57. +12 −3 packages/grpc-js-xds/src/generated/envoy/config/endpoint/v3/LocalityLbEndpoints.ts
  58. +33 −0 packages/grpc-js-xds/src/generated/envoy/config/endpoint/v3/UnnamedEndpointLoadMetricStats.ts
  59. +93 −4 packages/grpc-js-xds/src/generated/envoy/config/endpoint/v3/UpstreamLocalityStats.ts
  60. +1 −1 packages/grpc-js-xds/src/generated/envoy/config/listener/v3/Filter.ts
  61. +12 −4 packages/grpc-js-xds/src/generated/envoy/config/listener/v3/Listener.ts
  62. +1 −1 packages/grpc-js-xds/src/generated/envoy/config/listener/v3/ListenerFilter.ts
  63. +1 −1 packages/grpc-js-xds/src/generated/envoy/config/listener/v3/ListenerFilterChainMatchPredicate.ts
  64. +27 −4 packages/grpc-js-xds/src/generated/envoy/config/listener/v3/QuicProtocolOptions.ts
  65. +13 −3 packages/grpc-js-xds/src/generated/envoy/config/route/v3/CorsPolicy.ts
  66. +1 −1 packages/grpc-js-xds/src/generated/envoy/config/route/v3/HeaderMatcher.ts
  67. +1 −1 packages/grpc-js-xds/src/generated/envoy/config/route/v3/QueryParameterMatcher.ts
  68. +2 −2 packages/grpc-js-xds/src/generated/envoy/config/route/v3/RateLimit.ts
  69. +2 −2 packages/grpc-js-xds/src/generated/envoy/config/route/v3/RedirectAction.ts
  70. +2 −2 packages/grpc-js-xds/src/generated/envoy/config/route/v3/RetryPolicy.ts
  71. +1 −1 packages/grpc-js-xds/src/generated/envoy/config/route/v3/Route.ts
  72. +17 −9 packages/grpc-js-xds/src/generated/envoy/config/route/v3/RouteAction.ts
  73. +1 −1 packages/grpc-js-xds/src/generated/envoy/config/route/v3/RouteMatch.ts
  74. +1 −1 packages/grpc-js-xds/src/generated/envoy/config/route/v3/ScopedRouteConfiguration.ts
  75. +2 −2 packages/grpc-js-xds/src/generated/envoy/config/route/v3/WeightedCluster.ts
  76. +1 −1 packages/grpc-js-xds/src/generated/envoy/config/trace/v3/Tracing.ts
  77. +10 −2 packages/grpc-js-xds/src/generated/envoy/data/accesslog/v3/ResponseFlags.ts
  78. +1 −1 packages/grpc-js-xds/src/generated/envoy/data/accesslog/v3/TLSProperties.ts
  79. +1 −1 packages/grpc-js-xds/src/generated/envoy/extensions/filters/common/fault/v3/FaultDelay.ts
  80. +1 −1 packages/grpc-js-xds/src/generated/envoy/extensions/filters/common/fault/v3/FaultRateLimit.ts
  81. +1 −1 packages/grpc-js-xds/src/generated/envoy/extensions/filters/http/fault/v3/FaultAbort.ts
  82. +23 −11 ...rc/generated/envoy/extensions/filters/network/http_connection_manager/v3/HttpConnectionManager.ts
  83. +1 −1 ...pc-js-xds/src/generated/envoy/extensions/filters/network/http_connection_manager/v3/HttpFilter.ts
  84. +3 −3 ...-js-xds/src/generated/envoy/extensions/filters/network/http_connection_manager/v3/ScopedRoutes.ts
  85. +1 −1 .../grpc-js-xds/src/generated/envoy/extensions/load_balancing_policies/common/v3/LocalityLbConfig.ts
  86. +52 −0 ...-xds/src/generated/envoy/extensions/transport_sockets/tls/v3/CertificateProviderPluginInstance.ts
  87. +494 −0 ...pc-js-xds/src/generated/envoy/extensions/transport_sockets/tls/v3/CertificateValidationContext.ts
  88. +387 −0 packages/grpc-js-xds/src/generated/envoy/extensions/transport_sockets/tls/v3/CommonTlsContext.ts
  89. +191 −0 packages/grpc-js-xds/src/generated/envoy/extensions/transport_sockets/tls/v3/DownstreamTlsContext.ts
  90. +17 −0 packages/grpc-js-xds/src/generated/envoy/extensions/transport_sockets/tls/v3/GenericSecret.ts
  91. +51 −0 packages/grpc-js-xds/src/generated/envoy/extensions/transport_sockets/tls/v3/PrivateKeyProvider.ts
  92. +23 −0 packages/grpc-js-xds/src/generated/envoy/extensions/transport_sockets/tls/v3/SdsSecretConfig.ts
  93. +36 −0 packages/grpc-js-xds/src/generated/envoy/extensions/transport_sockets/tls/v3/Secret.ts
  94. +102 −0 ...ages/grpc-js-xds/src/generated/envoy/extensions/transport_sockets/tls/v3/SubjectAltNameMatcher.ts
  95. +159 −0 packages/grpc-js-xds/src/generated/envoy/extensions/transport_sockets/tls/v3/TlsCertificate.ts
  96. +45 −0 packages/grpc-js-xds/src/generated/envoy/extensions/transport_sockets/tls/v3/TlsKeyLog.ts
  97. +304 −0 packages/grpc-js-xds/src/generated/envoy/extensions/transport_sockets/tls/v3/TlsParameters.ts
  98. +61 −0 packages/grpc-js-xds/src/generated/envoy/extensions/transport_sockets/tls/v3/TlsSessionTicketKeys.ts
  99. +91 −0 packages/grpc-js-xds/src/generated/envoy/extensions/transport_sockets/tls/v3/UpstreamTlsContext.ts
  100. +2 −2 packages/grpc-js-xds/src/generated/envoy/service/discovery/v3/DynamicParameterConstraints.ts
  101. +1 −1 packages/grpc-js-xds/src/generated/envoy/service/status/v3/PerXdsConfig.ts
  102. +1 −1 packages/grpc-js-xds/src/generated/envoy/type/http/v3/PathTransformation.ts
  103. +1 −1 packages/grpc-js-xds/src/generated/envoy/type/matcher/v3/DoubleMatcher.ts
  104. +1 −1 packages/grpc-js-xds/src/generated/envoy/type/matcher/v3/ListMatcher.ts
  105. +1 −1 packages/grpc-js-xds/src/generated/envoy/type/matcher/v3/MetadataMatcher.ts
  106. +1 −1 packages/grpc-js-xds/src/generated/envoy/type/matcher/v3/RegexMatcher.ts
  107. +15 −4 packages/grpc-js-xds/src/generated/envoy/type/matcher/v3/StringMatcher.ts
  108. +1 −1 packages/grpc-js-xds/src/generated/envoy/type/matcher/v3/StructMatcher.ts
  109. +1 −1 packages/grpc-js-xds/src/generated/envoy/type/matcher/v3/ValueMatcher.ts
  110. +1 −1 packages/grpc-js-xds/src/generated/envoy/type/metadata/v3/MetadataKey.ts
  111. +1 −1 packages/grpc-js-xds/src/generated/envoy/type/metadata/v3/MetadataKind.ts
  112. +1 −1 packages/grpc-js-xds/src/generated/envoy/type/tracing/v3/CustomTag.ts
  113. +3 −0 packages/grpc-js-xds/src/generated/fault.ts
  114. +1 −1 packages/grpc-js-xds/src/generated/google/api/HttpRule.ts
  115. +3 −0 packages/grpc-js-xds/src/generated/google/protobuf/EnumOptions.ts
  116. +7 −0 packages/grpc-js-xds/src/generated/google/protobuf/EnumValueOptions.ts
  117. +15 −0 packages/grpc-js-xds/src/generated/google/protobuf/FieldOptions.ts
  118. +6 −0 packages/grpc-js-xds/src/generated/google/protobuf/FileOptions.ts
  119. +11 −0 packages/grpc-js-xds/src/generated/google/protobuf/MessageOptions.ts
  120. +2 −0 packages/grpc-js-xds/src/generated/google/protobuf/OneofOptions.ts
  121. +1 −1 packages/grpc-js-xds/src/generated/google/protobuf/Value.ts
  122. +3 −0 packages/grpc-js-xds/src/generated/http_connection_manager.ts
  123. +3 −0 packages/grpc-js-xds/src/generated/listener.ts
  124. +4 −0 packages/grpc-js-xds/src/generated/lrs.ts
  125. +3 −0 packages/grpc-js-xds/src/generated/ring_hash.ts
  126. +3 −0 packages/grpc-js-xds/src/generated/route.ts
  127. +202 −0 packages/grpc-js-xds/src/generated/tls.ts
  128. +1 −1 packages/grpc-js-xds/src/generated/validate/BytesRules.ts
  129. +1 −1 packages/grpc-js-xds/src/generated/validate/FieldRules.ts
  130. +1 −1 packages/grpc-js-xds/src/generated/validate/StringRules.ts
  131. +6 −0 packages/grpc-js-xds/src/generated/wrr_locality.ts
  132. +1 −1 packages/grpc-js-xds/src/generated/xds/core/v3/CollectionEntry.ts
  133. +2 −2 packages/grpc-js-xds/src/generated/xds/core/v3/ResourceLocator.ts
  134. +5 −5 packages/grpc-js-xds/src/generated/xds/type/matcher/v3/Matcher.ts
  135. +1 −1 packages/grpc-js-xds/src/generated/xds/type/matcher/v3/RegexMatcher.ts
  136. +1 −1 packages/grpc-js-xds/src/generated/xds/type/matcher/v3/StringMatcher.ts
  137. +7 −2 packages/grpc-js-xds/src/index.ts
  138. +337 −176 packages/grpc-js-xds/src/load-balancer-cds.ts
  139. +27 −16 packages/grpc-js-xds/src/load-balancer-priority.ts
  140. +55 −40 packages/grpc-js-xds/src/load-balancer-ring-hash.ts
  141. +18 −12 packages/grpc-js-xds/src/load-balancer-weighted-target.ts
  142. +50 −68 packages/grpc-js-xds/src/load-balancer-xds-cluster-impl.ts
  143. +22 −15 packages/grpc-js-xds/src/load-balancer-xds-cluster-manager.ts
  144. +0 −508 packages/grpc-js-xds/src/load-balancer-xds-cluster-resolver.ts
  145. +6 −6 packages/grpc-js-xds/src/load-balancer-xds-wrr-locality.ts
  146. +130 −263 packages/grpc-js-xds/src/resolver-xds.ts
  147. +22 −5 packages/grpc-js-xds/src/resources.ts
  148. +2 −0 packages/grpc-js-xds/src/route.ts
  149. +33 −0 packages/grpc-js-xds/src/server-listener.ts
  150. +60 −6 packages/grpc-js-xds/src/server.ts
  151. +1 −1 packages/grpc-js-xds/src/xds-bootstrap.ts
  152. +26 −3 packages/grpc-js-xds/src/xds-client.ts
  153. +79 −0 packages/grpc-js-xds/src/xds-credentials.ts
  154. +826 −0 packages/grpc-js-xds/src/xds-dependency-manager.ts
  155. +260 −82 packages/grpc-js-xds/src/xds-resource-type/cluster-resource-type.ts
  156. +52 −44 packages/grpc-js-xds/src/xds-resource-type/endpoint-resource-type.ts
  157. +169 −51 packages/grpc-js-xds/src/xds-resource-type/listener-resource-type.ts
  158. +75 −47 packages/grpc-js-xds/src/xds-resource-type/route-config-resource-type.ts
  159. +14 −1 packages/grpc-js-xds/src/xds-resource-type/xds-resource-type.ts
  160. +6 −4 packages/grpc-js-xds/test/backend.ts
  161. +6 −6 packages/grpc-js-xds/test/client.ts
  162. +17 −0 packages/grpc-js-xds/test/fixtures/ca.pem
  163. +16 −0 packages/grpc-js-xds/test/fixtures/server1.key
  164. +17 −0 packages/grpc-js-xds/test/fixtures/server1.pem
  165. +19 −4 packages/grpc-js-xds/test/framework.ts
  166. +5 −170 packages/grpc-js-xds/test/test-confg-parsing.ts
  167. +65 −2 packages/grpc-js-xds/test/test-core.ts
  168. +7 −7 packages/grpc-js-xds/test/test-custom-lb-policies.ts
  169. +505 −0 packages/grpc-js-xds/test/test-xds-credentials.ts
  170. +14 −1 packages/grpc-js-xds/test/xds-server.ts
  171. +1 −0 packages/grpc-js/README.md
  172. +1 −1 packages/grpc-js/package.json
  173. +25 −1 packages/grpc-js/src/backoff-timeout.ts
  174. +13 −7 packages/grpc-js/src/certificate-provider.ts
  175. +262 −96 packages/grpc-js/src/channel-credentials.ts
  176. +2 −0 packages/grpc-js/src/channel-options.ts
  177. +20 −5 packages/grpc-js/src/channelz.ts
  178. +2 −1 packages/grpc-js/src/experimental.ts
  179. +1 −1 packages/grpc-js/src/generated/channelz.ts
  180. +2 −2 packages/grpc-js/src/generated/grpc/channelz/v1/Address.ts
  181. +4 −4 packages/grpc-js/src/generated/grpc/channelz/v1/Channel.ts
  182. +3 −3 packages/grpc-js/src/generated/grpc/channelz/v1/ChannelData.ts
  183. +2 −2 packages/grpc-js/src/generated/grpc/channelz/v1/ChannelTrace.ts
  184. +4 −4 packages/grpc-js/src/generated/grpc/channelz/v1/ChannelTraceEvent.ts
  185. +14 −14 packages/grpc-js/src/generated/grpc/channelz/v1/Channelz.ts
  186. +1 −1 packages/grpc-js/src/generated/grpc/channelz/v1/GetChannelResponse.ts
  187. +1 −1 packages/grpc-js/src/generated/grpc/channelz/v1/GetServerResponse.ts
  188. +1 −1 packages/grpc-js/src/generated/grpc/channelz/v1/GetServerSocketsResponse.ts
  189. +1 −1 packages/grpc-js/src/generated/grpc/channelz/v1/GetServersResponse.ts
  190. +1 −1 packages/grpc-js/src/generated/grpc/channelz/v1/GetSocketResponse.ts
  191. +1 −1 packages/grpc-js/src/generated/grpc/channelz/v1/GetSubchannelResponse.ts
  192. +1 −1 packages/grpc-js/src/generated/grpc/channelz/v1/GetTopChannelsResponse.ts
  193. +3 −3 packages/grpc-js/src/generated/grpc/channelz/v1/Security.ts
  194. +3 −3 packages/grpc-js/src/generated/grpc/channelz/v1/Server.ts
  195. +2 −2 packages/grpc-js/src/generated/grpc/channelz/v1/ServerData.ts
  196. +4 −4 packages/grpc-js/src/generated/grpc/channelz/v1/Socket.ts
  197. +3 −3 packages/grpc-js/src/generated/grpc/channelz/v1/SocketData.ts
  198. +1 −1 packages/grpc-js/src/generated/grpc/channelz/v1/SocketOption.ts
  199. +1 −1 packages/grpc-js/src/generated/grpc/channelz/v1/SocketOptionLinger.ts
  200. +1 −1 packages/grpc-js/src/generated/grpc/channelz/v1/SocketOptionTimeout.ts
  201. +4 −4 packages/grpc-js/src/generated/grpc/channelz/v1/Subchannel.ts
  202. +69 −71 packages/grpc-js/src/http_proxy.ts
  203. +2 −0 packages/grpc-js/src/index.ts
  204. +14 −34 packages/grpc-js/src/internal-channel.ts
  205. +9 −14 packages/grpc-js/src/load-balancer-child-handler.ts
  206. +11 −16 packages/grpc-js/src/load-balancer-outlier-detection.ts
  207. +50 −30 packages/grpc-js/src/load-balancer-pick-first.ts
  208. +18 −15 packages/grpc-js/src/load-balancer-round-robin.ts
  209. +11 −15 packages/grpc-js/src/load-balancer.ts
  210. +2 −2 packages/grpc-js/src/load-balancing-call.ts
  211. +2 −1 packages/grpc-js/src/resolver.ts
  212. +9 −3 packages/grpc-js/src/resolving-call.ts
  213. +53 −50 packages/grpc-js/src/resolving-load-balancer.ts
  214. +21 −6 packages/grpc-js/src/retrying-call.ts
  215. +38 −30 packages/grpc-js/src/server-credentials.ts
  216. +5 −0 packages/grpc-js/src/server-interceptors.ts
  217. +54 −14 packages/grpc-js/src/server.ts
  218. +9 −0 packages/grpc-js/src/subchannel-interface.ts
  219. +12 −6 packages/grpc-js/src/subchannel.ts
  220. +95 −185 packages/grpc-js/src/transport.ts
  221. +3 −0 packages/grpc-js/test/common.ts
  222. +1 −0 packages/grpc-js/test/fixtures/test_service.proto
  223. +172 −57 packages/grpc-js/test/test-channel-credentials.ts
  224. +97 −59 packages/grpc-js/test/test-pick-first.ts
  225. +12 −11 packages/grpc-js/test/test-server-credentials.ts
  226. +14 −1 packages/grpc-js/test/test-server-errors.ts
  227. +0 −1 packages/grpc-js/test/test-server-interceptors.ts
  228. +1 −1 packages/grpc-js/test/test-server.ts
  229. +1 −0 packages/grpc-reflection/package.json
  230. +4 −0 packages/grpc-tools/README.md
  231. +1 −1 packages/grpc-tools/package.json
  232. +15 −11 packages/grpc-tools/src/node_generator.cc
  233. +2 −0 packages/grpc-tools/src/node_generator.h
  234. +3 −0 packages/grpc-tools/src/node_plugin.cc
  235. +1 −1 packages/proto-loader/bin/proto-loader-gen-types.ts
  236. +1 −1 packages/proto-loader/golden-generated/google/api/HttpRule.ts
  237. +1 −1 packages/proto-loader/golden-generated/google/longrunning/Operation.ts
  238. +1 −1 packages/proto-loader/golden-generated/google/showcase/v1beta1/BlockRequest.ts
  239. +1 −1 packages/proto-loader/golden-generated/google/showcase/v1beta1/EchoRequest.ts
  240. +2 −2 packages/proto-loader/golden-generated/google/showcase/v1beta1/WaitRequest.ts
  241. +30 −0 test/kokoro/psm-security.cfg
14 changes: 7 additions & 7 deletions .github/workflows/grpc-tools-build.yml
Original file line number Diff line number Diff line change
@@ -8,9 +8,9 @@ on:
branches:
- master

permissions:
permissions:
contents: read # to fetch code (actions/checkout)


jobs:
linux_build:
name: Linux grpc-tools Build
@@ -23,7 +23,7 @@ jobs:
run: |
docker build -t kokoro-native-image tools/release/native
docker run -v /var/run/docker.sock:/var/run/docker.sock -v $GITHUB_WORKSPACE:$GITHUB_WORKSPACE kokoro-native-image $GITHUB_WORKSPACE/packages/grpc-tools/build_binaries.sh
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: grpc-tools_linux
path: artifacts/
@@ -36,7 +36,7 @@ jobs:
submodules: recursive
- name: Build
run: packages/grpc-tools/build_binaries.sh
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: grpc-tools_macos
path: artifacts/
@@ -55,7 +55,7 @@ jobs:
- name: Build
run: powershell -File ./packages/grpc-tools/build_binaries.ps1
shell: cmd
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
with:
name: grpc-tools_windows_${{matrix.arch}}
path: artifacts/
@@ -64,12 +64,12 @@ jobs:
runs-on: ubuntu-latest
needs: [linux_build, macos_build, windows_build]
steps:
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
- name: Copy
run: |
mkdir artifacts
cp -r ./**/* artifacts/
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: combined-artifacts
path: artifacts/
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[![Build Status](https://travis-ci.org/grpc/grpc-node.svg?branch=master)](https://travis-ci.org/grpc/grpc-node)
# gRPC on Node.js

## Implementations
8 changes: 5 additions & 3 deletions doc/environment_variables.md
Original file line number Diff line number Diff line change
@@ -11,8 +11,10 @@ can be set.
checked in order, and the first one that has a value is used.

* no_grpc_proxy, no_proxy
A comma separated list of hostnames to connect to without using a proxy even
if a proxy is set. These variables are checked in order, and the first one
A comma separated list of hostnames, IP addresses,
or CIDR blocks to connect to without using a proxy even
if a proxy is set, for example: no_proxy=example.com,192.168.0.1,192.168.0.0/16.
These variables are checked in order, and the first one
that has a value is used.

* GRPC_SSL_CIPHER_SUITES
@@ -66,4 +68,4 @@ can be set.
* GRPC_NODE_USE_ALTERNATIVE_RESOLVER
Allows changing dns resolve behavior and parse DNS server authority as described in https://github.com/grpc/grpc/blob/master/doc/naming.md
- true - use alternative resolver
- false - use default resolver (default)
- false - use default resolver (default)
57 changes: 57 additions & 0 deletions examples/retry/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Retry

This example shows how to enable and configure retry on gRPC clients.

## Documentation

[gRFC for client-side retry support](https://github.com/grpc/proposal/blob/master/A6-client-retries.md)

## Try it

This example includes a service implementation that fails requests three times with status code Unavailable, then passes the fourth. The client is configured to make four retry attempts when receiving an Unavailable status code.

First start the server:

```
node server.js
```

Then run the client:

```
node client.js
```

## Usage

### Define your retry policy

Retry is configured via the service config, which can be provided by the name resolver, or as a channel option (described below). In the below example, we set the retry policy for the "grpc.example.echo.Echo" method.

```js
const serviceConfig = {
loadBalancingConfig: [],
methodConfig: [
{
name: [
{
service: 'grpc.examples.echo.Echo',
},
],
retryPolicy: {
maxAttempts: 4,
initialBackoff: '0.01s',
maxBackoff: '0.01s',
backoffMultiplier: 1.0,
retryableStatusCodes: ['UNAVAILABLE'],
},
},
],
};
```

### Providing the retry policy as a channel option

```js
const client = new Echo('localhost:50052', grpc.credentials.createInsecure(), { 'grpc.service_config': JSON.stringify(serviceConfig) });
```
75 changes: 75 additions & 0 deletions examples/retry/client.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/*
*
* Copyright 2025 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

const grpc = require('@grpc/grpc-js');
const protoLoader = require('@grpc/proto-loader');
const parseArgs = require('minimist');

const PROTO_PATH = __dirname + '/../protos/echo.proto';

const packageDefinition = protoLoader.loadSync(
PROTO_PATH,
{keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true
});
const echoProto = grpc.loadPackageDefinition(packageDefinition).grpc.examples.echo;

const serviceConfig = {
loadBalancingConfig: [],
methodConfig: [
{
name: [
{
service: 'grpc.examples.echo.Echo',
},
],
retryPolicy: {
maxAttempts: 4,
initialBackoff: '0.01s',
maxBackoff: '0.01s',
backoffMultiplier: 1.0,
retryableStatusCodes: ['UNAVAILABLE'],
},
},
],
};

function main() {
let argv = parseArgs(process.argv.slice(2), {
string: 'target',
default: {target: 'localhost:50052'}
});

// Set up a connection to the server with service config and create the channel.
// However, the recommended approach is to fetch the retry configuration
// (which is part of the service config) from the name resolver rather than
// defining it on the client side.
const client = new echoProto.Echo('localhost:50052', grpc.credentials.createInsecure(), { 'grpc.service_config': JSON.stringify(serviceConfig) });
client.unaryEcho({message: 'Try and Success'}, (error, value) => {
if (error) {
console.log(`Unexpected error from UnaryEcho: ${error}`);
return;
}
console.log(`RPC response: ${JSON.stringify(value)}`);
});
}

main();
73 changes: 73 additions & 0 deletions examples/retry/server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*
*
* Copyright 2025 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

const grpc = require('@grpc/grpc-js');
const protoLoader = require('@grpc/proto-loader');
const parseArgs = require('minimist');

const PROTO_PATH = __dirname + '/../protos/echo.proto';

const packageDefinition = protoLoader.loadSync(
PROTO_PATH,
{keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true
});
const echoProto = grpc.loadPackageDefinition(packageDefinition).grpc.examples.echo;

const SUCCEED_EVERY = 4
let callCount = 0;

/* This method will succeed every SUCCEED_EVERY calls, and fail all others with status code
* UNAVAILABLE. */
function unaryEcho(call, callback) {
callCount++;
if (callCount % SUCCEED_EVERY === 0) {
console.log(`Request succeeded count: ${callCount}`);
callback(null, call.request);
} else {
console.log(`Request failed count: ${callCount}`);
callback({
code: grpc.status.UNAVAILABLE,
details: 'Request failed by policy'
});
}
}

const serviceImplementation = {
unaryEcho
};

function main() {
const argv = parseArgs(process.argv.slice(2), {
string: 'port',
default: {port: '50052'}
});
const server = new grpc.Server();
server.addService(echoProto.Echo.service, serviceImplementation);
server.bindAsync(`0.0.0.0:${argv.port}`, grpc.ServerCredentials.createInsecure(), (err, port) => {
if (err != null) {
return console.error(err);
}
console.log(`gRPC listening on ${port}`)
});
}

main();
2 changes: 1 addition & 1 deletion gulpfile.ts
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ import * as reflection from './packages/grpc-reflection/gulpfile';
import * as protobuf from './packages/proto-loader/gulpfile';
import * as internalTest from './test/gulpfile';

const installAll = gulp.series(protobuf.install, jsCore.install, healthCheck.install, internalTest.install, jsXds.install, reflection.install);
const installAll = gulp.series(protobuf.install, jsCore.install, healthCheck.install, reflection.install, internalTest.install, jsXds.install);

const lint = gulp.parallel(jsCore.lint);

1 change: 1 addition & 0 deletions packages/grpc-health-check/package.json
Original file line number Diff line number Diff line change
@@ -35,6 +35,7 @@
"license": "Apache-2.0",
"devDependencies": {
"@grpc/grpc-js": "file:../grpc-js",
"@types/mocha": "^10.0.10",
"typescript": "^5.2.2"
}
}
3 changes: 2 additions & 1 deletion packages/grpc-js-xds/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @grpc/grpc-js xDS plugin

This package provides support for the `xds://` URL scheme to the `@grpc/grpc-js` library. The latest version of this package is compatible with `@grpc/grpc-js` version 1.10.x.
This package provides support for the `xds://` URL scheme to the `@grpc/grpc-js` library. The latest version of this package is compatible with `@grpc/grpc-js` version 1.13.x.

## Installation

@@ -36,3 +36,4 @@ const client = new MyServiceClient('xds:///example.com:123');
- [xDS Ring Hash LB Policy](https://github.com/grpc/proposal/blob/master/A42-xds-ring-hash-lb-policy.md)
- [`pick_first` via xDS](https://github.com/grpc/proposal/blob/master/A62-pick-first.md#pick_first-via-xds-1) (Currently experimental, enabled by environment variable `GRPC_EXPERIMENTAL_PICKFIRST_LB_CONFIG`)
- [xDS-Enabled Servers](https://github.com/grpc/proposal/blob/master/A36-xds-for-servers.md)
- [xDS-Based Security for gRPC Clients and Servers](https://github.com/grpc/proposal/blob/master/A29-xds-tls-security.md)
2 changes: 1 addition & 1 deletion packages/grpc-js-xds/deps/envoy-api
Submodule envoy-api updated 108 files
10 changes: 9 additions & 1 deletion packages/grpc-js-xds/gulpfile.ts
Original file line number Diff line number Diff line change
@@ -21,6 +21,10 @@ import * as mocha from 'gulp-mocha';
import * as path from 'path';
import * as execa from 'execa';
import * as semver from 'semver';
import { ncp } from 'ncp';
import { promisify } from 'util';

const ncpP = promisify(ncp);

Error.stackTraceLimit = Infinity;

@@ -60,6 +64,10 @@ const cleanAll = gulp.parallel(clean);
*/
const compile = checkTask(() => execNpmCommand('compile'));

const copyTestFixtures = checkTask(() =>
ncpP(`${jsCoreDir}/test/fixtures`, `${outDir}/test/fixtures`)
);

const runTests = checkTask(() => {
process.env.GRPC_EXPERIMENTAL_XDS_FEDERATION = 'true';
process.env.GRPC_EXPERIMENTAL_PICKFIRST_LB_CONFIG = 'true';
@@ -71,7 +79,7 @@ const runTests = checkTask(() => {
require: ['ts-node/register']}));
});

const test = gulp.series(install, runTests);
const test = gulp.series(install, copyTestFixtures, runTests);

export {
install,
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@

# Dockerfile for building the xDS interop client. To build the image, run the
# following command from grpc-node directory:
# docker build -t <TAG> -f packages/grpc-js-xds/interop/Dockerfile .
# docker build -t <TAG> -f packages/grpc-js-xds/interop/test-client.Dockerfile .

FROM node:18-slim as build

@@ -26,16 +26,23 @@ WORKDIR /node/src/grpc-node/packages/proto-loader
RUN npm install
WORKDIR /node/src/grpc-node/packages/grpc-js
RUN npm install
WORKDIR /node/src/grpc-node/packages/grpc-health-check
RUN npm install
WORKDIR /node/src/grpc-node/packages/grpc-reflection
RUN npm install
WORKDIR /node/src/grpc-node/packages/grpc-js-xds
RUN npm install

FROM gcr.io/distroless/nodejs18-debian11:latest
WORKDIR /node/src/grpc-node
COPY --from=build /node/src/grpc-node/packages/proto-loader ./packages/proto-loader/
COPY --from=build /node/src/grpc-node/packages/grpc-health-check ./packages/grpc-health-check/
COPY --from=build /node/src/grpc-node/packages/grpc-reflection ./packages/grpc-reflection/
COPY --from=build /node/src/grpc-node/packages/grpc-js ./packages/grpc-js/
COPY --from=build /node/src/grpc-node/packages/grpc-js-xds ./packages/grpc-js-xds/

ENV GRPC_VERBOSITY="DEBUG"
ENV GRPC_TRACE=xds_client,xds_resolver,xds_cluster_manager,cds_balancer,xds_cluster_resolver,xds_cluster_impl,priority,weighted_target,round_robin,resolving_load_balancer,subchannel,keepalive,dns_resolver,fault_injection,http_filter,csds,outlier_detection,server,server_call,ring_hash
ENV GRPC_TRACE=xds_client,xds_resolver,xds_cluster_manager,cds_balancer,xds_cluster_resolver,xds_cluster_impl,priority,weighted_target,round_robin,resolving_load_balancer,subchannel,keepalive,dns_resolver,fault_injection,http_filter,csds,outlier_detection,server,server_call,ring_hash,transport,certificate_provider,xds_channel_credentials,backoff
ENV NODE_XDS_INTEROP_VERBOSITY=1

ENTRYPOINT [ "/nodejs/bin/node", "/node/src/grpc-node/packages/grpc-js-xds/build/interop/xds-interop-client" ]
Loading