Skip to content

feat(ws): automate generation of types and HTTP client layer from Swagger definitions #496

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

caponetto
Copy link

@caponetto caponetto commented Jul 22, 2025

closes: #499

This pull request introduces significant changes to the frontend codebase, primarily focusing on updating API types to align with newly generated TypeScript definitions from a Swagger API specification. Additionally, it includes enhancements to error handling, dependency updates, and minor logic adjustments. The most important changes are grouped below by theme.

API Type Migration:

  • Replaced backendApiTypes references with generated/data-contracts throughout the codebase, updating type imports and usage for entities like Workspace, WorkspaceState, WorkspaceKind, and ValidationError.
  • Updated mock data and test utilities to use the new API types, including changes in files like mockNamespaces.ts, workspace.mock.ts, and workspaceKinds.mock.ts.

Dependency Updates:

  • Added swagger-typescript-api as a new dependency in workspaces/frontend/package.json to generate TypeScript API definitions.
  • Introduced axios as a dependency to facilitate API requests.

Error Handling Enhancements:

  • Improved the ValidationErrorAlert component to display both the error message and the associated field name.

Code Logic Adjustments:

  • Updated namespace selection logic in NamespaceContextProvider to handle cases where the last used namespace is invalid or missing.

Build and Development Improvements:

  • Added a new script generate:api in workspaces/frontend/package.json to automate the generation of TypeScript API definitions from the Swagger specification.

@github-project-automation github-project-automation bot moved this to Needs Triage in Kubeflow Notebooks Jul 22, 2025
@google-oss-prow google-oss-prow bot added area/frontend area - related to frontend components area/v2 area - version - kubeflow notebooks v2 size/XXL labels Jul 22, 2025
@caponetto
Copy link
Author

/hold

@paulovmr
Copy link

/ok-to-test

@caponetto caponetto force-pushed the types-client-autogen branch 2 times, most recently from 8b899f3 to 6a5462b Compare July 30, 2025 14:51
@caponetto caponetto force-pushed the types-client-autogen branch from 6a5462b to 2b7ea5f Compare July 31, 2025 17:58
@google-oss-prow google-oss-prow bot added the area/ci area - related to ci label Jul 31, 2025
@caponetto caponetto force-pushed the types-client-autogen branch 3 times, most recently from 6a3b350 to 66ea18f Compare July 31, 2025 18:06
@caponetto
Copy link
Author

/unhold

@caponetto caponetto force-pushed the types-client-autogen branch from 6a28b6a to b9e7532 Compare August 1, 2025 13:06
Copy link

@paulovmr paulovmr left a comment

Choose a reason for hiding this comment

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

/lgtm

@ederign
Copy link
Member

ederign commented Aug 5, 2025

Great work!!!

@ederign
Copy link
Member

ederign commented Aug 5, 2025

/approve
/lgtm

Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ederign

The full list of commands accepted by this bot can be found here.

The pull request process is described here

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

@google-oss-prow google-oss-prow bot merged commit f25a22e into kubeflow:notebooks-v2 Aug 5, 2025
7 checks passed
@github-project-automation github-project-automation bot moved this from Needs Triage to Done in Kubeflow Notebooks Aug 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved area/ci area - related to ci area/frontend area - related to frontend components area/v2 area - version - kubeflow notebooks v2 lgtm ok-to-test size/XXL
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants