File templates fetching refactor [RUN AS-IF-FOSS] [RUN ALL RSPEC]
All threads resolved!
All threads resolved!
Compare changes
Files
2+ 96
− 0
This MR tries to extract a part of the bigger !51692 (closed) MR related to common code around file template fetching.
Refactor the code around template fetching to make it reusable and ready to be adjusted for inheritable issue and merge requests templates.
The intent is of this MR is to also use TemplateFinder as SSOT for fetching templates. We have several types of file templates, but only issue and merge request description template names are cached. That has been added some time ago now, but I think it is done mostly because of the higher usage of issues and merge requests where caching helps limit the number of requests to gitaly. Because issue and merge requests use caching we were fetching those template names through repository model and other template names by calling the TemplateFinder.build().execute
.
With this change we can fetch all templates through TemplateFinder.template_names(project, type)
and it will take care to fetch the issue and merge request ones from cache.
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
@gitlab-com/gl-security/appsec