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

Migrate to updated API reference generator #25505

Open
sftim opened this issue Dec 8, 2020 · 34 comments
Open

Migrate to updated API reference generator #25505

sftim opened this issue Dec 8, 2020 · 34 comments
Labels
area/web-development Issues or PRs related to the kubernetes.io's infrastructure, design, or build processes kind/feature Categorizes issue or PR as related to a new feature. language/en Issues or PRs related to English language lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. triage/accepted Indicates an issue or PR is ready to be actively worked on. wg/api-expression Categorizes an issue or PR as relevant to WG API Expression.

Comments

@sftim
Copy link
Contributor

sftim commented Dec 8, 2020

This is a Feature Request

What would you like to be added
k-sigs/reference-docs has a recently-added gen-resourcesdocs generator. Credit to @feloy for hard work on this.

Let's switch to using that generator [Preview] and make it the default.

This entails:

  • understanding how to preserve existing incoming hyperlinks
  • planning to update existing pages that link to API reference documentation
  • testing the new reference generation
  • revising the documentation on how to publish API reference information
  • making any shortcode or other changes needed based on the planning
  • switching over
  • logging work (GitHub issues) to update existing pages as planned

Why is this needed

The existing API documentation (example) uses a different style from the rest of the website, is harder to navigate than it could be, and is also difficult to localize.

Whilst it has served the Kubernetes project well, with the arrival of an alternative generation option it is time to look at switching.

Comments

/kind feature

/area web-development
(sic)

also
/language en

Relevant to issue #24441 and to kubernetes/kubernetes#19680

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. area/web-development Issues or PRs related to the kubernetes.io's infrastructure, design, or build processes language/en Issues or PRs related to English language needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Dec 8, 2020
@kbhawkey
Copy link
Contributor

kbhawkey commented Dec 9, 2020

Is there a suggested timeline for making the proposed changes?
There are quite a few (quick search found ~828) links that refer to sections in the single page reference.
I suspect that the new shortcode could help create replacement links to the appropriate resources?

@sftim
Copy link
Contributor Author

sftim commented Dec 9, 2020

My sketch for part of an idea: replace the current API reference with a page that uses JavaScript to calculate a redirect to the correct URL (based on the fragment identifier and some other information).
That JavaScript could either XMLHTTPRequest the real API reference pages, or use information available at site build time.

That would allow us to update existing inbound links gradually, including across the 12 downstream localizations. It would I think take that clean up away from the critical path for migrating, too.

For a long term migration away from that we could make a whole new redirection service eg https://api.k8s.io/example.k8s.io/v1beta1/KindOfObjectGoesHere - but we don't need to do that immediately, or even at all.

@kbhawkey
Copy link
Contributor

kbhawkey commented Dec 9, 2020

I was thinking that the root path for the API reference pages could serve as the new API reference URL (add a redirect)?
Are you suggesting to dynamically redirect every path off this base URL?

Perhaps the static assets and single HTML page can remain until every localization has updated their files.
The en content could start to use the shortcode to reference the resource pages (if every API ref link can be resolved by using the new shortcode).

@tengqm
Copy link
Contributor

tengqm commented Dec 10, 2020

Should we consider the coexistence of the two API reference representations for one or two release cycles?
It is a common practice for websites to serve two flavors of some contents till a complete switch over proves to be welcomed.

@sftim
Copy link
Contributor Author

sftim commented Dec 10, 2020

one or two release cycles?

