Docs feedback - feature proposal: Provide a means to mark files as generated, vendored, docs, etc

Problem to solve

If a Gitlab user checks in an auto-generated file, generally it doesn't need to be reviewed manually. Now consider a file like package-lock.json from NPM or go.sum for Golang. These files tend to be very large and include a lot of data or random-looking changes. They end up eating up a lot of space in the Gitlab merge request changes page and can cause review-fatigue.

Intended users

User experience goal

Gitlab should automatically collapse diffs of auto-generated and vendored files by default in the merge request change pages if it detects said files are typically auto-generated or vendored or if the .gitattributes file indicates such.

Proposal

  1. Update gitattributes file parsing to support manually annotating files and directories as either auto-generated, vendored, etc. Or provide some means to do something similar with in-repo configuration files.
  2. And in the merge request changes page, auto-collapse diffs of files that are auto-generated or vendored by default (while allowing users to expand and retain their settings for each merge request).

Further details

Github supports this already and uses the linguist tool to both auto-detect as well as support manual overrides for files and directories.

Specifically, see the overrides section.

As an example, look at this pull request: https://github.com/midopa/gitattributes-example/pull/1/files

Screenshot_from_2020-05-03_18-56-29

With this .gitattributes file:

asd linguist-generated

Permissions and Security

N/A

Documentation

N/A

Availability & Testing

N/A

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

N/A

What is the type of buyer?

N/A

Is this a cross-stage feature?

N/A

Links / references

Edited by 🤖 GitLab Bot 🤖