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

Add OpenAPI generation and swagger to update-codegen.sh #1297

Merged
merged 1 commit into from
Jan 25, 2022

Conversation

abayer
Copy link
Contributor

@abayer abayer commented Jan 20, 2022

Changes

And fix #1271 along the way by using the same scripting as in tektoncd/pipeline#4402 to ignore API rule violations for name_match which already exist. Any new mismatch will cause an error.

/kind misc

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.

Release Notes

NONE

@tekton-robot tekton-robot added release-note-none Denotes a PR that doesnt merit a release note. kind/misc Categorizes issue or PR as a miscellaneuous one. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jan 20, 2022
@abayer
Copy link
Contributor Author

abayer commented Jan 20, 2022

/assign @dibyom

@tekton-robot
Copy link

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

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

@abayer
Copy link
Contributor Author

abayer commented Jan 20, 2022

Oh, and I'll follow this up with a PR like tektoncd/pipeline#4494 to add generated API reference docs.

@tekton-robot
Copy link

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

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

@tekton-robot
Copy link

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

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

@tekton-robot
Copy link

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

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

And fix tektoncd#1271 along the way by using the same scripting as in tektoncd/pipeline#4402 to ignore API rule violations for `name_match` which already exist. Any new mismatch will cause an error.

Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>
@tekton-robot
Copy link

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

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

fmt.Println(string(jsonBytes))
}

func swaggify(name string) string {
Copy link
Member

Choose a reason for hiding this comment

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

question: Why do we need to this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I literally just copied this over from Pipelines - I assume it does something relating to swagger.json.

Copy link
Member

Choose a reason for hiding this comment

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

ah ok. was curious as to why we need to have this custom function.

@tekton-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dibyom

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 Jan 25, 2022
@abayer
Copy link
Contributor Author

abayer commented Jan 25, 2022

fyi, once this merges, I'll have another PR that'll generate API reference docs like in tektoncd/pipeline#4494 (though for Pipelines we currently have to use a fork of https://github.com/ahmetb/gen-crd-api-reference-docs because of the pkg/apis/pipeline/pod package's unversioned weirdness - here we don't need that).

@dibyom
Copy link
Member

dibyom commented Jan 25, 2022

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 25, 2022
@tekton-robot tekton-robot merged commit c8ca0ed into tektoncd:main Jan 25, 2022
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/misc Categorizes issue or PR as a miscellaneuous one. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesnt merit a release note. 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.

API rule violations in Triggers types
3 participants