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

Build chart parameter docs from values.schema.json #15827

Merged
merged 3 commits into from May 13, 2021

Conversation

jedcunningham
Copy link
Member

This automatically builds the chart parameter docs page from the
values.schema.json. It also tracks and enforces that the defaults in
values.yaml and values.schema.json match.

The parameter docs page now has different sections, which are set in the
schema file under docs_schema. That key is required for top level
properties in the schema file, and optional otherwise as the parents
docs_schema is used as a default.

We also now have a schema for our values.schema.json in
values_schema.schema.json which enforces the items we need to build
the docs are set appropriately: docs_schema, default, and
description.

Closes #15771

@github-actions
Copy link

The Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*.

@github-actions
Copy link

The Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*.

This automatically builds the chart parameter docs page from the
`values.schema.json`. It also tracks and enforces that the defaults in
`values.yaml` and `values.schema.json` match.

The parameter docs page now has different sections, which are set in the
schema file under `docs_schema`. That key is required for top level
properties in the schema file, and optional otherwise as the parents
`docs_schema` is used as a default.

We also now have a schema for our `values.schema.json` in
`values_schema.schema.json` which enforces the items we need to build
the docs are set appropriately: `docs_schema`, `default`, and
`description`.
chart/values.yaml Outdated Show resolved Hide resolved
@@ -2,68 +2,112 @@
"$schema": "http://json-schema.org/draft-07/schema",
"description": "Default values for airflow. Declare variables to be passed into your templates.",
"type": "object",
"docs_section_order": [
Copy link
Member

Choose a reason for hiding this comment

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

What do you think to use the x- prefix to denote that this field is not part of the official JSON Schema specification? This is not required in our case, but I think it will improve readability.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm okay with that. Maybe x-docsSectionOrder and x-docsSection? Feels like we should use the x- prefix everywhere for non standard fields?

Copy link
Member

Choose a reason for hiding this comment

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

Let's do it in the follow-up PR please

Copy link
Member Author

Choose a reason for hiding this comment

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

chart/values.yaml Outdated Show resolved Hide resolved
@kaxil kaxil merged commit 2a8bae9 into apache:master May 13, 2021
@kaxil kaxil deleted the chart-param-docs branch May 13, 2021 20:58
@calebwoofenden
Copy link

How is a user meant to actually view the documentation following this change? Trying to view the file on github just shows the jinja code instead of the list of parameters.

@jedcunningham
Copy link
Member Author

For the sake of cross linking, I relied here: #26914 (comment)

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

Successfully merging this pull request may close these issues.

Automate docs for values.yaml via pre-commit config and break them into logical groups
4 participants