Skip to content

feat(web): support dynamic upload/download config overrides and binary transport - #915

Merged
kyasbal merged 2 commits into
GoogleCloudPlatform:mainfrom
kyasbal:push-rskznosstntt
Aug 27, 2026
Merged

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

Conversation

@kyasbal

@kyasbal kyasbal commented Aug 27, 2026

Copy link
Copy Markdown
Member

Summary

Enable flexible configuration and URL parameter overrides for chunked upload, chunked download, and Connect-RPC binary transport format, alongside a generalized configuration resolver utility.

Changes

  • Generalized Config Resolver (config-resolver.ts):
    • Provides resolveParam combining query parameter extraction, candidate fallback cascades (e.g. caller options, environment configs), validators, and default values.
    • Provides robust parsers for booleans (parseBooleanQueryParam), integers with minimum bounds (parseIntegerQueryParam), and human-readable byte sizes (parseByteSizeQueryParam, e.g. 2MB, 512KB).
  • Dynamic Upload Config:
    • Resolves chunk size via ?uploadChunkSize > environment.upload.chunkSizeBytes > backend suggestion > 16 MB.
    • Resolves concurrency via ?uploadConcurrency > caller option > environment.upload.maxConcurrency > 4.
    • Integrated into import-inspection-client.service.ts and file-parameter-upload-client.service.ts.
  • Dynamic Binary Transport Format:
    • Decoupled Connect-RPC protobuf transport from environment.production to environment.useBinaryFormat (false in dev, true in prod).
    • Supports runtime override via ?useBinaryFormat=true / ?useBinaryFormat=false (also accepts 1/0/yes/no).
  • Dynamic Download Config:
    • Resolves inspection data download chunk size via ?downloadChunkSize > environment.download.chunkSizeBytes > 16 MB.
    • Resolves download concurrency via ?downloadConcurrency > environment.download.maxConcurrency > 10.
    • Integrated into backend-api.service.ts getInspectionData().
  • Unit Tests:
    • Added unit test suites for config-resolver, transport-config-resolver, download-config-resolver, upload-config-resolver, connect-client.service, and backend-api.service.

Verification

  • make test-web: 857 of 857 tests passed (0 failures)
  • make lint-web: All files pass linting
  • make format-web: All files formatted
  • make build-storybook: Storybook build completed successfully
  • make pre-commit: All formatters, linters, and markdownlint passed cleanly

@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 introduces dynamic configuration resolvers to determine chunk size, concurrency, and binary format settings for uploads, downloads, and RPC transport using environment variables and URL query parameters. Key feedback highlights the need to propagate an AbortSignal in getInspectionData to prevent orphaned background requests upon unsubscription. Additionally, it is recommended to enforce a minimum chunk size of 1 MB in both download and upload resolvers to prevent browser freezes, and to make parseIntegerQueryParam stricter by rejecting trailing non-numeric characters.

Comment thread web/src/app/utils/config-resolver.ts Resolved
@kyasbal
kyasbal force-pushed the push-rskznosstntt branch from 442b302 to 64538e3 Compare August 27, 2026 02:03
…y transport

- Introduce generalized configuration resolver utility (config-resolver.ts) supporting query param, candidate cascade, and default fallback resolution.
- Make chunk size and concurrency configurable via environment.upload and URL parameters (?uploadChunkSize, ?uploadConcurrency).
- Decouple binary format from environment.production to environment.useBinaryFormat and URL parameter (?useBinaryFormat).
- Make inspection data download chunk size and concurrency configurable via environment.download and URL parameters (?downloadChunkSize, ?downloadConcurrency).
@kyasbal
kyasbal force-pushed the push-rskznosstntt branch from 64538e3 to 8b1e5f1 Compare August 27, 2026 02:10
@kyasbal kyasbal added the type:feature New feature or request label Aug 27, 2026
@kyasbal
kyasbal merged commit 99a5389 into GoogleCloudPlatform:main Aug 27, 2026
16 checks passed
@kyasbal
kyasbal deleted the push-rskznosstntt branch August 27, 2026 02:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:feature New feature or request

1 participant