Optimize code_review_id to avoid fetching full blob content

What does this MR do and why?

Optimize code_review_id to avoid fetching full blob content

code_review_id previously called blob&.id which triggered Gitaly GetBlobs RPC fetching the up to 512KB of content per file to obtain the ID. For large diffs this is causing timeouts on the diff_files_metadata endpoint.

This MR uses Blob.lazy with blob_size_limit: 0, fetching only blob metadata without content. The BatchLoader keys on blob_size_limit so metadata requests batch separately from content requests.

The diff_files_metadata endpoint feeds the file browser sidebar which needs the complete file list upfront to build the tree. So pagination wouldn't work here.

References

Sentry errors

How to set up and validate locally

Included specs should pass.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Gavin Hinfey

Merge request reports

Loading