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

Replace gen-crd-api-reference-docs for API documentation generation #6144

Open
ArthurSens opened this issue Dec 6, 2023 · 11 comments
Open

Comments

@ArthurSens
Copy link
Member

In #6001 we noticed that inline structs in our API are not reflected by gen-crd-api-reference-docs.

The author of gen-crd-api-reference-docs also mentions how the tool is not maintained anymore and other options, like elastic/crd-ref-docs, have already fixed the inline structs problem.

We want to move away from gen-crd-api-reference-docs for the reasons above

slashpai added a commit to slashpai/prometheus-operator that referenced this issue Dec 15, 2023
Fixes prometheus-operator#6144

Signed-off-by: Jayapriya Pai <slashpai9@gmail.com>
@slashpai slashpai self-assigned this Dec 15, 2023
@slashpai slashpai removed their assignment Feb 29, 2024
@slashpai
Copy link
Contributor

I cleared my assignment as I didnt get enough time to work on this one but this can be a good one to get started for GSoc :)

@slashpai slashpai pinned this issue Feb 29, 2024
@haanhvu
Copy link
Contributor

haanhvu commented Mar 4, 2024

I cleared my assignment as I didnt get enough time to work on this one but this can be a good one to get started for GSoc :)

@slashpai maybe a good first issue tag so that folks can find?

@ArthurSens
Copy link
Member Author

I haven't put the label before because I like CNCF's guidelines for labeling something with good-first-issue, I'll try to improve the issue description later 😬

@slashpai
Copy link
Contributor

slashpai commented Mar 5, 2024

@ArthurSens sure, I think since replacing the gen library doesn't need to have prometheus-operator knowledge much it can be a tackle for someone familiar with go as well. Do you want to remove good first label on this?

@ArthurSens
Copy link
Member Author

@ArthurSens sure, I think since replacing the gen library doesn't need to have prometheus-operator knowledge much it can be a tackle for someone familiar with go as well. Do you want to remove good first label on this?

nah let's keep it :)

@mouad-eh
Copy link
Contributor

mouad-eh commented Mar 8, 2024

just showing interest for working on this (already started in fact). I will follow up with a PR in the upcoming days.

@mouad-eh
Copy link
Contributor

mouad-eh commented Mar 9, 2024

I have been experimenting with elastic/crd-ref-docs today and here are some important notes I took:

  • If we want to migrate to this tool, we cannot just change the binary and expect everthing to work seamlessly because this fork is a lot different from the original repo. Both config file and templates needs to be changed as they have different fields and structure.
  • It is true that this fork support type embedding but It didn't work when I tried it with prometheus-operator api files. the reason is that pointers are used for the type embedding (in the case of ProxyConfig) and they do not support that, they only support struct types embedding.
  • // +kubebuilder:object:root=true need to be added as a comment to highlight resource types from other types.
  • When I tried the default templates provided on their repo , I found that resource types are not listed first before other types and they rely strictly on the alphabetical order for sorting.

@slashpai @ArthurSens your thoughts on this?

@ArthurSens
Copy link
Member Author

Thanks for taking a look!

  • If we want to migrate to this tool, we cannot just change the binary and expect everthing to work seamlessly because this fork is a lot different from the original repo. Both config file and templates needs to be changed as they have different fields and structure.

Yeah, that was expected I guess... no problems in changing everything, it's just a lot of work 😬

  • It is true that this fork support type embedding but It didn't work when I tried it with prometheus-operator api files. the reason is that pointers are used for the type embedding (in the case of ProxyConfig) and they do not support that, they only support struct types embedding.

Oh damn, that's a boomer. I'm not sure what would be the impact if we change this, maybe that's fine to change?

  • // +kubebuilder:object:root=true need to be added as a comment to highlight resource types from other types.
  • When I tried the default templates provided on their repo , I found that resource types are not listed first before other types and they rely strictly on the alphabetical order for sorting.

That's an easy fix :) no problems adding that annotation and no problems sorting things alphabetically

@haanhvu
Copy link
Contributor

haanhvu commented Mar 31, 2024

#6400 has been fixed. Seems like that has fixed this issue too?

@mouad-eh
Copy link
Contributor

Yes definitely. I thought the two issues were closed. However, if embedded struct pointers are used again the issue may reappear. That's why it is still open I guess.

@ArthurSens
Copy link
Member Author

The tool we're using is still deprecated, in my opinion we still want to replace it 😬

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants