Skip to content

Add generated_file to Diffs API

What does this MR do and why?

Adds generated_file field to MergeRequest Diffs API

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

  1. In rails console enable the experiment fully

    Feature.enable(:collapse_generated_diff_files)
  2. 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.

  3. 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.

  4. Visit something like http://127.0.0.1:3000/api/v4/projects/8/merge_requests/4/diffs?page=1&per_page=10 to make the API call

  5. Observe files to have correct generated_file values

Related to #391778 (closed)

Edited by Sincheol (David) Kim

Merge request reports