File templates fetching refactor [RUN AS-IF-FOSS] [RUN ALL RSPEC]
What does this MR do?
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.
Screenshots (strongly suggested)
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
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:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Merge request reports
Activity
added 1 commit
- 534cd904 - Prepare templates fetching code for templates inheritance
added databasereview pending label
3 Warnings This merge request is quite big (more than 774 lines changed), please consider splitting it into multiple merge requests. 0ce26285: The commit subject must contain at least 3 words. For more information, take a look at our Commit message guidelines. Please add a throughput label to this merge request. 2 Messages This merge request adds or changes files that require a review from the Database team. CHANGELOG missing: If you want to create a changelog entry for GitLab FOSS, run the following:
bin/changelog -m 52222 "File templates fetching refactor [RUN AS-IF-FOSS] [RUN ALL RSPEC]"
If you want to create a changelog entry for GitLab EE, run the following instead:
bin/changelog --ee -m 52222 "File templates fetching refactor [RUN AS-IF-FOSS] [RUN ALL RSPEC]"
If this merge request doesn't need a CHANGELOG entry, feel free to ignore this message.
This merge request requires a database review. To make sure these changes are reviewed, take the following steps:
- Ensure the merge request has database and databasereview pending labels. If the merge request modifies database files, Danger will do this for you.
- Prepare your MR for database review according to the docs.
- Assign and mention the database reviewer suggested by Reviewer Roulette.
The following files require a review from the Database team:
app/finders/license_template_finder.rb
app/finders/template_finder.rb
ee/app/finders/ee/license_template_finder.rb
ee/app/finders/ee/template_finder.rb
Reviewer roulette
Changes that require review have been detected! A merge request is normally reviewed by both a reviewer and a maintainer in its primary category (e.g. frontend or backend), and by a maintainer in all other categories.
To spread load more evenly across eligible reviewers, Danger has picked a candidate for each review slot, based on their timezone. Feel free to override these selections if you think someone else would be better-suited or use the GitLab Review Workload Dashboard to find other available reviewers.
To read more on how to use the reviewer roulette, please take a look at the Engineering workflow and code review guidelines. Please consider assigning a reviewer or maintainer who is a domain expert in the area of the merge request.
Once you've decided who will review this merge request, mention them as you normally would! Danger does not automatically notify them for you.
Category Reviewer Maintainer backend Aakriti Gupta ( @aakriti.gupta
) (UTC+1, 1 hour behind@acroitor
)Bob Van Landuyt ( @reprazent
) (UTC+1, 1 hour behind@acroitor
)database Nikola Milojevic ( @nmilojevic1
) (UTC+1, 1 hour behind@acroitor
)Adam Hegyi ( @ahegyi
) (UTC+1, 1 hour behind@acroitor
)frontend Jeremy Jackson ( @jejacks0n
) (UTC-7, 9 hours behind@acroitor
)Martin Wortschack ( @wortschi
) (UTC+1, 1 hour behind@acroitor
)If needed, you can retry the
danger-review
job that generated this comment.Generated by
DangerEdited by 🤖 GitLab Bot 🤖Bundle size analysis [beta]
This compares changes in bundle size for entry points between the commits 58acfc19 and 0ce26285
Special assetsEntrypoint / Name Size before Size after Diff Diff in percent average 3.08 MB 3.08 MB - 0.0 % mainChunk 1.85 MB 1.85 MB - 0.0 %
Note: We do not have exact data for 58acfc19. So we have used data from: 2e50e7cf.
The intended commit has no webpack pipeline, so we chose the last commit with one before it.Please look at the full report for more details
Read more about how this report works.
Generated by
DangerEdited by 🤖 GitLab Bot 🤖added 1 commit
- e08ffae0 - Prepare templates fetching code for templates inheritance
Setting label groupproject management based on
@acroitor
's group.added groupproject management label
added 1 commit
- fbc8666e - Prepare templates fetching code for templates inheritance
- Resolved by Alexandru Croitor
- Resolved by Alexandru Croitor
@toupeira I'll profit from your and @jprovaznik's fresh memory to get a BE review of this !51692 (closed)
assigned to @toupeira
- Resolved by Alexandru Croitor
@ntepluhina mind giving this a review, very minot changes on FE so I'll jump right ahead to maintainer if that is ok?
assigned to @jprovaznik and @ntepluhina
unassigned @ntepluhina
Setting label(s) devopsplan sectiondev based on groupproject management.
added devopsplan sectiondev labels
unassigned @toupeira
changed milestone to %13.9
- Resolved by Alexandru Croitor
- Resolved by Alexandru Croitor
- Resolved by Alexandru Croitor
unassigned @jprovaznik
added 1 commit
- f8f506a4 - Prepare templates fetching code for templates inheritance
added 1 commit
- 2997d23c - Prepare templates fetching code for templates inheritance
added 1 commit
- 351e918c - Prepare templates fetching code for templates inheritance
added 1 commit
- 42af6c7a - Prepare templates fetching code for templates inheritance
assigned to @jprovaznik
unassigned @jprovaznik
added 582 commits
-
42af6c7a...1405fde1 - 581 commits from branch
master
- 0cb2576b - Prepare templates fetching code for templates inheritance
-
42af6c7a...1405fde1 - 581 commits from branch
added 1 commit
- 95b8f241 - Use TemplateFinder as SSOT for fetching templates
added 1 commit
- 191a90ad - Use TemplateFinder as SSOT for fetching templates
added 1 commit
- 38e3301d - Use TemplateFinder as SSOT for fetching templates
added 71 commits
-
38e3301d...0a4cdd86 - 69 commits from branch
master
- eb5f4f4c - Prepare templates fetching code for templates inheritance
- 8a5d4313 - Use TemplateFinder as SSOT for fetching templates
-
38e3301d...0a4cdd86 - 69 commits from branch
assigned to @jprovaznik
- Resolved by Jan Provaznik
- Resolved by Jan Provaznik
- Resolved by Alexandru Croitor
- Resolved by Jan Provaznik
- Resolved by Alexandru Croitor
Thanks @acroitor, I left some questions inline - it doesn't necessarily mean that the MR needs a change, but I got little bit lost during review and I probably didn't grasp the intention/idea of the approach. Maybe we could discuss this synchronously to get me on the same page?
unassigned @jprovaznik
added 341 commits
-
8a5d4313...17d92bcb - 338 commits from branch
master
- 452f3504 - Prepare templates fetching code for templates inheritance
- d42935d4 - Use TemplateFinder as SSOT for fetching templates
- e48a3b1d - A test
Toggle commit list-
8a5d4313...17d92bcb - 338 commits from branch
assigned to @jprovaznik
- Resolved by Markus Koller
- Resolved by Alexandru Croitor
- Resolved by Alexandru Croitor
- Resolved by Markus Koller
unassigned @jprovaznik
- Resolved by Markus Koller
@toupeira would you mind taking on the maintainer review please ?
assigned to @toupeira
added 485 commits
-
74367071...6fa6700a - 482 commits from branch
master
- 591ab526 - Prepare templates fetching code for templates inheritance
- 5d966b36 - Use TemplateFinder as SSOT for fetching templates
- 2949bed8 - Code review feedback
Toggle commit list-
74367071...6fa6700a - 482 commits from branch
- Resolved by Markus Koller
- Resolved by Markus Koller
- Resolved by Markus Koller
- Resolved by Markus Koller
- Resolved by Markus Koller
- Resolved by Markus Koller
unassigned @toupeira
assigned to @toupeira
unassigned @toupeira
assigned to @toupeira
added 560 commits
-
0eac94ef...c8141f4c - 556 commits from branch
master
- bf86a46b - Prepare templates fetching code for templates inheritance
- d8c2a560 - Use TemplateFinder as SSOT for fetching templates
- 39468aba - Code review feedback
- f9a73e24 - Improve test coverage on new methods
Toggle commit list-
0eac94ef...c8141f4c - 556 commits from branch
added 93 commits
-
f9a73e24...caa86179 - 89 commits from branch
master
- 314cd924 - Prepare templates fetching code for templates inheritance
- b76f1d3a - Use TemplateFinder as SSOT for fetching templates
- b8bcea4b - Code review feedback
- f72da5ea - Improve test coverage on new methods
Toggle commit list-
f9a73e24...caa86179 - 89 commits from branch
- Resolved by Alexandru Croitor
@toupeira added some more spec coverage. would you mind taking another look? thank you
- Resolved by Alexandru Croitor
- Resolved by Markus Koller
unassigned @toupeira
added 460 commits
Toggle commit listmentioned in issue #301173 (closed)
- Resolved by Markus Koller
@toupeira
back to you with latest changes we discussed.
assigned to @toupeira
mentioned in issue gitlab-org/quality/triage-reports#1894 (closed)
added 240 commits
Toggle commit listenabled an automatic merge when the pipeline for f99e0fd5 succeeds
added typemaintenance label
added typefeature label
mentioned in commit c45aef05
added workflowstaging label
added workflowcanary label and removed workflowstaging label
added workflowproduction label and removed workflowcanary label
mentioned in issue #293854 (closed)
added releasedcandidate label
mentioned in merge request !54614 (merged)
removed typefeature label
added pipeline:run-all-rspec pipeline:run-as-if-foss labels