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

Extend variables support in templates used by the init command #2034

Closed
lorenzo-cavazzi opened this issue Apr 20, 2021 · 0 comments · Fixed by #2120
Closed

Extend variables support in templates used by the init command #2034

lorenzo-cavazzi opened this issue Apr 20, 2021 · 0 comments · Fixed by #2120
Assignees

Comments

@lorenzo-cavazzi
Copy link
Member

Is your feature request related to a problem? Please describe.
Currently, templates define variables without specifying any metadata.
To take advantage of the jinja templating tool, it would be nice to support type validation, enumerations and default values as specified here SwissDataScienceCenter/renku-project-template#109

Describe the solution you'd like
The new properties of a variable would be:

  • name: variable name, currently taken from the key. It must be unique (check when validating the template)
  • description: a short description for the variable intended use, currently taken from the value.
  • type: variable type. We should support at least string, enum, number, boolean. The validation should be done at project creation (check the specified values is valid/allowed when validating the template). Requiring the specific type is probably the easiest solution, but I would relax the constrain to accept also stringy numbers ("12" instead of 12), as well as 0 / 1, "0" / "1" or "true" / "false" (any capitalization) for booleans.
  • enum: an array of allowed values. This is mandatory when the type is "enum" and can't be specified when it is any other type (check when validating the template).
  • default: optional default value. It must have a valid type (check when validating the template).

The renku-core endpoint templates.read_manifest should change accordingly, providing the variables as an array of objects with the same properties specified above.

Describe alternatives you've considered
The primary goal is to support enumerations. Any alternative solution is welcome

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

Successfully merging a pull request may close this issue.

2 participants