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 special case operation names #364

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dshebib
Copy link
Contributor

@dshebib dshebib commented Jun 5, 2024

Adds a few more operations to the api documentation in the appropriate locations.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 5, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: dshebib
Once this PR has been reviewed and has the lgtm label, please assign feloy for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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 the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jun 5, 2024
Comment on lines -339 to -341
- getCodeVersion
- logFileHandler
- logFileListHandler
Copy link
Contributor

Choose a reason for hiding this comment

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

Please verify whether these operations are properly supported and thus should not be excluded.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

getCodeVersion: This seems to get the Kubernetes code version as intended
logFileHandle, logFileListHandler: Good catch, these are not supported

@dshebib
Copy link
Contributor Author

dshebib commented Jul 30, 2024

Should note that this PR will cause the generator to emit a few lines that are formatted as errors. @tengqm I am not familiar with the CI tools in this repo, should I reformat them as standard logs to avoid causing issues? The lines are the following:

�[31mNo Definition found for getCodeVersion [/version/].�[0m
�[31mNo Definition found for getServiceAccountIssuerOpenIDKeyset [/openid/v1/jwks/].�[0m
�[31mNo Definition found for getServiceAccountIssuerOpenIDConfiguration [/.well-known/openid-configuration/].�[0m
�[31mNo Definition found for createCoreV1NamespacedPodBinding [/api/v1/namespaces/{namespace}/pods/{name}/binding].�[0m

Emitted because though these operations have definitions, the generator does not associate them with a resource. The generated html after running the generator does not omit any pre-existing information and only moves information from the new Operations section to their respective sections (/pod/ etc.)

@tengqm
Copy link
Contributor

tengqm commented Aug 1, 2024

@dshebib The operations appear in the log because we don't have special logics to handle them.
In other words, our pattern matching logic cannot identify them as valid operations, and, that is the reason we temporarily excluded them from the reference docs generated.

For each operation from the swagger spec, we should either properly generate reference for that operator, or we should report it as an exception. We are not supposed to fail silently. This is the reason I asked you to double check this PR.

@dshebib
Copy link
Contributor Author

dshebib commented Aug 3, 2024

Sorry, I should have clarified. The documentation gets correctly generated according to the definition for the operation itself in the swagger.json. The error is generated because there is no associated resource definition. Therefore, the final behaviour is that documentation is generated for the endpoint in a miscellaneous 'operations' section:

image
image

@dshebib
Copy link
Contributor Author

dshebib commented Aug 3, 2024

In checking this, I found that the logic from my previous PR does not respect and exclude the excluded operations in the config from the miscellaneous operations section. I will fix this this weekend.

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. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants