Enhance the diff file attachment resource a bit.

Review Request #13603 — Created March 4, 2024 and submitted — Latest diff uploaded

Information

Review Board
release-7.x

Reviewers

This change makes two enhancements to the diff file attachment resource.

First, a new source_file argument allows uploading a file for the source
version of the FileDiff. In most cases we can allow the server to fetch
it from the repository, but in the case where there's a parent diff, the
uploading client needs to provide both the source and modified versions.

Second, I did run into a case where I successfully uploaded two files
for the same FileDiff, which caused errors later on. A new API error has
been added for this case.

  • Ran unit tests.
  • Posted binary file changes that used a parent diff and successfully
    uploaded both the source and modified versions.

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
Enhance the diff file attachment resource a bit.
This change makes two enhancements to the diff file attachment resource. First, a new source_file argument allows uploading a file for the source version of the FileDiff. In most cases we can allow the server to fetch it from the repository, but in the case where there's a parent diff, the uploading client needs to provide both the source and modified versions. Second, I did run into a case where I successfully uploaded two files for the same FileDiff, which caused errors later on. A new API error has been added for this case. Testing Done: - Ran unit tests. - Posted binary file changes that used a parent diff and successfully uploaded both the source and modified versions.
3831748b76c4e27268f1ce38fe1a6dd5dd61ee31 David Trowbridge
reviewboard/attachments/forms.py
reviewboard/webapi/resources/diff_file_attachment.py
reviewboard/webapi/tests/test_diff_file_attachment.py
Loading...