Skip to content

diff: Include patch size in the DiffBlobs response

Mustafa Bayar requested to merge 6564-extend-DiffBlobs-response into master

When the DiffBlobs RPC generates blob diffs, if the individual diff exceeds the per-patch limit it gets pruned. This response is still streamed back to indicate that the diff exceeded the limit, but no patch is included.

When performing diffs for MRs, clients have the concept of a soft and hard limit (safe/max). If the soft limit get exceeded the diff is collapsed, but a user may override this a request to see the diff anyway as long as it does not exceed the hard limit.

With the current per-patch limit in the DiffBlobs request, there is not a way to differentiate between whether the pruned patch exceeded the soft or hard limit. To facilitate this, being returning the byte size of the patch in the diff response. This lets the client know how large the patch was. With this information the client can decide whether it makes sense to call DiffBlobs again with an increased byte limit.

Closes #6564 (closed)

Merge request reports

Loading