Cache diff highlight in discussions

This commit handles note diffs caching, which considerably improves
the performance on merge requests with lots of comments.
Important to note that the caching approach taken here is different
from `Gitlab::Diff::HighlightCache`. We do not reset the whole cache
when a new push is sent or anything else. That's because discussions
diffs are persisted and do not change.
146 jobs for osw-cache-discussions-diff-highlighting in 61 minutes and 48 seconds (queued for 6 seconds)
Status Job ID Name Coverage
  Build
manual #137931990
gitlab-org allowed to fail manual
review-docs-deploy-manual
 
  Prepare
passed #137933715
docker gitlab-org
build-qa-image

00:04:29

passed #137931992
gitlab-org
compile-assets

00:08:19

passed #137931991
gitlab-org
retrieve-tests-metadata

00:00:25

passed #137931993
gitlab-org
setup-test-env

00:08:02

failed #137931994
gitlab-org docker
build-qa-image

00:06:04

 
  Test
passed #137932123
allowed to fail
code_quality

00:08:42

passed #137931996
danger-review

00:02:47

passed #137932113
gitlab-org
db:check-schema-pg

00:02:15

passed #137932112
gitlab-org
db:migrate:reset-mysql

00:05:15

passed #137932111
gitlab-org
db:migrate:reset-pg

00:03:04

passed #137932117
gitlab-org
db:rollback-mysql

00:07:16

passed #137932116
gitlab-org
db:rollback-pg

00:04:52

passed #137932125
allowed to fail
dependency_scanning

00:01:43

passed #137932107
gitlab-org
docs lint

00:02:03

passed #137932109
gitlab-org
downtime_check

00:02:04

passed #137932110
gitlab-org
ee_compat_check

00:02:40

passed #137932120
gitlab-org-delivery high-cpu
gitlab:assets:compile

00:14:30

passed #137932119
gitlab-org
gitlab:setup-mysql

00:05:29

passed #137932118
gitlab-org
gitlab:setup-pg

00:03:58

passed #137932132
gitlab-org
gitlab_git_test

00:00:29

passed #137932122
gitlab-org
jest

00:11:36

passed #137932121
gitlab-org
karma

00:09:15

58.33%
passed #137932115
gitlab-org
migration:path-mysql

00:12:49

passed #137932114
gitlab-org
migration:path-pg

00:11:04

passed #137932133
gitlab-org
no_ee_check

00:00:27

manual #137931995
allowed to fail manual
package-and-qa
passed #137932130
qa-frontend-node:10

00:10:43

passed #137932128
qa-frontend-node:6

00:13:40

passed #137932129
qa-frontend-node:8

00:11:24

passed #137932131
allowed to fail
qa-frontend-node:latest

00:11:17

passed #137932126
gitlab-org
qa:internal

00:02:40

passed #137932127
gitlab-org
qa:selectors

00:04:47

passed #137932134
gitlab-org allowed to fail
review-deploy

00:28:32

manual #137932136
gitlab-org docker allowed to fail manual
review-qa-all
failed #137949027
gitlab-org docker allowed to fail
review-qa-smoke

00:14:26

manual #137932137
gitlab-org allowed to fail manual
review-stop
passed #137932052
gitlab-org
rspec-mysql 1/50

00:11:19

passed #137932061
gitlab-org
rspec-mysql 10/50

00:12:17

passed #137932062
gitlab-org
rspec-mysql 11/50

00:14:44

passed #137932063
gitlab-org
rspec-mysql 12/50

00:14:21

passed #137932064
gitlab-org
rspec-mysql 13/50

00:13:04

passed #137932065
gitlab-org
rspec-mysql 14/50

00:13:20

passed #137932066
gitlab-org
rspec-mysql 15/50

00:12:41

passed #137932067
gitlab-org
rspec-mysql 16/50

00:12:35

passed #137932068
gitlab-org
rspec-mysql 17/50

00:12:36

passed #137932069
gitlab-org
rspec-mysql 18/50

00:16:16

passed #137932070
gitlab-org
rspec-mysql 19/50

00:15:29

