Skip to content

Template Repository

Description

Templates are important for easily getting started with a project. It's a shame they are hard to find and manage.

We should just have a repository per instance / group with templates, from which we load them. This way they can be managed, changed and reviewed easily.

Proposal

  • Templates are managed in a repository
  • It should be transparent to the user: the user does not have to know that templates are managed by git.
  • If he/she wants more control, he/she can simply pull the repository and change the content accordingly.

Example with a LICENSE template

  1. The user creates an empty project.
  2. The user clicks on the Add License button (as seen on Figure 1)
  3. In the window that appears, we display a Choose your template dropdown.
    • It lists all the LICENSE templates already defined in the /license folder of the templates project.
    • The filenames of each template are used as titles.
    • It suggests to create a new one. (as seen on Figure 2)
  4. When we click on Create a new template, a modal appears. You can define a title (which will become the filename), and the body. (as seen on Figure 3)
  5. Upon save, the template is created in the templates project, under the folder /license, as a commit.
    • the filename is the title (blank spaces is replaced by underscores)
    • if the templates project does not exist, create one automatically, at the instance level.
    • if the templates project exists already, use it.
    • if the templates project exists in the group the project is in, use it instead.
    • if the folder /license is not found, create one automatically.
    • then commit the template.
    • the author of the commit will be the instance administrator.
  6. Upon save, the modal fades out and the body is populated with the body of the template we've just created.
Figure 1 Figure 2 Figure 3
Screen_Shot_2016-12-16_at_14.36.31 image image

Specification of the templates project

  • The templates project is at the instance level, and/or the group level.
  • Template project at the group level will override template project defined at the instance level.
  • All LICENSE templates, for instance, will be located in a LICENSE folder inside this project.
  • Extensions we'll read when populating dropdowns are
    • files with no extension
    • .gitignore
    • .yml
    • .md
    • .txt

List of the template folders we'll support

  • /gitignore
  • /readme
  • /license
  • /issue
  • /contribution-guide
  • /ci
  • /services

Links / references