Add uploading of binary files for diffs.

Review Request #13571 — Created Feb. 23, 2024 and submitted — Latest diff uploaded

Information

RBTools
release-5.x

Reviewers

This change adds the rbt post logic for uploading binary files to
diffs. We start by assembling a list of the newly-created FileDiffs that
are marked as binary (using the new binary flag to the FileDiff API).
This is either done for the individual commits (when posting with commit
history) or for the full diff (when posting a squashed diff or on tools
that do not support history). We then go through and find what files we
should upload, filtering by whether it's a reviewable MIME type and the
configured file limit. We then create new file attachments for each
matching binary file.

This includes the base SCMClient flag and method definitions, but does
not implement upload for any SCMs. We have to do it per client because
we need to add new APIs to the clients to get file content (and
optionally file size) at specific revisions. Individual per-SCM
implementations will come in future changes.

  • Ran unit tests.
  • Posted a whole bunch of changes with Git and SVN repositories that
    included image files. Tested with both commit history and squashed
    diffs.

Diff Revision 4

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

orig
1
2
3
4
5

Commits

First Last Summary ID Author
Add uploading of binary files for diffs.
This change adds the `rbt post` logic for uploading binary files to diffs. We start by assembling a list of the newly-created FileDiffs that are marked as binary (using the new binary flag to the FileDiff API). This is either done for the individual commits (when posting with commit history) or for the full diff (when posting a squashed diff or on tools that do not support history). We then go through and find what files we should upload, filtering by whether it's a reviewable MIME type and the configured file limit. We then create new file attachments for each matching binary file. This includes the base SCMClient flag and method definitions, but does not implement upload for any SCMs. We have to do it per client because we need to add new APIs to the clients to get file content (and optionally file size) at specific revisions. Individual per-SCM implementations will come in future changes. Testing Done: - Ran unit tests. - Posted a whole bunch of changes with Git and SVN repositories that included image files. Tested with both commit history and squashed diffs.
26d5bfcbd93c028c78f635b8886380c5be6713a5 David Trowbridge
rbtools/clients/base/scmclient.py
rbtools/commands/post.py
Loading...