Show file sizes for large binary files in MR diffs

As part of tracking down a 7.6 MB that was accidentally added to the www-gitlab-com repo, I ended up reviewing Quick action to set issue type as incident upon... (gitlab-com/www-gitlab-com!117922 - merged) to see what had happened. I wanted to understand why the size of the file was missed. After all, we include that information in the MR diff, right?

Not always.

For images: yes

I'm accustomed to working with images in docs, and we show the file size below the image in the diff:

filesize2

For other binary assets: no

But we don't do this on bigger files. I'd understand if this process was resource-intensive, but seems like we could show SOME kind of indication that this file is bigger than XYZ size:

filesize

Extra credit

A push option that disallows binary files above a certain size. Because ouch. That's not what Git is good for.

Related

Related to Explain the numbers next to file names on MR diffs (#396634 - closed) - the other issue I filed after my poking around today.

Edited by 🤖 GitLab Bot 🤖