Product discovery for instance and group project templates
Project templates are a useful way to get started with projects quickly, skipping the need for creating lots of configuration files and boilerplate. This is particularly useful if for creating new micro-services quickly in a common style. We should allow organizations to manage their own project templates for instances and groups. Two of the major requests to enhance Project Templates are: - add custom templates - disable templates ### Proposal - Admin may enable/disable vendor project templates - Admin may select a group that contains the instance projects templates - Every project in this group will be available as project template when creating a new project - Group master can select a sub-group that contains project templates - New GitLab installations come with a default project template group - Users when creating a new project will see group templates from every group they have permissions to create a new project in, instance templates and vendor templates ### Design #### Instance-level Project templates **Admin Area → Project Templates** **Built-in Templates** ![built-in-templates](/uploads/e186284bdf5ab5c76beac4fd1927b6fa/built-in-templates.png) The term `Built-in Templates` to refer to vendor templates. These cannot be enabled/disabled as per https://gitlab.com/gitlab-org/gitlab-ce/issues/48043#note_85756587. **Custom Templates** | List | Empty | Undefined | |------|-------|-----------| | ![custom-templates](https://gitlab.com/gitlab-org/gitlab-ce/uploads/fc8cd1e48cb10646a44c0d26aad8a797/custom-templates.png) | ![custom-templates--empty](https://gitlab.com/gitlab-org/gitlab-ce/uploads/640946d764209326ab19765f450105e0/custom-templates--empty.png) | ![custom-templates--undefined](https://gitlab.com/gitlab-org/gitlab-ce/uploads/dec01ab6d2c31819bbe710168e32183c/custom-templates--undefined.png) | The template source group is displayed at the top of the page. The list of templates is paginated like most pages on GitLab. The "Change" button is linked to Admin area → Settings → Custom project templates section. The "Edit" button opens the project's setting page and "Delete" opens the delete project modal dialog. **Changing template source** **Admin area → Settings → Custom project templates** ![set-project-template-source](/uploads/29796a0148919100b442696ac45d0e84/set-project-template-source.png) This uses the "group-picker" component already used in the Admin area. ### Group-level project templates **Group Settings → Project Templates** | List | Empty | Undefined | |------|-------|-----------| | ![group-settings](https://gitlab.com/gitlab-org/gitlab-ce/uploads/b49ee29f12b8a25aa9d173fdb19713a8/group-settings.png) | ![group-settings--empty](https://gitlab.com/gitlab-org/gitlab-ce/uploads/5e34274fdef0ace6db4799436b477ff9/group-settings--empty.png) | ![group-settings--undefined](https://gitlab.com/gitlab-org/gitlab-ce/uploads/27cfb7575848b227a8281da47ff536a1/group-settings--undefined.png) | Changing the template source inside a group will have similar UI as shown above with a minor change to the copy to indicate sub-groups. This setting can be added to Project settings → General. ### Create project from a template | Built-in | Custom | Group-specific | |----------|--------|----------------| | ![new-project--built-in](https://gitlab.com/gitlab-org/gitlab-ce/uploads/299614d9112a499e6a0fe3cea55196a5/new-project--built-in.png) | ![new-project--custom](https://gitlab.com/gitlab-org/gitlab-ce/uploads/84a9ffa129566421ec987b32018f14af/new-project--custom.png) | ![new-project--group-specific](https://gitlab.com/gitlab-org/gitlab-ce/uploads/ca154d93684f538bab3bbc7c45d5b70d/new-project--group-specific.png) | The `Group-specific` tab only appears when creating a project inside a group. The actions that happen upon clicking `Use template` or `Preview` remain unchanged. ### Links / references https://gitlab.com/gitlab-org/gitlab-ce/issues/36943
issue