passed #137932053
gitlab-org
rspec-mysql 2/50

00:13:42

passed #137932071
gitlab-org
rspec-mysql 20/50

00:14:04

passed #137932072
gitlab-org
rspec-mysql 21/50

00:16:04

passed #137932073
gitlab-org
rspec-mysql 22/50

00:13:49

passed #137932074
gitlab-org
rspec-mysql 23/50

00:14:32

passed #137932075
gitlab-org
rspec-mysql 24/50

00:13:04

passed #137939682
gitlab-org
rspec-mysql 25/50

00:18:34

passed #137932077
gitlab-org
rspec-mysql 26/50

00:16:28

passed #137932078
gitlab-org
rspec-mysql 27/50

00:16:28

passed #137932079
gitlab-org
rspec-mysql 28/50

00:15:41

passed #137932080
gitlab-org
rspec-mysql 29/50

00:14:33

passed #137932054
gitlab-org
rspec-mysql 3/50

00:12:56

passed #137932081
gitlab-org
rspec-mysql 30/50

00:18:52

passed #137932083
gitlab-org
rspec-mysql 31/50

00:12:00

passed #137932084
gitlab-org
rspec-mysql 32/50

00:17:54

passed #137932085
gitlab-org
rspec-mysql 33/50

00:14:29

passed #137932086
gitlab-org
rspec-mysql 34/50

00:14:50

passed #137932087
gitlab-org
rspec-mysql 35/50

00:19:13

passed #137932088
gitlab-org
rspec-mysql 36/50

00:17:26

passed #137932089
gitlab-org
rspec-mysql 37/50

00:14:24

passed #137932090
gitlab-org
rspec-mysql 38/50

00:15:19

passed #137932091
gitlab-org
rspec-mysql 39/50

00:14:10

passed #137932055
gitlab-org
rspec-mysql 4/50

00:11:36

passed #137932092
gitlab-org
rspec-mysql 40/50

00:17:47

passed #137932093
gitlab-org
rspec-mysql 41/50

00:12:32

passed #137932094
gitlab-org
rspec-mysql 42/50

00:16:59

passed #137932095
gitlab-org
rspec-mysql 43/50

00:15:30

passed #137932096
gitlab-org
rspec-mysql 44/50

00:14:33

passed #137932097
gitlab-org
rspec-mysql 45/50

00:15:59

passed #137932098
gitlab-org
rspec-mysql 46/50

00:11:14

passed #137932099
gitlab-org
rspec-mysql 47/50

00:15:14

passed #137932101
gitlab-org
rspec-mysql 48/50

00:13:19

passed #137932103
gitlab-org
rspec-mysql 49/50

00:15:38

passed #137932056
gitlab-org
rspec-mysql 5/50

00:11:17

passed #137932105
gitlab-org
rspec-mysql 50/50

00:14:14

passed #137932057
gitlab-org
rspec-mysql 6/50

00:12:16

passed #137932058
gitlab-org
rspec-mysql 7/50

00:13:04

passed #137932059
gitlab-org
rspec-mysql 8/50

00:12:16

passed #137932060
gitlab-org
rspec-mysql 9/50

00:12:42

passed #137931997
gitlab-org
rspec-pg 1/50

00:13:10

passed #137932006
gitlab-org
rspec-pg 10/50

00:14:28

passed #137932007
gitlab-org
rspec-pg 11/50

00:13:00

passed #137932008
gitlab-org
rspec-pg 12/50

00:11:52

passed #137932009
gitlab-org
rspec-pg 13/50

00:13:12

passed #137932010
gitlab-org
rspec-pg 14/50

00:11:05

passed #137932011
gitlab-org
rspec-pg 15/50

00:12:29

passed #137932012
gitlab-org
rspec-pg 16/50

00:10:48

passed #137932014
gitlab-org
rspec-pg 17/50

00:12:52

passed #137932016
gitlab-org
rspec-pg 18/50

00:12:32

passed #137932017
gitlab-org
rspec-pg 19/50

00:15:02

passed #137931998
gitlab-org
rspec-pg 2/50

00:12:36

passed #137932018
gitlab-org
rspec-pg 20/50