I really would prefer not to break these URIs because they are referenced in code and documentation all over the web. That's why I really like the idea of a long lived helper that redirects to the new home.
We could redirect everything to one place but that's not much different from a 404 page; if someone has a link to the API for ConfigMap, then what they need to see is the API reference for ConfigMap. Otherwise they may as well ask a search engine.
(which right now will probably serve https://docs.openshift.com/container-platform/3.7/rest_api/api/v1.ConfigMap.html as the top result, FWIW)

@kbhawkey
Copy link
Contributor

Should we consider the coexistence of the two API reference representations for one or two release cycles?
It is a common practice for websites to serve two flavors of some contents till a complete switch over proves to be welcomed.

Yes, that seems reasonable. I have not thought about the timeline for completely switching over.
I suggest to decide on a timeline and set up a date to communicate this decision to the community (how and when these changes will finally happen). There may be issues logged. I see a short list of things to do:

  1. Update the intra-site links to refer to the new API reference pages.
  2. Determine how to redirect external requests for the current API reference sections to the new individual reference pages.
    There will not be a versioned or latest version of a single reference to link to.
  3. Make sure the Markdown API generator tool can be rebuilt, the build instructions are clear (both repos), the tool can consistently generate new API Markdown pages, and these generated pages can be added and build with the website.

@sftim
Copy link
Contributor Author

sftim commented Dec 10, 2020

Another option that we could consider:

  1. Replace all links (across localizations as well, if feasible) with a new shortcode. At this point the shortcode renders as a link to the old / existing API reference.
  2. Draft a revised shortcode that links to the new API reference.
  3. Update the “old” API generator so that the rendered API reference hyperlinks to the new one.
    • This doesn't have to be perfect.
  4. Publish the new API reference and switch the the updated shortcode.
  5. Update the old API reference to include links to the new API reference.

@feloy
Copy link
Member

feloy commented Dec 12, 2020

Should we consider the coexistence of the two API reference representations for one or two release cycles?
It is a common practice for websites to serve two flavors of some contents till a complete switch over proves to be welcomed.

Yes, that seems reasonable. I have not thought about the timeline for completely switching over.
I suggest to decide on a timeline and set up a date to communicate this decision to the community (how and when these changes will finally happen). There may be issues logged. I see a short list of things to do:

  1. Update the intra-site links to refer to the new API reference pages.

I'm updating the intra-links. I've changed the links in the Concepts and Tasks, I still have to change the links in the Reference section.

The changes are visibile in the PR #23294

  1. Determine how to redirect external requests for the current API reference sections to the new individual reference pages.
    There will not be a versioned or latest version of a single reference to link to.
  2. Make sure the Markdown API generator tool can be rebuilt, the build instructions are clear (both repos), the tool can consistently generate new API Markdown pages, and these generated pages can be added and build with the website.

@sftim
Copy link
Contributor Author

sftim commented Jan 20, 2021

PR #23294 has merged. I'll approach Kubernetes SIG Architecture to co-ordinate communications and other tasks about deprecating and moving away from the existing API documentation.

SIG Docs' preference is to shift away as part of a Kubernetes release (eg v1.21). One reason for this is that each release so far has broken the old API reference URLs anyway.

@sftim
Copy link
Contributor Author

sftim commented Jan 20, 2021

@reylejano are you happy to have this tracked against v1.21?

@neolit123
Copy link
Member

The existing API documentation (example uses a different style from the rest of the website, is harder to navigate than it could be, and is also difficult to localize.

one good thing about the old format is that it was easier to search the whole API reference using a browser Ctrl+F (search), since it was all on the same page.

@sftim
Copy link
Contributor Author

sftim commented Jan 20, 2021

Perhaps there's a way to improve the search(ability). For example, add an index to the foot of each API reference page.

@liggitt
Copy link
Member

liggitt commented Jan 20, 2021

Thanks for the update! I especially like how much better it renders on mobile devices.

Here is some initial feedback on the organization and rendering:

  1. The primary organization of the API is by API group → version → resource/kind. From https://kubernetes.io/docs/reference/kubernetes-api/, it is hard to know where documentation for types in various group/versions are, and I had to guess about which category a given type was placed into. Can we make the API group+version explicit in the index/navigational structure or overview pages?
  2. The URLs include the categorizations (".../services-resources/...", ".../workloads-resources/...", etc) which are somewhat arbitrary. Making the URLs based on the API group/version/kind will produce more stable URLs (makes it easier to address item 7 later in a follow-up).
  3. The representation of kinds with multiple versions available is confusing/missing:
    • For example, https://kubernetes.io/docs/reference/kubernetes-api/workloads-resources/ lists "HorizontalPodAutoscaler" and "HorizontalPodAutoscaler v2beta2". The first is implicitly in the autoscaling/v1 API group/version, but that isn't clear. We need to make it very clear what version the documentation is for (someone following the v1 HorizontalPodAutoscaler docs will not successfully construct a v2beta2 HorizontalPodAutoscaler manifest)
    • Documentation for some beta types seems to be missing altogether (Ingress v1beta1, for example).
  4. Some pages mix top-level types and nested type definitions. For example, https://kubernetes.io/docs/reference/kubernetes-api/workloads-resources/ has Pod, ReplicaSet, Deployment, etc, which can be created as objects, but also has Container, which only exists nested inside top-level types. I expected only top-level types to be linked from the overview pages.
  5. Grouping the "common parameters" page by operation would be helpful (parameters for get, list, watch, create, update, patch, delete, deletecollection operations, etc). Even if this duplicated some parameters (like dryRun, fieldManager, etc), it would make it easier to understand which bucket of parameters could be used in a given request).
  6. It's unclear what causes a type to appear in https://kubernetes.io/docs/reference/kubernetes-api/common-definitions/ ... these types I would have expected to have been on specific pages: DownwardAPIVolumeFile, ExecAction, HTTPGetAction, JSONSchemaProps, KeyToPath, NodeAffinity, NodeSelectorRequirement, PodAffinity, PodAntiAffinity, ResourceFieldSelector, TCPSocketAction
  7. Some of the type categorizations seemed odd to me... the lines between workload (pod, deployment, etc) + node (node, runtimeclass, etc) + scheduling (priorityclass, binding) are pretty blurry. I'd suggest getting sig-apps / sig-scheduling / sig-node involved to work on that organization. If we make the URLs not depend on the categorizations (see suggestion 2 above), it will be lower impact to switch up the categorizations in a follow-up.

@reylejano
Copy link
Member

@reylejano are you happy to have this tracked against v1.21?

@sftim Yes, I'm comfortable with this being tracked against v1.21. I want to review and capture any process changes for the release for the docs role handbook timeline.

@sftim
Copy link
Contributor Author

sftim commented Jan 22, 2021

@kbhawkey
Copy link
Contributor

kbhawkey commented Feb 8, 2021

Hi. As part of the migration, I'd like to understand the API categories and work on resolving some of the questions about navigation.

  • Do the categories server only to group the resource pages in the left hand navigation tree; Or,
  • Do the categories provide a clear pathway or hint to locate a resource?
  • There is a question about missing beta types. Log a separate issue?
    Documentation for some beta types seems to be missing altogether (Ingress v1beta1, for example).

Re: Comment:

The primary organization of the API is by API group → version → resource/kind. From https://kubernetes.io/docs/reference/kubernetes-api/, it is hard to know where documentation for types in various group/versions are, and I had to guess about which category a given type was placed into. Can we make the API group+version explicit in the index/navigational structure or overview pages?

Re: More comments:

The URLs include the categorizations (".../services-resources/...", ".../workloads-resources/...", etc) which are somewhat arbitrary. Making the URLs based on the API group/version/kind will produce more stable URLs (makes it easier to address item 7 later in a follow-up).
The representation of kinds with multiple versions available is confusing/missing:

    For example, https://kubernetes.io/docs/reference/kubernetes-api/workloads-resources/ lists "HorizontalPodAutoscaler" and "HorizontalPodAutoscaler v2beta2". The first is implicitly in the autoscaling/v1 API group/version, but that isn't clear. We need to make it very clear what version the documentation is for (someone following the v1 HorizontalPodAutoscaler docs will not successfully construct a v2beta2 HorizontalPodAutoscaler manifest)
    Documentation for some beta types seems to be missing altogether (Ingress v1beta1, for example).

@sftim
Copy link
Contributor Author

sftim commented Feb 15, 2021

I need to talk to SIG Architecture about stability (or not) of the URLs here.

@neolit123
Copy link
Member

The URLs include the categorizations (".../services-resources/...", ".../workloads-resources/...", etc) which are somewhat arbitrary. Making the URLs based on the API group/version/kind will produce more stable URLs (makes it easier to address item 7 later in a follow-up).

i think this is rather important.
categorizations are a nice to have and can be implement with labels / filters ALA github.

@sftim
Copy link
Contributor Author

sftim commented Feb 16, 2021

There is a question about missing beta types. Log a separate issue?

I agree, that sounds like a separate issue.

@kbhawkey
Copy link
Contributor

Catching up on this discussion. Can you provide more details on:
We can separate out the “presentation” grouping of resources (eg workloads, policy, etc) from the URL of the page about a particular resource in the API - and we should do so that we have stable URIs for the API reference pages.

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

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 Jun 10, 2021
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

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 Jul 10, 2021
@k8s-triage-robot
Copy link

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

This bot triages issues and PRs 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:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

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

/close

@k8s-ci-robot
Copy link
Contributor

@k8s-triage-robot: Closing this issue.

In response to this:

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

This bot triages issues and PRs 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:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

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

/close

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.

@sftim
Copy link
Contributor Author

sftim commented Aug 9, 2021

/reopen
/lifecycle frozen

@k8s-ci-robot
Copy link
Contributor

@sftim: Reopened this issue.

In response to this:

/reopen
/lifecycle frozen

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.

@k8s-ci-robot k8s-ci-robot reopened this Aug 9, 2021
@k8s-ci-robot k8s-ci-robot added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. labels Aug 9, 2021
@sftim
Copy link
Contributor Author

sftim commented Nov 15, 2021

I'm happy to keep working on this as time allows
/assign

@sftim
Copy link
Contributor Author

sftim commented Dec 15, 2022

/unassign

I haven't made much progress - when I get chunks of time, I'm spending those instead on other tasks; notably, https://kubernetes.io/docs/concepts/services-networking/service/

@k8s-triage-robot
Copy link

This issue has not been updated in over 1 year, and should be re-triaged.

You can:

  • Confirm that this issue is still relevant with /triage accepted (org members only)
  • Close this issue with /close

For more details on the triage process, see https://www.kubernetes.dev/docs/guide/issue-triage/

/remove-triage accepted

@k8s-ci-robot k8s-ci-robot added needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. and removed triage/accepted Indicates an issue or PR is ready to be actively worked on. labels Jan 19, 2024
@sftim
Copy link
Contributor Author

sftim commented Jan 22, 2024

/triage accepted

Still useful to provide a consistent reference.

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jan 22, 2024
@sftim
Copy link
Contributor Author

sftim commented Feb 18, 2024

/wg api-expression

What I'd like to see:

@k8s-ci-robot k8s-ci-robot added the wg/api-expression Categorizes an issue or PR as relevant to WG API Expression. label Feb 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/web-development Issues or PRs related to the kubernetes.io's infrastructure, design, or build processes kind/feature Categorizes issue or PR as related to a new feature. language/en Issues or PRs related to English language lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. triage/accepted Indicates an issue or PR is ready to be actively worked on. wg/api-expression Categorizes an issue or PR as relevant to WG API Expression.
Projects
None yet
Development

No branches or pull requests

10 participants