Skip to content

chore(frontend): deduplicate generated OpenAPI runtime and model files#13157

Merged
google-oss-prow[bot] merged 2 commits intokubeflow:masterfrom
jeffspahr:codex/issue-12957-openapi-dedupe
Apr 1, 2026
Merged

chore(frontend): deduplicate generated OpenAPI runtime and model files#13157
google-oss-prow[bot] merged 2 commits intokubeflow:masterfrom
jeffspahr:codex/issue-12957-openapi-dedupe

Conversation

@jeffspahr
Copy link
Copy Markdown
Contributor

@jeffspahr jeffspahr commented Mar 27, 2026

Summary

  • deduplicate generated OpenAPI support by moving shared runtime.ts, ProtobufAny.ts, and GooglerpcStatus.ts files into frontend/src/generated/openapi and frontend/server/src/generated/openapi
  • rewrite per-surface generated support files into thin re-export shims so existing generated import paths stay stable
  • validate the shared-support invariant during generation so divergent targets fail deterministically instead of silently clobbering shared output
  • add generator coverage for both the dedupe pass and the mismatch guard, and update the generated-files documentation

Testing

  • cd frontend && npm test -- scripts/generate_openapi_typescript_fetch.test.js
  • cd frontend && npm run apis:all
  • cd frontend && npm run apis:run
  • cd frontend && npm run lint
  • cd frontend && npm run typecheck (still fails on current origin/master due existing JSX namespace / MLMD ref typing errors unrelated to this diff)

Fixes #12957.

Copilot AI review requested due to automatic review settings March 27, 2026 19:29
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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/openapi and frontend/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.

@manaswinidas
Copy link
Copy Markdown
Contributor

/ci-passed

Copy link
Copy Markdown
Contributor

@manaswinidas manaswinidas left a comment

Choose a reason for hiding this comment

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

/lgtm

@google-oss-prow google-oss-prow Bot added the lgtm label Mar 28, 2026
@droctothorpe droctothorpe force-pushed the codex/issue-12957-openapi-dedupe branch from 4722086 to 9bdebed Compare March 29, 2026 00:34
@google-oss-prow google-oss-prow Bot removed the lgtm label Mar 29, 2026
@droctothorpe
Copy link
Copy Markdown
Collaborator

/approve
/lgtm

@google-oss-prow
Copy link
Copy Markdown

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@jsonmp-k8
Copy link
Copy Markdown
Contributor

/ok-to-test

@github-actions github-actions Bot added the ci-passed All CI tests on a pull request have passed label Mar 29, 2026
Signed-off-by: Jeff Spahr <spahrj@gmail.com>
Signed-off-by: Jeff Spahr <spahrj@gmail.com>
@jeffspahr jeffspahr force-pushed the codex/issue-12957-openapi-dedupe branch from 9bdebed to 6c19d7a Compare April 1, 2026 05:14
@google-oss-prow google-oss-prow Bot removed the lgtm label Apr 1, 2026
@github-actions github-actions Bot added ci-passed All CI tests on a pull request have passed and removed ci-passed All CI tests on a pull request have passed labels Apr 1, 2026
Copy link
Copy Markdown
Contributor

@manaswinidas manaswinidas left a comment

Choose a reason for hiding this comment

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

/lgtm

@google-oss-prow google-oss-prow Bot added the lgtm label Apr 1, 2026
@google-oss-prow google-oss-prow Bot merged commit a548925 into kubeflow:master Apr 1, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved ci-passed All CI tests on a pull request have passed lgtm ok-to-test size/XXL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore(frontend): deduplicate generated OpenAPI runtime and model files

5 participants