Collapse or hide a subset of files in Merge Requests e.g. generated code

Release notes

Problem to solve

As a merge request reviewer, I want to have non-human-modified files collapsed or otherwise out of the way, so that I can review the human-made changes in the MR and not have to wade through pages of changes to auto-generated code.

Intended users

Personas:

Almost all of the other personas may want to review MRs, so this applies to them too. To pick the most obvious one:

User experience goal

The user should be able to review an MR without having to click "collapse" on each of potentially hundreds of generated files, or vendored dependencies. They should be made aware that changes to these files have been made, and be able to review them if they wish, but they shouldn't get in the way of a normal review.

Proposal

Include in the project configuration (either in the UI or in a special dot-file in the repo) a set of path specs that should be ignored in MRs. If an MR includes modifications to these files, they appear collapsed at the bottom of the list of changes, under some kind of group title (probably the name associated with the path specs).

Further details

Permissions and Security

If done via the UI, maintainers+ should be able to modify these ignore rules. All other members with access to the project should be able to see them. If done via a config file in the repo, no impact to permissions.

Documentation

Availability & Testing

What does success look like, and how can we measure that?

What is the type of buyer?

Is this a cross-stage feature?

Links / references

#21281 includes this idea, but was never split up into different issues.

Edited by Michael Macnair