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

API rule violations in Triggers types #1271

Closed
dibyom opened this issue Nov 24, 2021 · 6 comments · Fixed by #1297
Closed

API rule violations in Triggers types #1271

dibyom opened this issue Nov 24, 2021 · 6 comments · Fixed by #1297
Assignees
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.

Comments

@dibyom
Copy link
Member

dibyom commented Nov 24, 2021

Expected Behavior

Triggers should have 0 API violations

Actual Behavior

Running openapi-gen results in the following API violations:

 go run k8s.io/kube-openapi/cmd/openapi-gen \
    --input-dirs ./pkg/apis/triggers/v1beta1,knative.dev/pkg/apis,knative.dev/pkg/apis/duck/v1beta1 \
    --output-package ./pkg/apis/triggers/v1beta1 -o ./ \
    --go-header-file hack/boilerplate/boilerplate.go.txt
API rule violation: list_type_missing,github.com/tektoncd/triggers/pkg/apis/triggers/v1beta1,BitbucketInterceptor,EventTypes
API rule violation: list_type_missing,github.com/tektoncd/triggers/pkg/apis/triggers/v1beta1,CELInterceptor,Overlays
API rule violation: list_type_missing,github.com/tektoncd/triggers/pkg/apis/triggers/v1beta1,EventListenerSpec,TriggerGroups
API rule violation: list_type_missing,github.com/tektoncd/triggers/pkg/apis/triggers/v1beta1,EventListenerSpec,Triggers
API rule violation: list_type_missing,github.com/tektoncd/triggers/pkg/apis/triggers/v1beta1,EventListenerTrigger,Bindings
API rule violation: list_type_missing,github.com/tektoncd/triggers/pkg/apis/triggers/v1beta1,EventListenerTrigger,Interceptors
API rule violation: list_type_missing,github.com/tektoncd/triggers/pkg/apis/triggers/v1beta1,EventListenerTriggerGroup,Interceptors
API rule violation: list_type_missing,github.com/tektoncd/triggers/pkg/apis/triggers/v1beta1,GitHubInterceptor,EventTypes
API rule violation: list_type_missing,github.com/tektoncd/triggers/pkg/apis/triggers/v1beta1,GitLabInterceptor,EventTypes
API rule violation: list_type_missing,github.com/tektoncd/triggers/pkg/apis/triggers/v1beta1,NamespaceSelector,MatchNames
API rule violation: list_type_missing,github.com/tektoncd/triggers/pkg/apis/triggers/v1beta1,PodTemplate,Tolerations
API rule violation: list_type_missing,github.com/tektoncd/triggers/pkg/apis/triggers/v1beta1,TriggerBindingSpec,Params
API rule violation: list_type_missing,github.com/tektoncd/triggers/pkg/apis/triggers/v1beta1,TriggerInterceptor,Params
API rule violation: list_type_missing,github.com/tektoncd/triggers/pkg/apis/triggers/v1beta1,TriggerSpec,Bindings
API rule violation: list_type_missing,github.com/tektoncd/triggers/pkg/apis/triggers/v1beta1,TriggerSpec,Interceptors
API rule violation: list_type_missing,github.com/tektoncd/triggers/pkg/apis/triggers/v1beta1,TriggerTemplateSpec,Params
API rule violation: list_type_missing,github.com/tektoncd/triggers/pkg/apis/triggers/v1beta1,TriggerTemplateSpec,ResourceTemplates
API rule violation: list_type_missing,github.com/tektoncd/triggers/pkg/apis/triggers/v1beta1,WebhookInterceptor,Header
API rule violation: names_match,github.com/tektoncd/triggers/pkg/apis/triggers/v1beta1,EventListenerConfig,GeneratedResourceName
API rule violation: names_match,github.com/tektoncd/triggers/pkg/apis/triggers/v1beta1,InterceptorRequest,InterceptorParams
API rule violation: names_match,github.com/tektoncd/triggers/pkg/apis/triggers/v1beta1,KubernetesResource,WithPodSpec
API rule violation: names_match,github.com/tektoncd/triggers/pkg/apis/triggers/v1beta1,StatusError,s
API rule violation: names_match,github.com/tektoncd/triggers/pkg/apis/triggers/v1beta1,TriggerContext,EventID
API rule violation: names_match,github.com/tektoncd/triggers/pkg/apis/triggers/v1beta1,TriggerContext,EventURL
API rule violation: names_match,github.com/tektoncd/triggers/pkg/apis/triggers/v1beta1,TriggerContext,TriggerID
API rule violation: names_match,github.com/tektoncd/triggers/pkg/apis/triggers/v1beta1,TriggerSpecBinding,APIVersion
API rule violation: names_match,github.com/tektoncd/triggers/pkg/apis/triggers/v1beta1,TriggerSpecTemplate,APIVersion
API rule violation: names_match,github.com/tektoncd/triggers/pkg/apis/triggers/v1beta1,TriggerTemplateSpec,ResourceTemplates

