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

Added makefile command to autogen CRDs documentation #629

Merged
merged 19 commits into from
Aug 17, 2022

Conversation

mastrogiovanni
Copy link

I added a Makefile command to create a reference.md file into docs starting from CRDs from config/crd/base.
The tool chosen is a result of several trials since:

  • standard kubernetes tools requires connection to API Server
  • stardard kubernetes reference libraries works with openAPIv2 but not v3 (that is incomplete)
  • other tools (in python) ones seems incomplete and buggy and can introduce some problem in maintenance of the codebase
  • the tool chosen seems to belong to a cloud native platform with a good track record

@netlify
Copy link

netlify bot commented Aug 3, 2022

Deploy Preview for capsule-documentation ready!

Name Link
🔨 Latest commit ffb04c3
🔍 Latest deploy log https://app.netlify.com/sites/capsule-documentation/deploys/62f4235504ac810008285d8f
😎 Deploy Preview https://deploy-preview-629--capsule-documentation.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link
Member

@prometherion prometherion left a comment

Choose a reason for hiding this comment

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

The generated files must be committed, each commit must be atomic and ensuring all the auto-generated files are up to date.

Makefile Outdated Show resolved Hide resolved
Makefile Outdated
@@ -78,6 +78,9 @@ manifests: controller-gen
generate: controller-gen
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."

apidoc: apidocs-gen
$(APIDOCS_GEN) crdoc --resources config/crd/bases --output docs/content/general/references.md
Copy link
Member

Choose a reason for hiding this comment

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

Rather than pointing to docs/content/general/references.md, couldn't we use a template to reference the resulting file in the references.md file that is useful since providing further information about Capsule?

e.g.:

# Reference

Reference document for Capsule Operator configuration

## Custom Resource Definition

{{ .tenantCRDMarkdown }}

## Capsule Configuration

The Capsule configuration can be piloted by a Custom Resource definition named `CapsuleConfiguration`.

{{ .capsuleConfigurationCRDMarkdown }}

Copy link
Member

@prometherion prometherion left a comment

Choose a reason for hiding this comment

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

Please, commit the file tenantCRDMarkdown.md too since it seems generated, and don't drop the file docs/content/general/references.md.

Since we're talking about generation of file, please, add also a CI check as we're doing here to detect uncommitted changes: since these are docs related, we could add another step just for it.

config/crd/bases/capsule.clastix.io_tenants.yaml Outdated Show resolved Hide resolved
@mastrogiovanni
Copy link
Author

I reset the references.md file to the old version and I just added the newly generated tenantCRDMarkdown.md to the PR. Not clear to me if references.md need to be autogenerated or not. I think that having a section for CRD and another for the rest is the best strategy.

@prometherion
Copy link
Member

I think that having a section for CRD and another for the rest is the best strategy.

Absolutely, let's remove the CRD scheme from docs/content/general/references.md file, pointing with a link to the new file.

Remember to add it to the side menu, suddenly after References with the title APIs.

@prometherion
Copy link
Member

The output rendered is not so superb: https://deploy-preview-629--capsule-documentation.netlify.app/docs/general/tenant-crd#capsuleconfiguration.

Could we try to customize it a bit, by removing the ↩ Parent link?

@mastrogiovanni
Copy link
Author

I customized the template that originate the page and added some styling to improve table readibility

@prometherion prometherion added this to the v0.2.0 milestone Aug 17, 2022
@prometherion prometherion added the documentation Improvements or additions to documentation label Aug 17, 2022
@prometherion prometherion merged commit e4ecbe3 into projectcapsule:master Aug 17, 2022
@prometherion prometherion modified the milestones: v0.2.0, v0.1.3 Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants