Skip to content

Cache diff syntax highlighted output

Paco Guzman requested to merge 20034-safe-diffs into master

What does this MR do?

Cache highlighted diffs for merge requests when they are requested for existing merge requests but after each change on the merge request diff recalculate again the cache.

I've introduced the concept of SafeDiffs which are the diffs that we're going to show on the UI and will be highlighted so maybe we can extend cache capabilities to more diffs.

The more problematic part is what and how we cache the highlighted lines, for the moment what I did was store in Redis as Gitlab::Diff::Line serialized as an array of json objects, similar of what we do for commits and diffs on merge request diffs.

The next step can be add a new field in the merge_request_diff object if we find it worth it. But let's first confirm this is the way to go

What are the relevant issue numbers?

Closes #20034 (closed)

Screenshots (if relevant)

Does this MR meet the acceptance criteria?

Merge request reports