chore(frontend): deduplicate generated OpenAPI runtime and model files#13157
Conversation
There was a problem hiding this comment.
Pull request overview
This PR reduces duplicated OpenAPI Generator output by extracting the common runtime.ts, ProtobufAny.ts, and GooglerpcStatus.ts into shared generated modules, while keeping existing per-surface import paths stable via thin re-export shims. It also updates the OpenAPI generation script to perform the dedupe as a post-generation step, adds unit test coverage for that behavior, and updates generated-files documentation.
Changes:
- Add shared generated OpenAPI support modules under
frontend/src/generated/openapiandfrontend/server/src/generated/openapi. - Replace per-surface generated support files with re-export shims to preserve existing import paths.
- Add/extend generator script logic + tests to implement and validate the dedupe step; update AGENTS.md generated-files docs.
Reviewed changes
Copilot reviewed 39 out of 51 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/generated/openapi/models/ProtobufAny.ts | New shared client-side generated support model. |
| frontend/src/generated/openapi/models/GooglerpcStatus.ts | New shared client-side generated support model. |
| frontend/server/src/generated/openapi/models/ProtobufAny.ts | New shared server-side generated support model (Node ESM import specifiers). |
| frontend/server/src/generated/openapi/models/GooglerpcStatus.ts | New shared server-side generated support model (Node ESM import specifiers). |
| frontend/src/apisv2beta1/visualization/models/ProtobufAny.ts | Replace per-surface model with re-export shim to shared client support. |
| frontend/src/apisv2beta1/visualization/models/GooglerpcStatus.ts | Replace per-surface model with re-export shim to shared client support. |
| frontend/src/apisv2beta1/run/runtime.ts | Replace per-surface runtime with re-export shim to shared client runtime. |
| frontend/src/apisv2beta1/run/models/ProtobufAny.ts | Replace per-surface model with re-export shim to shared client support. |
| frontend/src/apisv2beta1/run/models/GooglerpcStatus.ts | Replace per-surface model with re-export shim to shared client support. |
| frontend/src/apisv2beta1/recurringrun/models/ProtobufAny.ts | Replace per-surface model with re-export shim to shared client support. |
| frontend/src/apisv2beta1/recurringrun/models/GooglerpcStatus.ts | Replace per-surface model with re-export shim to shared client support. |
| frontend/src/apisv2beta1/pipeline/runtime.ts | Replace per-surface runtime with re-export shim to shared client runtime. |
| frontend/src/apisv2beta1/pipeline/models/ProtobufAny.ts | Replace per-surface model with re-export shim to shared client support. |
| frontend/src/apisv2beta1/pipeline/models/GooglerpcStatus.ts | Replace per-surface model with re-export shim to shared client support. |
| frontend/src/apisv2beta1/filter/runtime.ts | Replace per-surface runtime with re-export shim to shared client runtime. |
| frontend/src/apisv2beta1/filter/models/ProtobufAny.ts | Replace per-surface model with re-export shim to shared client support. |
| frontend/src/apisv2beta1/filter/models/GooglerpcStatus.ts | Replace per-surface model with re-export shim to shared client support. |
| frontend/src/apisv2beta1/experiment/runtime.ts | Replace per-surface runtime with re-export shim to shared client runtime. |
| frontend/src/apisv2beta1/experiment/models/ProtobufAny.ts | Replace per-surface model with re-export shim to shared client support. |
| frontend/src/apisv2beta1/experiment/models/GooglerpcStatus.ts | Replace per-surface model with re-export shim to shared client support. |
| frontend/src/apis/visualization/runtime.ts | Replace per-surface runtime with re-export shim to shared client runtime. |
| frontend/src/apis/visualization/models/ProtobufAny.ts | Replace per-surface model with re-export shim to shared client support. |
| frontend/src/apis/visualization/models/GooglerpcStatus.ts | Replace per-surface model with re-export shim to shared client support. |
| frontend/src/apis/run/runtime.ts | Replace per-surface runtime with re-export shim to shared client runtime. |
| frontend/src/apis/run/models/ProtobufAny.ts | Replace per-surface model with re-export shim to shared client support. |
| frontend/src/apis/run/models/GooglerpcStatus.ts | Replace per-surface model with re-export shim to shared client support. |
| frontend/src/apis/pipeline/runtime.ts | Replace per-surface runtime with re-export shim to shared client runtime. |
| frontend/src/apis/pipeline/models/ProtobufAny.ts | Replace per-surface model with re-export shim to shared client support. |
| frontend/src/apis/pipeline/models/GooglerpcStatus.ts | Replace per-surface model with re-export shim to shared client support. |
| frontend/src/apis/job/runtime.ts | Replace per-surface runtime with re-export shim to shared client runtime. |
| frontend/src/apis/job/models/ProtobufAny.ts | Replace per-surface model with re-export shim to shared client support. |
| frontend/src/apis/job/models/GooglerpcStatus.ts | Replace per-surface model with re-export shim to shared client support. |
| frontend/src/apis/filter/runtime.ts | Replace per-surface runtime with re-export shim to shared client runtime. |
| frontend/src/apis/filter/models/ProtobufAny.ts | Replace per-surface model with re-export shim to shared client support. |
| frontend/src/apis/filter/models/GooglerpcStatus.ts | Replace per-surface model with re-export shim to shared client support. |
| frontend/src/apis/experiment/runtime.ts | Replace per-surface runtime with re-export shim to shared client runtime. |
| frontend/src/apis/experiment/models/ProtobufAny.ts | Replace per-surface model with re-export shim to shared client support. |
| frontend/src/apis/experiment/models/GooglerpcStatus.ts | Replace per-surface model with re-export shim to shared client support. |
| frontend/server/src/generated/apisv2beta1/auth/models/ProtobufAny.ts | Replace per-surface server model with re-export shim to shared server support. |
| frontend/server/src/generated/apisv2beta1/auth/models/GooglerpcStatus.ts | Replace per-surface server model with re-export shim to shared server support. |
| frontend/server/src/generated/apis/auth/models/ProtobufAny.ts | Replace per-surface server model with re-export shim to shared server support. |
| frontend/server/src/generated/apis/auth/models/GooglerpcStatus.ts | Replace per-surface server model with re-export shim to shared server support. |
| frontend/scripts/generate_openapi_typescript_fetch.test.js | Add unit tests for shared-support normalization and shim rewriting. |
| frontend/scripts/generate_openapi_typescript_fetch.js | Implement shared-support extraction + rewrite shims + format shared dirs. |
| AGENTS.md | Update generated-files documentation to reflect shared OpenAPI support locations. |
|
/ci-passed |
4722086 to
9bdebed
Compare
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: droctothorpe The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/ok-to-test |
Signed-off-by: Jeff Spahr <spahrj@gmail.com>
Signed-off-by: Jeff Spahr <spahrj@gmail.com>
9bdebed to
6c19d7a
Compare
Summary
runtime.ts,ProtobufAny.ts, andGooglerpcStatus.tsfiles intofrontend/src/generated/openapiandfrontend/server/src/generated/openapiTesting
cd frontend && npm test -- scripts/generate_openapi_typescript_fetch.test.jscd frontend && npm run apis:allcd frontend && npm run apis:runcd frontend && npm run lintcd frontend && npm run typecheck(still fails on currentorigin/masterdue existingJSXnamespace / MLMD ref typing errors unrelated to this diff)Fixes #12957.