Lift blame line-range cap from 100 to 1000 behind feature flag

What does this MR do and why?

Lifts the to_line cap in BlameResolver#validate_line_params! from from_line + 100 to from_line + 1000, gated behind the blame_line_range_cap_1000 feature flag.

The spike benchmark (MR !234332 (closed)) showed that for files with extensive commit history, a 14x larger line range only costs 22–48% more Gitaly time because the cost is dominated by history walking, not range size. Raising the cap allows the frontend to request larger blame ranges, reducing the total number of requests when scrolling through large files.

References

How to set up and validate locally

  1. Enable the feature flag:
    Feature.enable(:blame_line_range_cap_1000)
  2. Make a GraphQL blame query with a toLine up to fromLine + 999 — it should succeed.
  3. A query with toLine >= fromLine + 1000 should return an argument error.
  4. Disable the flag and verify the old cap of 100 still applies:
    Feature.disable(:blame_line_range_cap_1000)

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.

Merge request reports

Loading