Skip to content
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

[WIP] feat: client generated by openapi-generator #738

Closed

Conversation

tomplus
Copy link
Member

@tomplus tomplus commented Jan 27, 2019

The client has been generated by openapi-generator instead of swagger-codegen.

Ref: kubernetes-client/gen#93

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: tomplus
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: yliaog

If they are not already assigned, you can assign the PR to them by writing /assign @yliaog in a comment when ready.

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

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jan 27, 2019
@tomplus tomplus changed the title feat: client generated by openapi-generator [WIP] feat: client generated by openapi-generator Jan 27, 2019
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 27, 2019
@@ -0,0 +1,2 @@
Requested Commit: v3.3.4
Copy link
Member Author

Choose a reason for hiding this comment

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

kubernete/.swagger-codegen is deleted, openapi-generator uses kubernetes/.openapi-generator and also .openapi-generator-ignore instead of .swagger-codegen-ignore (renamed).


# flake8: noqa

# import apis into api package
Copy link
Member Author

Choose a reason for hiding this comment

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

This packages is renamed from apis to api.

Copy link
Contributor

Choose a reason for hiding this comment

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

Out of curiosity, why did you change it from apis to api?

@@ -56,7 +56,7 @@
tests_require=TESTS_REQUIRES,
extras_require=EXTRAS,
packages=['kubernetes', 'kubernetes.client', 'kubernetes.config',
'kubernetes.watch', 'kubernetes.client.apis',
'kubernetes.watch', 'kubernetes.client.api',
Copy link
Member Author

Choose a reason for hiding this comment

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

apis -> api

@@ -16,7 +16,7 @@
import uuid

from kubernetes.client import api_client
from kubernetes.client.apis import batch_v1_api
from kubernetes.client.api import batch_v1_api
Copy link
Member Author

Choose a reason for hiding this comment

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

apis -> api here and in another e2e tests too.

--- a/kubernetes/client/rest.py
+++ b/kubernetes/client/rest.py
@@ -152,6 +152,10 @@ class RESTClientObject(object):
@@ -155,6 +155,10 @@ class RESTClientObject(object):
Copy link
Member Author

Choose a reason for hiding this comment

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

It needs to be updated to apply this patch by update_client.sh

"""


from __future__ import absolute_import

# import models into sdk package
from .models.admissionregistration_v1beta1_service_reference import AdmissionregistrationV1beta1ServiceReference
Copy link
Member Author

Choose a reason for hiding this comment

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

relative vs. absolute imports

import sys
import os
import re
import re # noqa: F401
Copy link
Member Author

Choose a reason for hiding this comment

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

There are a lot of changes which clean the code (unused imports, long lines etc.).

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 29, 2019
@tomplus
Copy link
Member Author

tomplus commented Apr 29, 2019

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 29, 2019
@roycaihw
Copy link
Member

roycaihw commented Jul 2, 2019

/cc

Copy link
Member

@roycaihw roycaihw left a comment

Choose a reason for hiding this comment

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

looks pretty neat. I checked the apis and the models. It seems that the only major interface change is the package getting renamed.

was there any file contributed a lot to the line number diff (9620 from +93,422 −103,042)? I didn't see huge file getting deleted. It's probably accumulated as we cut a couple of lines from the hundreds of files.

I re-triggered the tests and the test failure looks unrelated-- more like server-side problem than client-side

@@ -0,0 +1,2 @@
Requested Commit: v3.3.4
Actual Commit: 2353d71d4b02be6dbabe25aac1a9e56eb3b812a2
Copy link
Contributor

Choose a reason for hiding this comment

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

Since its been a while can you bump this to v4.0.3, commit 203fc812bda4267020165e656f55185f72df4cc0?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also just curious, how often would the version need to be bumped in the future?

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe that we rarely bump the version of swagger-codegen right now.

@@ -17,9 +17,9 @@ Python 2.7 and 3.4+
If the python package is hosted on Github, you can install directly from Github

```sh
pip install git+https://github.com/kubernetes-client/python.git
pip install git+https://github.com/kubernetes-kubernetes.client/python.git
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are these changed to this weird URL?

from .models.v2beta2_resource_metric_source import V2beta2ResourceMetricSource
from .models.v2beta2_resource_metric_status import V2beta2ResourceMetricStatus
from .models.version_info import VersionInfo
__version__ = "9.0.0-snapshot"
Copy link
Contributor

Choose a reason for hiding this comment

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

Shoudn't this be: "10.0.0-snapshot"?

@@ -68,7 +70,7 @@ except ApiException as e:

## Documentation for API Endpoints

All URIs are relative to *https://localhost*
All URIs are relative to *http://localhost*
Copy link
Contributor

Choose a reason for hiding this comment

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

Also curious why it's http now instead of https?

@scottilee
Copy link
Contributor

The kubernetes/README.md Requirements section says "Python 2.7 and 3.4+" but 3.4 is deprecated (refer to #807). Is there a way to fix this?

@roycaihw
Copy link
Member

roycaihw commented Dec 3, 2019

we've migrated to openapi-generator

/close

@k8s-ci-robot
Copy link
Contributor

@roycaihw: Closed this PR.

In response to this:

we've migrated to openapi-generator

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

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. 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.

6 participants