Support default templates for issues/MRs via .gitlab/ folders
What does this MR do and why?
Reusing the same logic that ?issuable_template=
has, this MR selects a template named "Default" (case-insensitively) on the new issue and new merge request pages, if such a template exists, and if the ?issuable_template=
parameter was not provided.
As mentioned in #2557 (comment 575825925):
However this might still be an acceptable performance to initially fetch the default template content directly from
default.md
without saving it to the DB
Could it really be this simple (a two line change) or have I missed something obvious?
Screenshots
Projects Settings page:
How to set up and validate locally
-
Visit the new issue page on a repository, see that no default template was selected
-
Create a .gitlab/issue_templates/default.md file in that repository
-
Visit the new issue page on that repository, see that the default.md template was selected
-
Create a new merge request on a repository, see that no default template was selected
-
Create a .gitlab/merge_request_templates/default.md file in that repository
-
Create a new merge request on that repository, see that the default.md template was selected
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #2557 (closed) Related to #15846