-
Notifications
You must be signed in to change notification settings - Fork 52
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
The generated schema does no longer work in kubeapps #15
Comments
Hi @antgamdia , About the suggestions, we could add those new properties as modifiers, but, that would require adding them chart by chart in order to be consumed by Kubeapps. That from my point would be kind of confusing since we would be adding properties to the charts that for most of the charts users that do not use kubeapps would have no sense. Apart from that, modifying all the charts every time we or anyone needs a new property is not scalable at all. With that in mind, my proposal is to create a new feature for the readme-generator to customize the metadata. To do that, we can allow passing a new file to the CLI like: path.to.the.parameter.in.the.values:
x-kubeapps-form: false
x-kubeapps-hidden: {} Then, that object will be appended to the generated metadata, and either the Kubeapps team, or any other users can extend the generated metadata without the need of modifying the charts. Those teams can create their own "metadata extensions file". Also, to avoid errors when the upstream charts' values are updated, we would add the necessary checks that the values paths in the extensions exist in the current chart, failing otherwise. Would that proposal fit your needs? |
Thanks for the quick response!
Yep, I also agree it shouldn't be coupled to the chart, that's why I suggested using extensions. It should be something totally optional and transparent for users who want to parse the schema with any other tool. That said, I think we need to decide which is the best way to proceed from now on. In the past (and present, I'd say), the chart catalog did have information regarding how it should be presented in Kubeapps, so we just rely on it. If, from now on, we plan to alter this behavior (requiring an additional file appended to the metadata, for instance), it would require some extra effort on our side to adapt Kubeapps logic accordingly.
I get the big picture, but not 100% sure what you're suggesting: do you mean having the current (from our side, it's not the same reading more props in an already downloaded file that start fetching a brand new file) Another approach could be leveraging the conditionals in JSONSchema [1], and model the parameter's dependencies based on a combination of The main issue, for us, is that new PRs and changes to the chart that also run this tool (like this commit) will lose information that is already present in the chart catalog (regardless this is a good idea or not). For us, it resulted in a CI failure and a delay in our release (since we depended on, precisely, the Apache chart to have a form 😬 ), but general users (and commercial ones) will get the forms they are used to see wiped out. I think we have to arrange a meeting to discuss the future of the chart metadata and kubeapps visualization at some point. (I mean, it is not this tool that is to blame, I'm super happy it finally exists and it's working so great! hehehe) CCing @absoludity and @ppbaena [1] https://json-schema.org/understanding-json-schema/reference/conditionals.html |
Exactly.
I don't totally get how the information could be lost in the referenced PR. In principle, this tool will sync the metadata with the new chart changes so once that PR is merged the metadata should be re-generated and it will be synced with the new changes. |
There was information already encoded in the
I don't remember how many charts in the bitnami catalog contained custom data in the The solution you've outlined @miguelaeh sounds great. If we could extract the existing data that was deleted from the The question is whether we can delay the Kubeapps release until that is done. I guess not. It's already broken now since the current Apache chart no longer has the info. |
Hi @absoludity ,
|
Excellent, thanks @miguelaeh ! |
The PR should unblock you for now. Setting as hold until we work on the new feature. |
Hi @miguelaeh . I'm just keen to ensure the proposal is clear before any work is started in the generator, so a few questions related to the proposal:
By "modifiers", do you explicitly mean modifiers in the values.yaml that are currently used when generating the readme? If so, great, I think everyone agrees that the extra data should not be encoded in the values.yaml as modifiers.
Yep, any solution should only affect charts that choose to support a simpler UX for the values.
+1 .
So I'm uncertain what you mean by the "metadata" here. Do you specifically mean the metadata within
Great - a separate file referencing fields in the values/schema, with the specific data for the simpler UX for that chart sounds good, isolating that extra data. But I think Antonio and I are expecting that this file would be stored in the catalog with the chart (like it is currently), whereas I'm not sure whether that's what you're thinking? Note that the data can be potentially useful to any other UX that presents this info to users (even though it's only Kubeapps using it right now).
Can you clarify what this means? I'm not sure if you're proposing adding it to the generated values.schema.json or something else (and both options are possible and have pros and cons)
So it's this sentence that leaves me thinking you mean that this info would be separate from the catalog, something managed by other teams. This worries me a bit because Kubeapps doesn't (currently) store any data about charts other than what's in the catalog. We could update to keeping a separate data store but that will be fraught with problems because the data is related to specific charts and chart versions of a chart repository. Users install whatever chart repository they want, without any correlation between our simple form data and the charts in a repo added by the user.
Great, but this leaves me thinking that you do indeed mean for the data to be present in the catalog so that it can be verified when running the generator?
Depending on the above, I think so. But there are a few other considerations worth looking at before we decide. I don't need you to specify a solution now, I just want to ensure that before we start on this, we write a short google doc outlining what is required, what the solution is etc., and we can have a meeting about it at that time. FWIW, I wonder whether the file with the simple form data should be left separate from the values.schema.json, rather than integrating the metadata into it (perhaps just using the form you've specified above). This would have the following advantages:
So longer term, it may be better for users of the data if it's not embedded in the values.schema.json. Let's discuss that option further at the time. |
Hi @absoludity ,
Currently, the readme-generator is generating a file (if you provide the
This is something we can discuss, we could store that file with the charts, create a new folder just for that kind of file in the Helm Charts repository... There are several options here, we can talk about them to decide the best.
Not exactly, the generator receives the file's paths as parameters so those files could be at any path in the system where the generator is executed.
Indeed, that was the proposal, let me explain it in another way just in case. Currently, we have ## @section Example Section
## @param some.ui.object An example to show the metadata
some:
ui:
object: "test" It will generate the following table into the readme: ## Parameters
### Example Section
| Name | Description | Value |
| ---------------- | ------------------------------- | ------ |
| `some.ui.object` | An example to show the metadata | `test` | Also, if we provide the {
"title": "Chart Values",
"type": "object",
"properties": {
"some": {
"type": "object",
"properties": {
"ui": {
"type": "object",
"properties": {
"object": {
"type": "string",
"default": "test",
"description": "An example to show the metadata"
}
}
}
}
}
}
} So, the idea is, once the generator has that JSON, we provide a new file like the following (no matter if it is on the catalog or not, we need to pass the path): some.ui.object:
x-kubeapps-form: false
x-kubeapps-hidden: {} so, those extra properties are appended, resulting in: {
"title": "Chart Values",
"type": "object",
"properties": {
"some": {
"type": "object",
"properties": {
"ui": {
"type": "object",
"properties": {
"object": {
"type": "string",
"default": "test",
"description": "An example to show the metadata"
"x-kubeapps-form": false
"x-kubeapps-hidden": {}
}
}
}
}
}
}
} Storing the |
I'll try to summarize this discussion adding some concerns recently appeared. Background:
Proposal:
|
@fmulero Wouldn't it be necessary for the extension metadata line to include the parameter name as well like it's done with ## @param replicas Number of replicas of the Apache deployment
## @deprecated
- ## @extension X-kubeapps-render slider
+ ## @extension replicas X-kubeapps-render slider
replicas: 1 |
Sorry for my late reponse. To be honest I didn't have enough time to work on this topic, but your suggestion makes sense keeping in mind how we are using the ## Configure extra options for startup probe
## @param master.startupProbe.enabled Enable startupProbe
## @param master.startupProbe.initialDelaySeconds Initial delay seconds for startupProbe
## @param master.startupProbe.periodSeconds Period seconds for startupProbe
## @param master.startupProbe.timeoutSeconds Timeout seconds for startupProbe
## @param master.startupProbe.failureThreshold Failure threshold for startupProbe
## @param master.startupProbe.successThreshold Success threshold for startupProbe
##
startupProbe:
enabled: false
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 6
successThreshold: 1 |
Context: we (Kubeapps team) discovered that the Apache v8.8.0 broke our CI process because of the form not being rendered (because of the changes in [1]). This makes us think about the short-term future of the forms feature in Kubeapps [2].
Kubeapps relies on the custom
form
property to be true to render the values. I don't think it is something we should continue doing, but instead, rendering every property by default unless explicitly hidden.Let me show an example with the old and new schema excerpts:
Old custom one:
New OpenAPI-compliant one:
We highlight here:
title
property does not exist anymore, but it would be really useful for us, since the form labels will be clearer for the users.form
property does not exist anymorehidden
property does not exist anymoreAlso, according to the spec (we're using 3.0.x, as far as I can remember), This object MAY be extended with Specification Extensions., so here are my suggestions:
title
property, even if nothing is passed, it defaults to thedescription
or the object key.x-kubeapps-form: false
for hiding the forms?x-kubeapps-hidden: {}
object for the same purpose ashidden
is now for?What do you think?
[1] bitnami/charts@e3a8529#diff-ca31c7e60e6b0504ec10491ce8d590588c00763730b6ee3e18382f14f9cf688b
[2] vmware-tanzu/kubeapps#3526
The text was updated successfully, but these errors were encountered: