Add a max attachment size for diff file attachments.

Review Request #13579 — Created Feb. 27, 2024 and submitted — Latest diff uploaded

Information

Review Board
release-7.x

Reviewers

This change adds a configurable maximum attachment size for file
attachments which are connected to diffs. This works very much like the
configured maximum diff size.

Our initial default is 10MB. This should be enough for most images and
documents. The limit can be changed in the diff settings page in the
admin site.

At the moment this is enforced on the server side when attempting to
create the attachment. The limit is also included in the server
capabilities object so clients can make a decision about whether to
attempt to upload. While doing this I also added the max diff size to
the capabilities.

Ran unit tests.

Diff Revision 1

This is not the most recent revision of the diff. The latest diff is revision 2. See what's changed.

orig
1
2

Commits

First Last Summary ID Author
Add a max attachment size for diff file attachments.
This change adds a configurable maximum attachment size for file attachments which are connected to diffs. This works very much like the configured maximum diff size. Our initial default is 10MB. This should be enough for most images and documents. The limit can be changed in the diff settings page in the admin site. At the moment this is enforced on the server side when attempting to create the attachment. The limit is also included in the server capabilities object so clients can make a decision about whether to attempt to upload. While doing this I also added the max diff size to the capabilities. Testing Done: Ran unit tests.
5d06023f4cca96453bb85d5af3b242b7930a32cf David Trowbridge
reviewboard/admin/siteconfig.py
reviewboard/admin/forms/diff_settings.py
reviewboard/attachments/errors.py
reviewboard/attachments/forms.py
reviewboard/webapi/server_info.py
reviewboard/webapi/resources/diff_file_attachment.py
reviewboard/webapi/resources/draft_filediff.py
reviewboard/webapi/tests/test_diff_file_attachment.py
reviewboard/webapi/tests/test_draft_filediff.py
Loading...