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

Groupidentity not validated, improve documentation about requiredness of template.json fields #2384

Closed
jannikbuschke opened this issue May 23, 2020 · 2 comments · Fixed by #6867
Labels
area: doc The issue requires documentation update, not a code change. Priority:2 Work that is important, but not critical for the release triaged The issue was evaluated by the triage team, placed on correct area, next action defined.
Milestone

Comments

@jannikbuschke
Copy link

jannikbuschke commented May 23, 2020

Using the same groupIdentity in two different templates, but not providing any tags, its possible to pack a nuget template and publish it. I.e. there are no warnings or errors shown.
However when trying to create one of theses templates, via dotnet new the following error is shown:
Couldn't find an installed template that matches the input, searching online for one that does...
(no user input is triggered).

Steps to reproduce

Create two templates with same groupIdentity but no tags.

Possible solutions

Improve the documentation https://github.com/dotnet/templating/wiki/Reference-for-template.json. It is unclear that groupIdentity and tags should be used together (I also just assume this by my observations). It is also unclear if groupIdentity is a required property or not. This is also true for all other properties. Ideally there should be a column, that states for each property the requiredness.

Also when creating the template and some point the should happen some validation. I.e. when running nuget pack or nuget push

@genalt genalt added the triaged The issue was evaluated by the triage team, placed on correct area, next action defined. label May 27, 2020
@bekir-ozturk bekir-ozturk added this to the Backlog milestone Apr 21, 2021
@vlada-shubina vlada-shubina modified the milestones: Backlog, July Sprint May 11, 2021
@vlada-shubina vlada-shubina modified the milestones: August Sprint, Backlog Jun 1, 2021
@vlada-shubina vlada-shubina added the area: doc The issue requires documentation update, not a code change. label Jul 27, 2021
@YuliiaKovalova YuliiaKovalova added the Priority:2 Work that is important, but not critical for the release label May 16, 2023
@vlada-shubina
Copy link
Member

Using groupIdentity is still poorly documented. It's worth to create a separate article explaining:

  • groupIdentity concept and its uniqueness
  • precedence and identity withing the template group
  • how to use groupIdentity to create the template group for templates in different languages
  • how to use groupIdentity to create the template group for templates with different choice parameters values (as 1st party templates do for framework)

@seangwright
Copy link

I recently used groupIdentity and tags.language to expose 2 completely different templates under the same shortName by letting consumers of the template specify the -lang option when using the template.

I don't know if this is the intended use, but it would be great to have this area of templating documented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: doc The issue requires documentation update, not a code change. Priority:2 Work that is important, but not critical for the release triaged The issue was evaluated by the triage team, placed on correct area, next action defined.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants