Skip to content

Regenerate the synchronous client with the modern Python generator#2631

Draft
tamird wants to merge 4 commits into
kubernetes-client:masterfrom
tamird:prototype/modern-openapi-generator
Draft

Regenerate the synchronous client with the modern Python generator#2631
tamird wants to merge 4 commits into
kubernetes-client:masterfrom
tamird:prototype/modern-openapi-generator

Conversation

@tamird

@tamird tamird commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind feature

What this PR does / why we need it:

The synchronous client is still generated with OpenAPI Generator 6.6's
python-legacy backend. OpenAPI Generator removed that backend in v7,
so the current generation path cannot move to a supported generator or
inherit the modern Python generator's native type information.

This draft shows the complete downstream result of moving the
synchronous client to the modern python backend:

  • regenerate the client with Pydantic models and raw-response sibling
    methods;
  • declare the generated runtime requirements and package py.typed;
  • adapt dynamic, stream, watch, OIDC, YAML, and example helpers to the
    modern generated API; and
  • remove the post-generation patch scripts that the new generator makes
    obsolete.

Which issue(s) this PR fixes:

None.

Special notes for your reviewer:

This is an inspection draft, not a merge-ready change.

The generated output uses kubernetes-client/gen commit b904a3c7, pinned
to OpenAPI Generator commit c797da89 plus the temporary
python-legacy-compat.patch. That patch carries
OpenAPITools/openapi-generator#24290's
compatibleWithPythonLegacy option so the modern generator preserves
the synchronous client's existing public model and configuration
behavior.

Before marking this ready, OpenAPITools/openapi-generator#24290 must
merge and be available as an upstream commit or release. Then
client-gen should pin that upstream source, delete the temporary patch
plumbing, and regenerate this branch canonically.

Focused config, dynamic, stream, watch, generated-API, and proxy
coverage passes 143 tests plus 9 subtests. The cumulative diff also
passes git diff --check.

Does this PR introduce a user-facing change?

The synchronous Python client is regenerated with the modern OpenAPI
Generator Python backend.

Additional documentation:


tamird added 4 commits July 13, 2026 16:12
OpenAPI Generator v7 removed python-legacy. Regenerate with the modern
python generator from client-gen commit 7529a2f1 plus the temporary
compatibility patch for OpenAPITools/openapi-generator#24290.

This commit intentionally contains only generated output and the
preprocessed Swagger spec. Handwritten adapters follow separately.
The modern Python generator imports Pydantic and typing-extensions,
and its requirements template now requires python-dateutil 2.8.2 and
urllib3 2.6.3 through 2.x. Package the generated py.typed marker with
both normal and release builds.
The modern Python generator replaces request() with
param_serialize()/call_api(), exposes raw responses through
*_without_preload_content siblings, annotates return types, and changes
deserialize(). Update the dynamic client, OIDC refresh, stream, watch,
YAML helper, and examples to use those contracts.

DynamicClient keeps accepting async_req because the old implementation
immediately resolved its future with .get(). The synchronous YAML helper
rejects async_req=True instead of passing an unsupported argument into
generated methods. Add focused HTTP and stream regressions for these
compatibility paths.
The modern generation path owns the behaviors that release.sh
previously reconstructed by cherry-picking old commits and applying
transport patches. Remove that second mutation phase and its patch
scripts so update-client.sh leaves the canonical generated tree intact.

Ignore new generator support files that this package does not ship,
and remove the obsolete hot-issues release instructions.
@kubernetes-prow kubernetes-prow Bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jul 14, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: tamird
Once this PR has been reviewed and has the lgtm label, please assign roycaihw for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@kubernetes-prow kubernetes-prow Bot requested review from fabianvf and roycaihw July 14, 2026 00:51
@kubernetes-prow kubernetes-prow Bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Jul 14, 2026
@penguinolog

penguinolog commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Which issue(s) this PR fixes:

technically ton of (urllib compatibility, typing, several broken places with bytes processing)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants