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

Documentation not generated for non-standard API operations #353

Open
dshebib opened this issue Mar 18, 2024 · 11 comments
Open

Documentation not generated for non-standard API operations #353

dshebib opened this issue Mar 18, 2024 · 11 comments
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@dshebib
Copy link
Contributor

dshebib commented Mar 18, 2024

Reference: kubernetes/website#39259

There are non-standard operations which are listed in the OpenAPI specification for which the website API reference is not generated, e.g. pods/exec and pods/attach.

@dshebib
Copy link
Contributor Author

dshebib commented Mar 18, 2024

/assign

@dshebib
Copy link
Contributor Author

dshebib commented Mar 18, 2024

It seems that the source of this issue is that the x-kubernetes-group-version-kind field does not match the definition url, for example:

"/api/v1/namespaces/{namespace}/pods/{name}/exec": { "get": { "consumes": [ "*/*" ], "description": "connect GET requests to exec of Pod", "operationId": "connectCoreV1GetNamespacedPodExec", "produces": [ "*/*" ], "responses": { "200": { "description": "OK", "schema": { "type": "string" } }, "401": { "description": "Unauthorized" } }, "schemes": [ "https" ], "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "PodExecOptions", "version": "v1" } },
instead of "kind": "Pod"

It also is a 'connect' action, which is currently not documented in the API reference.

Given that this seems to be intentional, should we be fixing this?
@tengqm

@tengqm
Copy link
Contributor

tengqm commented Mar 19, 2024

right. The API spec contains several non-resource urls. If we want to support those paths, the generator needs a fix which won't be a trivial one.

@dshebib
Copy link
Contributor Author

dshebib commented Mar 22, 2024

See #354, it seems that the existing functionality for specifying operation categories allows the generator to pickup even non-standard operations based on a regex on the operation id.

After getting to know the code though I'm interested in fixing how the generator finds operations based on resource URL's. Do you have any others in mind that aren't getting generated and wouldn't be able to be added using this method?

@tengqm
Copy link
Contributor

tengqm commented Mar 23, 2024

I was not saying that this is not doable. We will need to consider the larger picture that not all endpoints are related to kubernetes resources. If we want to add support to the operations you mentioned, we can generalize the logic to cover all non-resource endpoints. That was the reason why I thought it a non-trivial task. I'm more than happy to see what we can do in this space.

@dshebib
Copy link
Contributor Author

dshebib commented Jun 5, 2024

See #363. Because the generator already parses all the operations, I just added a new section for those endpoints not associated with a resource or definition.

@dshebib
Copy link
Contributor Author

dshebib commented Jun 6, 2024

@tengqm There is another issue however that might require a rewrite. Currently we are using regex to match endpoint ID's to their associated resources, but this is subject to collision errors when there are two ID's which match to the same resource definition. If an endpoint or a resource is added which causes such a collision it could cause problems later on. I'd like to brainstorm potential ways to fix this together if you are willing.

@tengqm
Copy link
Contributor

tengqm commented Jun 6, 2024

The chance of having two ID's matching the same resource definition would be pretty low. The operation IDs are generated by combinding verbs, resources and "sub-resources". I think it should be fine at the moment.

@sftim
Copy link
Contributor

sftim commented Jul 4, 2024

/retitle Documentation not generated for non-standard API operations
/kind bug

@k8s-ci-robot k8s-ci-robot changed the title Fix Website API Generation for non-standard operations Documentation not generated for non-standard API operations Jul 4, 2024
@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Jul 4, 2024
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 2, 2024
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle rotten
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

5 participants