gitlab-org--gitlab-foss/app
Douwe Maan f4282412be Merge branch '20034-safe-diffs' into 'master'
Cache diff syntax highlighted output

## 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

## Screenshots (if relevant)

## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- ~~[ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)~~
- ~~[ ] API support added~~
- Tests
  - [x] Added for this feature/bug
  - [x] All builds are passing
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)


See merge request !5401
2016-08-03 17:13:28 +00:00
..
assets Merge branch 'fix-filter-input-alignment' into 'master' 2016-08-03 09:50:03 +00:00
controllers Make Compare#diffs diff_options a regular argument 2016-08-03 09:32:01 -07:00
finders State specific default sort order for issuables 2016-08-01 11:28:56 +02:00
helpers switch from diff_file_collection to diffs 2016-08-03 07:00:20 +02:00
mailers Allow build email service to be tested 2016-07-15 20:38:27 -03:00
models Make Compare#diffs diff_options a regular argument 2016-08-03 09:32:01 -07:00
services switch from diff_file_collection to diffs 2016-08-03 07:00:20 +02:00
uploaders Remove magic comments from Ruby files (!5456) 2016-07-24 07:08:45 +02:00
validators
views switch from diff_file_collection to diffs 2016-08-03 07:00:20 +02:00
workers switch from diff_file_collection to diffs 2016-08-03 07:00:20 +02:00