Store the information about the generated files
What does this MR do and why?
Store the information about the generated files
- Utilize the Compare#generated_files method to set diff files as generated
- Add missing generated column for ContextCommit
- Add collapse_generated_diff_files feature flag
NOTE: We're just setting the generated field for now in this MR and there are no user facing changes.
How to set up and validate locally
- In rails console enable the experiment fully
Feature.enable(:collapse_generated_diff_files)
- Set any file as a generated file by adding something like
abc.txt gitlab-generated
to.gitattributes
in the target branch. - Make a new branch and make some changes to the file you have marked as generated above.
- Push up the change
- Observe the file has been set as generated.
MergeRequest.last.merge_request_diff.merge_request_diff_files.find_by(old_path: 'abc.txt')
should return a MergeRequestDiffFile with thegenerated
set totrue
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 #391776 (closed)
Edited by Sincheol (David) Kim