Steps to Reproduce the Problem

  1. go run k8s.io/kube-openapi/cmd/openapi-gen \ --input-dirs ./pkg/apis/triggers/v1beta1,knative.dev/pkg/apis,knative.dev/pkg/apis/duck/v1beta1 \ --output-package ./pkg/apis/triggers/v1beta1 -o ./ \ --go-header-file hack/boilerplate/boilerplate.go.txt
@dibyom dibyom added kind/bug Categorizes issue or PR as related to a bug. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. labels Nov 24, 2021
@khrm
Copy link
Contributor

khrm commented Dec 13, 2021

Should we create an exception list or do we need to change the names?

@dibyom
Copy link
Member Author

dibyom commented Dec 13, 2021

We might have to create an exception list for the names_match ones. We should fix the list_type_missing ones

@savitaashture savitaashture added the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Dec 15, 2021
@abayer
Copy link
Contributor

abayer commented Jan 19, 2022

fwiw, I can't find a way to specify exceptions to rules. If I'm missing something, I'd love to know so I can change tektoncd/pipeline#4402 to ignore the mismatched names. Oh, and I'll happily take this on as well. =)

abayer added a commit to abayer/triggers that referenced this issue Jan 19, 2022
This is part of tektoncd#1271 - `names_match` violations still need to be dealt with.

Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>
tekton-robot pushed a commit that referenced this issue Jan 20, 2022
This is part of #1271 - `names_match` violations still need to be dealt with.

Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>
@dibyom
Copy link
Member Author

dibyom commented Jan 20, 2022

Hmmm...I had found this https://github.com/kubernetes/kubernetes/tree/36981002246682ed7dc4de54ccc2a96c1a0cbbdb/api/api-rules though I'm not sure if this is something directly supported by the tool or if they wrote something on top to ignore the specific violations

@abayer
Copy link
Contributor

abayer commented Jan 20, 2022

Yeah, looks like it's custom. We can probably rig that up ourselves, I'll take a look.

@abayer
Copy link
Contributor

abayer commented Jan 20, 2022

abayer added a commit to abayer/triggers that referenced this issue Jan 20, 2022
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>
abayer added a commit to abayer/triggers that referenced this issue Jan 20, 2022
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>
abayer added a commit to abayer/triggers that referenced this issue Jan 20, 2022
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>
abayer added a commit to abayer/triggers that referenced this issue Jan 21, 2022
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>
abayer added a commit to abayer/triggers that referenced this issue Jan 21, 2022
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>
@dibyom dibyom self-assigned this Jan 24, 2022
tekton-robot pushed a commit that referenced this issue Jan 25, 2022
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.

Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>
khrm pushed a commit to khrm/triggers that referenced this issue May 6, 2022
This is part of tektoncd#1271 - `names_match` violations still need to be dealt with.

Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>
khrm pushed a commit to khrm/triggers that referenced this issue May 6, 2022
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>
khrm pushed a commit to khrm/triggers that referenced this issue May 6, 2022
This is part of tektoncd#1271 - `names_match` violations still need to be dealt with.

Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>
khrm pushed a commit to khrm/triggers that referenced this issue May 6, 2022
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>
khrm pushed a commit to khrm/triggers that referenced this issue May 6, 2022
This is part of tektoncd#1271 - `names_match` violations still need to be dealt with.

Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>
khrm pushed a commit to khrm/triggers that referenced this issue May 6, 2022
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants