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 2 (Latest)

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.
ed31774a6ad53cf972f2b10d5b0471766a264a51 David Trowbridge
docs/manual/extending/coderef/index.rst
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...