Skip to content

Fixes #23569 - store metadata separately from template#5545

Closed
ares wants to merge 1 commit into
theforeman:developfrom
ares:fix/23569
Closed

Fixes #23569 - store metadata separately from template#5545
ares wants to merge 1 commit into
theforeman:developfrom
ares:fix/23569

Conversation

@ares
Copy link
Copy Markdown
Member

@ares ares commented May 11, 2018

No description provided.

@theforeman-bot
Copy link
Copy Markdown
Member

Issues: #23569

@stbenjam
Copy link
Copy Markdown
Member

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?

e.g., https://github.com/theforeman/community-templates/blob/develop/provisioning_templates/snippet/redhat_register.erb

@ares
Copy link
Copy Markdown
Member Author

ares commented May 11, 2018

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.

@stbenjam
Copy link
Copy Markdown
Member

stbenjam commented May 11, 2018

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.

I think that's fine. I didn't realize most separated it into two comments.

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.

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.

@ares
Copy link
Copy Markdown
Member Author

ares commented Jun 19, 2018

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.

@tstrachota
Copy link
Copy Markdown
Member

@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)

@ares
Copy link
Copy Markdown
Member Author

ares commented Dec 20, 2018

@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?

@ares
Copy link
Copy Markdown
Member Author

ares commented Feb 26, 2019

[test foreman] [test katello] [test upgrade] @theforeman/core this would deserve a review

@timogoebel
Copy link
Copy Markdown
Member

Code looks good to me. @ares: Can you rebase the code please? This should fix the tests.

@ares
Copy link
Copy Markdown
Member Author

ares commented Feb 27, 2019

rebased, thanks @timogoebel for looking

@timogoebel
Copy link
Copy Markdown
Member

[test upgrade]

@timogoebel
Copy link
Copy Markdown
Member

@ares: Test failures look related.

@lzap
Copy link
Copy Markdown
Member

lzap commented Feb 28, 2019

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.

@ares
Copy link
Copy Markdown
Member Author

ares commented Feb 28, 2019

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.

@tbrisker
Copy link
Copy Markdown
Member

ping @ares, do you intend to finish this or shall we close it?

@tbrisker
Copy link
Copy Markdown
Member

tbrisker commented Sep 4, 2019

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.

@tbrisker tbrisker closed this Sep 4, 2019
@ares
Copy link
Copy Markdown
Member Author

ares commented Sep 4, 2019

I will at some point, sorry for such a long delay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants