Check generated files when loading diffs from the repository
What does this MR do and why?
When loading diffs with ignore_whespace_change
option, we don't load the diffs from the database but from the repository. That means we need to load that information again. This change allows the collapsing generated files feature to work even with ignore_whitespace_change
option.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
How to set up and validate locally
-
In rails console enable the experiment fully
Feature.enable(:collapse_generated_diff_files)
-
Create a new branch and make changes to any files that https://github.com/go-enry/go-enry would consider as generated such as
package-lock.json
for example. -
Push up the change and open an MR and observe that the file has been collapsed by default. There must be more than 1 changes in the MR to have it collapsed by default.
-
Toggle
Show whitespace changes
option back and forth to verify generated files are always collapsed by default.
Related to #435138 (closed)