Skip to content

feat(api): configure Connect-RPC serialization format based on environment - #906

Merged
kyasbal merged 2 commits into
GoogleCloudPlatform:mainfrom
kyasbal:push-umynpwktpuov
Aug 26, 2026
Merged

kyasbal merged 2 commits into
GoogleCloudPlatform:mainfrom
kyasbal:push-umynpwktpuov

Conversation

@kyasbal

@kyasbal kyasbal commented Aug 26, 2026

Copy link
Copy Markdown
Member

Summary

Configures Connect-RPC serialization format based on the frontend build environment (environment.production).

  • Introduces ConnectClientService to centrally create and configure Connect-RPC transports and clients.
  • In production (environment.production: true), clients default to compact binary Protobuf serialization for maximum efficiency and reduced bandwidth.
  • In development (environment.production: false), clients use useBinaryFormat: false (ProtoJSON) for transparent network payloads in browser DevTools.
  • Refactors FileParameterUploadClientService and ImportInspectionClientService to inject clients from ConnectClientService instead of creating independent transports.
  • Adds Go backend test TestWorkbenchServiceServer_ProtoJSONClient to verify server-side compatibility when requests are sent using ProtoJSON format.

Verification

  • make test-go
  • make test-web
  • make pre-commit

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the Angular frontend API clients to share a centralized ConnectClientService transport instead of creating separate transports locally. It also updates the transport configuration to use JSON format during development (environment.production is false) and binary format in production. Corresponding unit tests are added and updated, including a new Go test verifying ProtoJSON client compatibility. Feedback is provided regarding a redundant nil check on a protobuf message in the Go test, as protobuf getters in Go safely handle nil receivers.

Comment thread pkg/server/api/v1/workbench_test.go Resolved
@kyasbal kyasbal added the type:refactor Code refactoring without behavioral change label Aug 26, 2026
@kyasbal
kyasbal merged commit ec1aa80 into GoogleCloudPlatform:main Aug 26, 2026
16 checks passed
@kyasbal
kyasbal deleted the push-umynpwktpuov branch August 26, 2026 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:refactor Code refactoring without behavioral change

1 participant