-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add structural OpenAPI schema to Tekton CRDs #8490
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
Conversation
Hi @burigolucas. 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 Once the patch is verified, the new status will be reflected by the 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. |
/kind documentation |
/ok-to-test |
Hi @vdemeester, I have identified issues with the CRDs. A few of them were invalid due to recursive fields. Following the fix proposed in this issue Generating CRD manifest for struct with recursive field, I have added the markers
in the affected fields and regenerated the CRDs. I have also disabled the embedded object meta as it does not provide useful schema in my opinion and only makes the files more bloated. AFAIK, there is still one issue to be solved, namely, the CRD for the |
Yeah, that's was the inital problem 😅 |
|
@burigolucas could we refer to another schema ? |
Are you trying |
Yeah it's what (
You mean the |
I would be fine only having the shema for the |
I have just tried to remove the pipelineSpec from the schema of the pipelineRun and it is now small enough, even with both versions of the CRD. But we might need to reduce other CRDs further if we need to support |
Removed also the schema of |
daba633
to
f1f45fb
Compare
I am "fine" with requiring things to be done using |
This would be for the CRDs only, right?
This way users could point to |
@afrittoli should it be the other way around for a while. Like next release we have a |
Sure, we can do that, I was trying to avoid too many changes :D but it's safer the way you proposed |
Should we then keep the current CRDs untouched and store the new generated CRDs with schemas in a different path? |
If possible, I would prefer to have one version of the CRDs in the repos and, at release time:
@vdemeester @burigolucas WDYT? |
@vdemeester, @afrittoli I have revised all the previously falling e2e tests and made the required changes to fix the issues. I have also rebased the branch to a address a merge conflict and squashed all my commits to a single one as suggested in the documentation for contributors. I do not know to to fix the failing job pull-tekton-pipeline-go-coverage-df though. Could one of you please approve the workflows to check if all tests are now passing? Thanks in advance! |
/test pull-tekton-pipeline-go-coverage-df |
@afrittoli: No presubmit jobs available for tektoncd/pipeline@main In response to this:
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. |
@burigolucas ah there is one lint issue it seems. |
@@ -60,7 +60,7 @@ kind: TaskRun | |||
metadata: | |||
name: step-action-run | |||
spec: | |||
TaskSpec: | |||
taskSpec: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this example not executed in CI, or is it executed but the capital letter version was accepted somehow by Tekton?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought only noci
wasn't executed, but maybe I am wrong and those are not either ? 😓
It sounds weird that it would have accepted the capital letter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without the OpenAPI schema, the capitalization was not being validated and Tekton was accepting that. That is why I added a release note that users may be affected if they were not using capitalization correctly
@@ -109,3 +109,6 @@ ${REPO_ROOT_DIR}/hack/update-openapigen.sh | |||
|
|||
# Make sure the generated API reference docs are up-to-date | |||
${REPO_ROOT_DIR}/hack/update-reference-docs.sh | |||
|
|||
# Add structural OpenAPI schema to Tekton CRDs | |||
${REPO_ROOT_DIR}/hack/update-schemas.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After running this script, we need to verify that the generated CRDs have not been modified.
The verify-codegen.sh
script achieves this for the other code gens, but it does not include the config
folder, so it needs to be extended, otherwise we risk missing schema updates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@afrittoli Fixed on last commit, see hack/verify-codegen.sh
It's not in a file changed by this PR though, which should not happen... @vdemeester any idea why this happened? |
I need to check, but I think the github action checks all files by default (not just the changed one). |
@afrittoli See #8604 🙃 |
- Update year in hack/update-schemas.sh - Remote unused directive `//nolint:musttag`
@vdemeester I removed the unused directive in the latest commit. Should I rather revert it back then? |
This looks amazing! Now, I am sorry for the scope-creep but would it be possible to include the (It is just a suggestion and I understand that you might prefer to keep it for a separate PR) |
Given the back and forth on the PR, I would suggest we do this in a follow-up PR, but it's up to you @burigolucas.
If the CI is green, I think it's fine to keep as is 😉 |
Thanks for the great suggestion. I will be implementing this in a separate PR as soon we merge this one. @112358fn, would you mind creating a dedicated issue for this request with the explanation why this should be implemented? Perhaps not all lists should support strategic merge patch. The dedicated issue would help to keep all the related discussions in a dedicated thread. |
@vdemeester it looks like we are having rate limiting issues with DockerHub (See the extracts of the logs below for each of the 4 failed tests). Is this something new? Could we simply retry the failed set of tests to check for flaky results?
|
/retest |
@burigolucas does this issue description looks ok? |
/retest |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vdemeester 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 |
/lgtm |
Changes
Address Issue 1461 by implementing a script to update the OpenAPI schema to Tekton CRDs using controller-gen and adding the updated CRDs with OpenAPI schema.
Revise unit tests and example YAML files to address issues caused by the now enabled API server schema validation.
Note that the current script
hack/update-schemas.sh
return several errors/warnings and status code 1 from execution of the controller-gen CLI due to issues when parsing the schema from the source code. Besides, processing multiple files at once is causing segmentation fault. Therefore, in the script, each file is processed separately. In addition, FIXME notes are added to be addressed in the future once new features become available in controller-gen.Closes #1461
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
/kind <type>
. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes