Skip to content
This repository was archived by the owner on May 5, 2021. It is now read-only.

PoC: Add support for templating #148

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

johnsudaar
Copy link
Collaborator

@johnsudaar johnsudaar commented Aug 6, 2019

This is a basic support for templating in wizzy.
Adding it ad the fs part make it really easy and makes templating available for every wizzy resources.

The templating engine used is handlebars: http://handlebarsjs.com/

@johnsudaar
Copy link
Collaborator Author

Small demo: https://streamable.com/7lghf

@Sytten
Copy link
Member

Sytten commented Aug 6, 2019

That is very nice! I feel like the original author is not maintaining the lib anymore. I think it would be worth forking or asking him to have a new maintainer.
How does it work if you import changes from the remote? I guess it would override it right?
Also I think it would be better if we could import those parameters from a configuration that could be set per environment.

@johnsudaar
Copy link
Collaborator Author

Thanks.
Yeah importing a dashboard would override the hbs file back to the raw json. I don't see any workarround for that.

Good idea having a way to store those variables in a file can be cool.
Maybe in wizzy/config.js we could use a variable entry that could be set globally and per context?

@Sytten
Copy link
Member

Sytten commented Aug 7, 2019

Yeah that's what I feared (for import), maybe a good first step would be to warn the user if he overrides a template? It would be nice to be able to be able to modify a dashboard in grafana and still be able to import the diff.

I am not sure I would put it all in config.js. It could be use for sensitive variables, but it would also be nice to have another file for non-sensitive variables that could be commited.

@utkarshcmu
Copy link
Collaborator

Feel free to merge this PR guys, you both have the ability to merge the PRs to the project. I will work on the Release and Org side so that you guys have more control on this project.

@johnsudaar
Copy link
Collaborator Author

Detecting if the template has been modified by the user or if the remote had changed is not an easy task.

We could add the templating engine only if the file has a particular extension (like: .json.tmpl) and warn the user if he tries to import a dashboard that has a template file.

@Sytten
Copy link
Member

Sytten commented Sep 3, 2019

Do you plan to finish the feature and add tests for it? It would be nice to have the feature land in 0.8.0.

@johnsudaar
Copy link
Collaborator Author

johnsudaar commented Feb 19, 2020

Hi there
Sorry for the long time there, i had other things that took priority ...

What does this PR miss to be merged ?

@Sytten
Copy link
Member

Sytten commented Feb 19, 2020

Heee let me review it, I am also super busy

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

Successfully merging this pull request may close these issues.

4 participants