Expand instance-level templates to cover .gitlab-ci.yml, .gitignore and Dockerfile
What does this MR do?
In %11.3, we introduced a custom instance-level templates repository for license templates: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/6631
This MR expands support for custom instance-level templates to three other types of file.
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
Tests added for this feature/bug -
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the database guides -
EE specific content should be in the top level /ee
folder -
For a paid feature, have we considered GitLab.com plans, how it works for groups, and is there a design for promoting it to users who aren't on the correct plan?
What are the relevant issue numbers?
Closes #5306 (closed)
Merge request reports
Activity
Hi @nick.thomas,
Please add labels to your merge request, this helps triage community merge requests.
Thanks for your help!
added auto updated label
added Create [DEPRECATED] devopscreate and removed auto updated labels
assigned to @nick.thomas
changed milestone to %11.3
added 1 commit
- 7ba10cd3 - Introduce custom templates for Dockerfile, .gitignore, and .gitlab-ci.yml files
added 1 commit
- b05c6c82 - Introduce custom templates for Dockerfile, .gitignore, and .gitlab-ci.yml files
- Resolved by Nick Thomas
added 1 commit
- e34029c1 - Introduce custom templates for Dockerfile, .gitignore, and .gitlab-ci.yml files
- Resolved by Nick Thomas
- Resolved by Nick Thomas
added 1 commit
- 349e9994 - Introduce custom templates for Dockerfile, .gitignore, and .gitlab-ci.yml files
added 1 commit
- 349e9994 - Introduce custom templates for Dockerfile, .gitignore, and .gitlab-ci.yml files
added 1 commit
- 80352d74 - Introduce custom templates for Dockerfile, .gitignore, and .gitlab-ci.yml files
added 1 commit
- 942c3d97 - Introduce custom templates for Dockerfile, .gitignore, and .gitlab-ci.yml files
added 1 commit
- 208026c6 - Introduce custom templates for Dockerfile, .gitignore, and .gitlab-ci.yml files
added 282 commits
-
208026c6...2554a798 - 279 commits from branch
gitlab-org:master
- fd9558b0 - Rename Gitlab::Template::LicenseTemplate to CustomLicenseTemplate
- 1cb0724f - Convert global templates to vendored templates via a ::TemplateFinder
- a002b246 - Introduce custom templates for Dockerfile, .gitignore, and .gitlab-ci.yml files
Toggle commit list-
208026c6...2554a798 - 279 commits from branch
added 4 commits
- 614e68aa - Allow repositories to be programmatically built in the specs
- da3091d8 - Rename Gitlab::Template::LicenseTemplate to CustomLicenseTemplate
- 8dc82cf3 - Convert global templates to vendored templates via a ::TemplateFinder
- 1a93542a - Introduce custom templates for Dockerfile, .gitignore, and .gitlab-ci.yml files
Toggle commit list- Resolved by Robert Speicher
- Resolved by Nick Thomas
added 1 commit
- 57e0a82a - Introduce custom templates for Dockerfile, .gitignore, and .gitlab-ci.yml files
added 1 commit
- 9db85075 - Introduce custom templates for Dockerfile, .gitignore, and .gitlab-ci.yml files
added 1 commit
- 518bb4f0 - Introduce custom templates for Dockerfile, .gitignore, and .gitlab-ci.yml files
- Resolved by Nick Thomas
marked the checklist item Changelog entry added, if necessary as completed
marked the checklist item Documentation created/updated as completed
marked the checklist item Tests added for this feature/bug as completed
added 1 commit
- eb9870c0 - Introduce custom templates for Dockerfile, .gitignore, and .gitlab-ci.yml files
marked the checklist item Conforms to the code review guidelines as completed
marked the checklist item Conforms to the merge request performance guidelines as completed
marked the checklist item Conforms to the style guides as completed
added 1 commit
- ddafa221 - Move the custom license templates to appear first in the list, for consistency
- Resolved by Nick Thomas
@rspeicher do you mind reviewing, since you took !6631 (merged)? This one is closely related.
I need to do a CE port, which should be a clean cherry-pick of 614e68aa and 6c8d89e9
assigned to @rspeicher
added 5 commits
- 1bdb782b - Allow repositories to be programmatically built in the specs
- 1c2bfa7e - Rename Gitlab::Template::LicenseTemplate to CustomLicenseTemplate
- a36b8d66 - Convert global templates to vendored templates via a ::TemplateFinder
- b193ad69 - Introduce custom templates for Dockerfile, .gitignore, and .gitlab-ci.yml files
- b1009760 - Move the custom license templates to appear first in the list, for consistency
Toggle commit list- Resolved by Nick Thomas
- Resolved by Nick Thomas
- Resolved by Nick Thomas
- Resolved by Robert Speicher
- Resolved by Nick Thomas
- Resolved by Robert Speicher
- Resolved by Nick Thomas
@nick.thomas Looking good, just a few notes.
assigned to @nick.thomas
added 6 commits
- 2054722b - Allow the TemplateFinder to handle licenses as well
- 7b988140 - Rename BlobsHelper#dropdown_names
- ad0df70a - fixup! Move the custom license templates to appear first in the list, for consistency
- eb0de554 - fixup! Introduce custom templates for Dockerfile, .gitignore, and .gitlab-ci.yml files
- bafc217b - fixup! Introduce custom templates for Dockerfile, .gitignore, and .gitlab-ci.yml files
- 8d555b29 - fixup! Allow repositories to be programmatically built in the specs
Toggle commit listadded 257 commits
-
8d555b29...5ad9d757 - 250 commits from branch
gitlab-org:master
- bffcac9c - Allow repositories to be programmatically built in the specs
- 1aeec043 - Rename Gitlab::Template::LicenseTemplate to CustomLicenseTemplate
- ef5cdecc - Convert global templates to vendored templates via a ::TemplateFinder
- 5ae49d61 - Introduce custom templates for Dockerfile, .gitignore, and .gitlab-ci.yml files
- 8ed3e5b5 - Move the custom license templates to appear first in the list, for consistency
- 0e36e9e7 - Allow the TemplateFinder to handle licenses as well
- 4110a8c1 - Rename BlobsHelper#dropdown_names
Toggle commit list-
8d555b29...5ad9d757 - 250 commits from branch
added 4 commits
- 15b08b24 - Introduce custom instance-level templates for Dockerfile, .gitignore, and .gitlab-ci.yml files
- 341423db - Move the custom license templates to appear first in the list, for consistency
- c67f0d02 - Allow the TemplateFinder to handle licenses as well
- 13207153 - Rename BlobsHelper#dropdown_names
Toggle commit listassigned to @rspeicher
Thanks @rspeicher, comments so far addressed and CE port created in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/21530/diffs - just let me know if you want any further changes!
@nick.thomas LGTM, just one last minor failure.
assigned to @nick.thomas
added 4 commits
- 8cb5fe5f - Introduce custom instance-level templates for Dockerfile, .gitignore, and .gitlab-ci.yml files
- 4e84e8ab - Move the custom license templates to appear first in the list, for consistency
- 2840992b - Allow the TemplateFinder to handle licenses as well
- 6a00f116 - Rename BlobsHelper#dropdown_names
Toggle commit list@rspeicher sob fixed. Back to you!
assigned to @rspeicher
- app/finders/template_finder.rb 0 → 100644
1 class TemplateFinder 2 prepend ::EE::TemplateFinder 3 4 VENDORED_TEMPLATES = { 5 dockerfiles: ::Gitlab::Template::DockerfileTemplate, 6 gitignores: ::Gitlab::Template::GitignoreTemplate, 7 gitlab_ci_ymls: ::Gitlab::Template::GitlabCiYmlTemplate 8 }.freeze 9 10 class << self 11 def build(type, params = {}) 12 if type == :licenses 13 LicenseTemplateFinder.new(params) I suppose this violates the new rules we're trying to set forth in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/21391, which defines that finders shouldn't call other finders.We decided to do it this way to have a unified interface to
TemplateFinder
, as discussed in this MR at https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/7000#note_98532158.WDYT @yorickpeterse?
Edited by Robert Speicher@rspeicher heh, I suppose it does.
Since it's a factory method, it doesn't really fall into the intended category, I think. The
TemplateFinder
doesn't actually depend onLicenseTemplateFinder
.If this were Java, we'd have a
TemplateFinderBuilder
that would return one or another of the classes. That's overkill in Ruby, and a class method is the sane place for it to go, to my way of thinking.Alternatively I could revert 2840992b - I'm not that much of a fan of the unified interface. Just let me know :)
mentioned in commit 0b6b3bf6
@nick.thomas LGTM, thanks!
mentioned in issue gitlab-org/release/tasks#428 (closed)
mentioned in commit 4c0e62f8
mentioned in commit 1bb431cd
mentioned in merge request !7459 (merged)
mentioned in commit 5e7abc46
mentioned in issue #8429 (closed)
added Enterprise Edition label