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

Generate OpenAPI specification and Swagger file #3081

Merged
merged 1 commit into from
Oct 30, 2020

Conversation

jinchihe
Copy link
Contributor

@jinchihe jinchihe commented Aug 10, 2020

Changes

The PR is going to generate OpenAPI specification, and generate Swagger file according to the OpenAPI specification.

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

  • Includes tests (if functionality changed/added):

  • Includes docs (if user facing)

  • Commit messages follow commit message best practices

  • Release notes block has been filled in or deleted (only if no user facing changes)

See the contribution guide for more details.

Double check this list of stuff that's easy to miss:

Reviewer Notes

If API changes are included, additive changes must be approved by at least two OWNERS and backwards incompatible changes must be approved by more than 50% of the OWNERS, and they must first be added in a backwards compatible way.

Release Notes

None

@tekton-robot tekton-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Aug 10, 2020
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Aug 10, 2020

CLA Check
The committers are authorized under a signed CLA.

@tekton-robot tekton-robot requested review from dlorenc and a user August 10, 2020 11:32
@tekton-robot tekton-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 10, 2020
@tekton-robot
Copy link
Collaborator

Hi @jinchihe. Thanks for your PR.

I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@jinchihe
Copy link
Contributor Author

/cc @vdemeester

@vdemeester
Copy link
Member

@jinchihe thanks for the PR 👼

Firstly, I'm not sure that's good place to put the SDK here, personally it's better to have a separate repo to maintain SDK, such as python and java (if needed) etc... I'm waiting for comments from maintainers for this.

I tend to agree, we could have the SDK in a separate repository (a bit like k8s.io/client-go).

Overall, I think it look good, but I feel we should split the PR into several :

  1. adding openapi gen (go code and schemas) in one PR
  2. swagger in another
  3. the sdk generation in a third and/or in a separate repository 😉

/cc @afrittoli @bobcatfish @sbwsg

@bobcatfish
Copy link
Collaborator

Would it make sense to have keep the python client lib generation as a separate project, maybe in experimental or a separate repo? @tektoncd/core-maintainers

@imjasonh
Copy link
Member

Would it make sense to have keep the python client lib generation as a separate project, maybe in experimental or a separate repo? @tektoncd/core-maintainers

I would prefer that. Either as a directory in tektoncd/experimental, or just as a separately-owned repo outside the Tekton org, based on Tekton-owned generated Swagger.

Basically, I definitely think Tekton should own Swagger doc generation, but I don't want to own generated Python (or any non-Go) client libraries since I don't think we can rely on sufficient Python expertise in case there are issues.

@jinchihe
Copy link
Contributor Author

I tend to agree, we could have the SDK in a separate repository (a bit like k8s.io/client-go).

Overall, I think it look good, but I feel we should split the PR into several :

  1. adding openapi gen (go code and schemas) in one PR
  2. swagger in another
  3. the sdk generation in a third and/or in a separate repository 😉

@vdemeester Thank you for the comments. Make sense, we may can commit the openapi and swagger in tektoncd/pipeline repo, and commit sdk after the separate repository (may be named tektoncd/sdk) created.

@jinchihe
Copy link
Contributor Author

I would prefer that. Either as a directory in tektoncd/experimental, or just as a separately-owned repo outside the Tekton org, based on Tekton-owned generated Swagger.

Basically, I definitely think Tekton should own Swagger doc generation, but I don't want to own generated Python (or any non-Go) client libraries since I don't think we can rely on sufficient Python expertise in case there are issues.

@imjasonh why put outside the Tekton org? personally I suggest to maintain that inside of Tekton org, you know, that has close relationship with tekton/pipeline and very import for tekton end user. If you‘re worry about sufficient Python expertise, this is open source, I think if have problems, more and more Python expertise will take part in :-)

@imjasonh
Copy link
Member

@imjasonh why put outside the Tekton org? personally I suggest to maintain that inside of Tekton org, you know, that has close relationship with tekton/pipeline and very import for tekton end user. If you‘re worry about sufficient Python expertise, this is open source, I think if have problems, more and more Python expertise will take part in :-)

Perhaps I should rephrase. 😄 I'd like to start with the generated Python client (and other generated clients) in a non-Tekton repo, or in tektoncd/experimental where user expectations around ownership and support are more relaxed. If there's sufficient interest and usage of the clients in the future, and if an interested owner steps up, we could promote it to a separate tektoncd/* repo, or possibly eventually into tektoncd/pipeline -- but I don't think we should start there.

Having generated clients means having a release process for them, publishing them to PyPi, etc., and I just don't think there's enough dedicated expertise or interest among Tekton owners and partners at this time to justify adding that burden. If the clients are a hit and are widely used, then presumably some dependent user would be willing to step and own generating and releasing new clients, and debugging the inevitable user issues. The best way to gauge use and interest is to start by publishing them -- anywhere -- and seeing how they get adopted.

@jinchihe
Copy link
Contributor Author

@imjasonh @vdemeester OK thanks. I will separate the PR to keep the openapi and swagger parts in this repo, and commit the generated python SDK in tektoncd/experimental.

@tekton-robot tekton-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 11, 2020
@jinchihe jinchihe force-pushed the generate_python_sdk branch 4 times, most recently from 92f56be to a951c04 Compare August 13, 2020 08:45
@jinchihe
Copy link
Contributor Author

jinchihe commented Aug 13, 2020

@imjasonh @vdemeester As above discussion, I keep the OpenAPI and swagger parts in the tektoncd/pipeline repo, and move the generated SDK to tektoncd/experimental.

if so, the PR is ready for reviewing and testing. I will update summary and description. Thanks.

@jinchihe jinchihe changed the title Generate Tekton Pipeline Python SDK Generate OpenAPI specification Aug 13, 2020
@vdemeester
Copy link
Member

/ok-to-test
/kind feature

@tekton-robot tekton-robot added kind/feature Categorizes issue or PR as related to a new feature. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. labels Aug 13, 2020
@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 15, 2020
@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 2, 2020
@ghost
Copy link

ghost commented Oct 2, 2020

/hold

@tekton-robot tekton-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 2, 2020
@ghost
Copy link

ghost commented Oct 2, 2020

Hey sorry @jinchihe could you update the commit message to:

  1. Remove mention of Python SDK
  2. Describe the actual changes you've made with a couple paragraphs?

After that I think this is ready to go!

@ghost
Copy link

ghost commented Oct 2, 2020

/approve cancel

@tekton-robot tekton-robot removed the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 2, 2020
@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Oct 29, 2020
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1beta1/openapi_generated.go Do not exist 0.0%

@jinchihe
Copy link
Contributor Author

@sbwsg so sorry... I missed your comments, update later. I already updated that and removed SDK related message.

And I noticed there are some changes in types, so I also re-generated the OpenAPI specification and Swagger file. Thanks a lot!

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1beta1/openapi_generated.go Do not exist 0.0%

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1beta1/openapi_generated.go Do not exist 0.0%

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sbwsg

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

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 29, 2020
@ghost
Copy link

ghost commented Oct 29, 2020

/hold cancel

@tekton-robot tekton-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 29, 2020
@vincent-pli
Copy link
Member

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 30, 2020
@tekton-robot tekton-robot merged commit f530a69 into tektoncd:master Oct 30, 2020
@jinchihe jinchihe deleted the generate_python_sdk branch October 30, 2020 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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.

7 participants