Fixes #23569 - store metadata separately from template#5545
Conversation
|
Issues: #23569 |
|
I like the idea of not showing the metadata to the user, but some templates have comments on how to use the templates, can we not strip that out? |
|
I think most templates have comments in separate erb tag, which is correct as this would be invalid yaml. I'm happy split it to separate tag in community-template if you agree. Alternatively, how about we add a comment field to templates? Comment would then be another metadata attribute that we parse and store separately. Ofc that means I need to do changes in community-templates too. Or perhaps the field shouldn't be comment but help. Or usage or readme. |
I think that's fine. I didn't realize most separated it into two comments.
That would make it more visible to the users. The docs are mostly about what params a template uses. It'd be nice if we had a standard format to show what inputs a template like REX does. |
|
Btw foreman test failures are unrelated and to reply to @stbenjam last comment, the ultimate goal is to add the same inputs the rex templates have to provisioning templates and ptables. That way user knows what the template needs and we could do validations and generate form for user inputs too. |
|
@ares whats the status here? Are you going to add the help field? Do I understand it correctly that the purpose is to hide the metadata in both UI and API completely and full templates will be available only via exports? (pardon my ignorance but the Redmine ticket doesn't say much) |
|
@tstrachota yes, the goal is to hide metadata from user, mainly in template content form as for template with inputs, it take a lot of space. I do not plan to add comment/help/usage as a separate field right now. That needs more changes in community templates, I'd like to get this one in first. I opened a PR to separate metadata from usage in register snippet. This should be now ready, could you please take a look? |
|
[test foreman] [test katello] [test upgrade] @theforeman/core this would deserve a review |
|
Code looks good to me. @ares: Can you rebase the code please? This should fix the tests. |
|
rebased, thanks @timogoebel for looking |
|
[test upgrade] |
|
@ares: Test failures look related. |
|
Do I read the code correctly that we effectively now hide metadata information to UI, API and CLI users completely? In that case, I am not sure if this is something we want to do. However if you plan on working UI/API/CLI changes (adding editing capability to the metadata) I am good with this as a temporary state. |
|
We can expose metadata as a separate text area and API attribute. But today it's a lot of mess, only some templates have useful comments. Comments should be also extracted and displayed as some kind of a readme for a template, it shouldn't be part of comment in erb tag. |
|
ping @ares, do you intend to finish this or shall we close it? |
|
Thanks @ares ! This PR has been inactive for a long time. I'm going to go ahead and close it, feel free to reopen if you wish to get back to it. |
|
I will at some point, sorry for such a long delay |
No description provided.