-
Notifications
You must be signed in to change notification settings - Fork 706
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
Basic form docs #1228
Basic form docs #1228
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff! A couple of wording thoughts but feel free to ignore as you like. One question about allowing defaults even though they can be specified in the values, that I'm keen to understand.
docs/developer/basic-form-support.md
Outdated
|
||
**NOTE:** This feature is under heavy development. Some of the described below may change in the future. | ||
|
||
Since Kubeapps 1.6.0, it's possible to attach a chart with a JSON schema that defines the structure of the `values.yaml` file. This JSON schema is used with two goals: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/attach/include/
docs/developer/basic-form-support.md
Outdated
|
||
Since Kubeapps 1.6.0, it's possible to attach a chart with a JSON schema that defines the structure of the `values.yaml` file. This JSON schema is used with two goals: | ||
|
||
- Validate that the given values satisfy the schema defined. In case the submitted values are not valid, the installation or upgrade will fail. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worth mentioning that this is actually the helm 3 use-case.
docs/developer/basic-form-support.md
Outdated
Since Kubeapps 1.6.0, it's possible to attach a chart with a JSON schema that defines the structure of the `values.yaml` file. This JSON schema is used with two goals: | ||
|
||
- Validate that the given values satisfy the schema defined. In case the submitted values are not valid, the installation or upgrade will fail. | ||
- Present the user with a simple (basic) form so the chart is easier to deploy and configure. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"with a simpler form" rather than "with a simple (basic) form"
docs/developer/basic-form-support.md
Outdated
- Validate that the given values satisfy the schema defined. In case the submitted values are not valid, the installation or upgrade will fail. | ||
- Present the user with a simple (basic) form so the chart is easier to deploy and configure. | ||
|
||
The goal of the basic form is to define the most common parameters that users typically modify before deploying a chart (like username and password) so they are able to modify them with a more user-friendly form. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The form itself isn't defining the most common properties - the schema is, right? So perhaps, "The goal of this feature is to present the user with the most common parameters which are typically modified before deploying a chart (like username and password) in a more user-friendly form."
docs/developer/basic-form-support.md
Outdated
|
||
## Additional annotations used to identify basic parameters | ||
|
||
In order to identify, among all the values specified in the schema, the values that should be presented in the form, it's necessary to include some special tags. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simpler: In order to identify which values should be presented in the form, ...
docs/developer/basic-form-support.md
Outdated
|
||
In order to identify, among all the values specified in the schema, the values that should be presented in the form, it's necessary to include some special tags. | ||
|
||
First of all, it's necessary to specify the tag `form`. This field should be unique and it should identify the parameter. All the properties marked with this key in the schema will be represented in the form. For example: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/This field/The value of the form
tag/ (and standardise on either field or tag or key)
docs/developer/basic-form-support.md
Outdated
}, | ||
``` | ||
|
||
With the definition above, we are marking the value `wordpressUsername` as a value to be represented in the form (with the ID `username`). Note that we are also specifying the `type` that will be used to render the proper HTML components to represent the input in the form: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't type
part of the jsonschema, and it's also being used here to render? In which case "Note that the type
is also used to render..." (the current sentence implies that we're only specifying it for the rendering, rather than because it's part of the schema).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay, yes, it's used for both
docs/developer/basic-form-support.md
Outdated
|
||
In addition to the `type`, there are other tags that can be used to customize the way the parameter is represented: | ||
|
||
- `title` is used to render the title of the parameter. If it's not specified, Kubeapps will use the ID of the component. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Kubeapps will use the ID of the component (ie. the value of the form
field)." (it wasn't 100% clear, but I see now that's what you're referring to).
docs/developer/basic-form-support.md
Outdated
|
||
- `title` is used to render the title of the parameter. If it's not specified, Kubeapps will use the ID of the component. | ||
- `description` is used to include additional information of the parameter. | ||
- `default` is used to set a default value. If it's not set, the default value from the `values.yaml` file will be used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh ... not sure that's a good idea? Why have two places to specify a default, so that you'll get different defaults depending on what UI you use? What is the reason for having a second default here rather than just using the one from the values.yaml always?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, I expressed it the other way. If the value is set in the values.yaml
it will always be used as the default. In case that is not set and the default
value is set in the schema, that one will be used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but is there any reason to enable setting a default in the schema for a field at all, given the right place for that is already in the values.yaml? If not, I'd personally update this sentence removing any mention of default (or just saying the default is set in the values) and later remove support for a separate default in the schema. +1 either way, but I'm keen to know if there's a need at all for a second way to set the default for a field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the review!
docs/developer/basic-form-support.md
Outdated
}, | ||
``` | ||
|
||
With the definition above, we are marking the value `wordpressUsername` as a value to be represented in the form (with the ID `username`). Note that we are also specifying the `type` that will be used to render the proper HTML components to represent the input in the form: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay, yes, it's used for both
docs/developer/basic-form-support.md
Outdated
|
||
- `title` is used to render the title of the parameter. If it's not specified, Kubeapps will use the ID of the component. | ||
- `description` is used to include additional information of the parameter. | ||
- `default` is used to set a default value. If it's not set, the default value from the `values.yaml` file will be used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, I expressed it the other way. If the value is set in the values.yaml
it will always be used as the default. In case that is not set and the default
value is set in the schema, that one will be used.
Ref: #1182