00:13:33

passed #137932019
gitlab-org
rspec-pg 21/50

00:14:08

passed #137932020
gitlab-org
rspec-pg 22/50

00:13:49

passed #137932021
gitlab-org
rspec-pg 23/50

00:14:18

passed #137932022
gitlab-org
rspec-pg 24/50

00:12:14

passed #137932023
gitlab-org
rspec-pg 25/50

00:14:00

passed #137932024
gitlab-org
rspec-pg 26/50

00:10:36

passed #137932025
gitlab-org
rspec-pg 27/50

00:14:09

passed #137932026
gitlab-org
rspec-pg 28/50

00:12:30

passed #137932027
gitlab-org
rspec-pg 29/50

00:14:20

passed #137931999
gitlab-org
rspec-pg 3/50

00:13:45

passed #137932028
gitlab-org
rspec-pg 30/50

00:14:30

passed #137932029
gitlab-org
rspec-pg 31/50

00:13:07

passed #137932030
gitlab-org
rspec-pg 32/50

00:12:31

passed #137932031
gitlab-org
rspec-pg 33/50

00:13:12

passed #137932032
gitlab-org
rspec-pg 34/50

00:12:40

passed #137932033
gitlab-org
rspec-pg 35/50

00:14:15

passed #137932034
gitlab-org
rspec-pg 36/50

00:16:33

passed #137932035
gitlab-org
rspec-pg 37/50

00:13:42

passed #137932036
gitlab-org
rspec-pg 38/50

00:12:41

passed #137932037
gitlab-org
rspec-pg 39/50

00:14:06

passed #137932000
gitlab-org
rspec-pg 4/50

00:11:01

passed #137932038
gitlab-org
rspec-pg 40/50

00:13:48

passed #137932039
gitlab-org
rspec-pg 41/50

00:13:30

passed #137932040
gitlab-org
rspec-pg 42/50

00:13:56

passed #137932042
gitlab-org
rspec-pg 43/50

00:13:03

passed #137932044
gitlab-org
rspec-pg 44/50

00:14:27

passed #137932045
gitlab-org
rspec-pg 45/50

00:13:59

passed #137932046
gitlab-org
rspec-pg 46/50

00:12:02

passed #137932047
gitlab-org
rspec-pg 47/50

00:14:14

passed #137932048
gitlab-org
rspec-pg 48/50

00:12:55

passed #137932049
gitlab-org
rspec-pg 49/50

00:12:15

passed #137932001
gitlab-org
rspec-pg 5/50

00:11:52

passed #137932051
gitlab-org
rspec-pg 50/50

00:13:40

passed #137932002
gitlab-org
rspec-pg 6/50

00:14:39

passed #137932003
gitlab-org
rspec-pg 7/50

00:10:44

passed #137932004
gitlab-org
rspec-pg 8/50

00:12:45

passed #137932005
gitlab-org
rspec-pg 9/50

00:11:51

passed #137932124
allowed to fail
sast

00:04:04

passed #137932106
gitlab-org
static-analysis

00:10:49

failed #137932135
gitlab-org docker allowed to fail
review-qa-smoke

00:42:36

failed #137945922
docker gitlab-org allowed to fail
review-qa-smoke

00:14:48

failed #137932076
gitlab-org
rspec-mysql 25/50

00:15:13

 
  Post Test
passed #137932140
gitlab-org
coverage

00:02:47

100.0%
passed #137932138
gitlab-org allowed to fail
flaky-examples-check

00:01:26

passed #137932142
gitlab-org
lint:javascript:report

00:02:20

 
  Post Cleanup
manual #137932143
gitlab-org allowed to fail manual
review-docs-cleanup
 
Name Stage Failure
failed
review-qa-smoke Test
Randomized with seed 24593

Running after script...
$ date
Fri Dec 21 20:22:30 UTC 2018
Uploading artifacts...
./qa/gitlab-qa-run-*: found 24 matching files
Uploading artifacts to coordinator... ok
id=137949027 responseStatus=201 Created token=42k5ZkMq
ERROR: Job failed: exit code 1