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

Constraints - Generic Authoring #3107

Closed
17 tasks done
Tracked by #4285
bekir-ozturk opened this issue Apr 28, 2021 · 1 comment
Closed
17 tasks done
Tracked by #4285

Constraints - Generic Authoring #3107

bekir-ozturk opened this issue Apr 28, 2021 · 1 comment
Assignees
Labels
7.0 Cost:M Work that requires one engineer up to 2 weeks Priority:1 Work that is critical for the release, but we could probably ship without triaged The issue was evaluated by the triage team, placed on correct area, next action defined. User Story A single user-facing feature. Can be grouped under an epic.
Milestone

Comments

@bekir-ozturk
Copy link
Contributor

bekir-ozturk commented Apr 28, 2021

Background

Allows restrict templates to be allowed to run / be visible only in case certain conditions are met.

Today, the engine has have very little insight into the context that a template is valid for. Aside from filtering based on language, all the installed templates are treated equally. This causes issues with filtering, install-time validation and instantiation-time validation.

For instance, it is possible to install & instantiate WPF project template on a Linux machine. It is also possible to add a Razor page into that WPF project.
Another example: it is possible for a user to instantiate an item template containing some C# 9.0 code into a project that has <LangVersion> set to 8.0.

In an ideal scenario, the engine should be able to filter templates depending on

  • the operating system
  • installed frameworks and tools together with supported version ranges (dotnet, NPM, SQL server, docker etc.)
  • the project template that is currently in the working directory.
  • installed optional workloads

Justification

This enables:

  • Suggesting installation of missing components when instantiating a template
    • ex: Xamarin workload should be installed if the user is instantiating a 3rd party authored template that requires Xamarin
    • ex: .NET 6.0 if user is instantiating a template that requires features that are only available starting .NET 6.0.
  • Listing only valid templates in the current machine/system-configuration/project when being presented to the users by hosts

Customer impact

  1. Template authors will have a possibility to restrict templates to be run only in case certain conditions are met
  2. Users will not see / be able to execute templates which cannot be executed for certain context - less chance for a mistake

Engineering impact

  1. allows support for items templates inside Visual Studio

Sub tasks

done

  • create design proposal and PoC
  • design abstractions
  • Edge implementation: TemplateConstraintManager class
  • Orchestration: reading constraints configuration from template.json
  • Utils: WellKnownSearchFilters for constraints
  • constraint implementation: OS
  • constraint implementation: host name and version
  • Cli: implementation for instantiate
  • Cli: list adaptation
  • Cli: option to ignore the constraint
  • Cli: adapt install\update template display after installation
  • Cli: adapt tab completion
  • Cli: adapt error handling on instantiation, allow --force to ignore constraints
  • doc: Wiki documentation update
  • doc: JSON schema update
  • constraint implementation: SDK version
  • constraint implementation: installed optional workloads
@bekir-ozturk bekir-ozturk added this to the July Sprint milestone Apr 28, 2021
@bekir-ozturk bekir-ozturk added the triaged The issue was evaluated by the triage team, placed on correct area, next action defined. label Apr 28, 2021
@vlada-shubina vlada-shubina added the Epic Groups multiple user stories. Can be grouped under a theme. label Jul 1, 2021
@donJoseLuis donJoseLuis self-assigned this Jul 16, 2021
@vlada-shubina vlada-shubina removed the Epic Groups multiple user stories. Can be grouped under a theme. label Jul 27, 2021
@donJoseLuis donJoseLuis changed the title [Constraints] Create a design for template constraints Design the template constraints API Aug 4, 2021
@donJoseLuis donJoseLuis removed their assignment Aug 14, 2021
@vlada-shubina vlada-shubina changed the title Design the template constraints API Support for Template Constraints Aug 16, 2021
@vlada-shubina vlada-shubina changed the title Support for Template Constraints [Epic] Template Constraints Aug 31, 2021
@vlada-shubina vlada-shubina changed the title [Epic] Template Constraints Template Constraints (generic authoring feature) Apr 4, 2022
@vlada-shubina vlada-shubina added the User Story A single user-facing feature. Can be grouped under an epic. label Apr 4, 2022
@vlada-shubina vlada-shubina modified the milestones: Backlog, April 2022 Apr 4, 2022
@donJoseLuis donJoseLuis added 7.0 Priority:1 Work that is critical for the release, but we could probably ship without Cost:M Work that requires one engineer up to 2 weeks labels Apr 5, 2022
@donJoseLuis donJoseLuis changed the title Template Constraints (generic authoring feature) Constraints - Generic Authoring Apr 5, 2022
@vlada-shubina vlada-shubina self-assigned this Apr 15, 2022
@baronfel baronfel mentioned this issue Apr 18, 2022
9 tasks
@vlada-shubina vlada-shubina modified the milestones: April 2022, May 2022 May 4, 2022
@vlada-shubina
Copy link
Member

All the work is done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
7.0 Cost:M Work that requires one engineer up to 2 weeks Priority:1 Work that is critical for the release, but we could probably ship without triaged The issue was evaluated by the triage team, placed on correct area, next action defined. User Story A single user-facing feature. Can be grouped under an epic.
Projects
None yet
Development

No branches or pull requests

3 participants