Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2020-03-16 15:09:27 +00:00
parent cbfe03ae04
commit 8d4aaa4dd0
29 changed files with 199 additions and 81 deletions

View File

@ -1,4 +1,4 @@
query mergeRequest($projectPath: ID!, $mergeRequestIID: ID!) {
query mergeRequest($projectPath: ID!, $mergeRequestIID: String!) {
project(fullPath: $projectPath) {
mergeRequest(iid: $mergeRequestIID) {
createdAt

View File

@ -1,4 +1,4 @@
query ($fullPath: ID!, $iid: ID!) {
query ($fullPath: ID!, $iid: String!) {
project (fullPath: $fullPath) {
issue (iid: $iid) {
iid

View File

@ -1,4 +1,4 @@
query ($fullPath: ID!, $iid: ID!) {
query ($fullPath: ID!, $iid: String!) {
project (fullPath: $fullPath) {
issue (iid: $iid) {
iid

View File

@ -9,7 +9,7 @@ module Mutations
required: true,
description: "The project the issue to mutate is in"
argument :iid, GraphQL::ID_TYPE,
argument :iid, GraphQL::STRING_TYPE,
required: true,
description: "The iid of the issue to mutate"

View File

@ -9,7 +9,7 @@ module Mutations
required: true,
description: "The project the merge request to mutate is in"
argument :iid, GraphQL::ID_TYPE,
argument :iid, GraphQL::STRING_TYPE,
required: true,
description: "The iid of the merge request to mutate"

View File

@ -2,11 +2,11 @@
module Resolvers
class IssuesResolver < BaseResolver
argument :iid, GraphQL::ID_TYPE,
argument :iid, GraphQL::STRING_TYPE,
required: false,
description: 'IID of the issue. For example, "1"'
argument :iids, [GraphQL::ID_TYPE],
argument :iids, [GraphQL::STRING_TYPE],
required: false,
description: 'List of IIDs of issues. For example, [1, 2]'
argument :state, Types::IssuableStateEnum,

View File

@ -2,11 +2,11 @@
module Resolvers
class MergeRequestsResolver < BaseResolver
argument :iid, GraphQL::ID_TYPE,
argument :iid, GraphQL::STRING_TYPE,
required: false,
description: 'The IID of the merge request, e.g., "1"'
argument :iids, [GraphQL::ID_TYPE],
argument :iids, [GraphQL::STRING_TYPE],
required: false,
description: 'The list of IIDs of issues, e.g., [1, 2]'

View File

@ -11,7 +11,7 @@ module Types
field :id, GraphQL::ID_TYPE, null: false,
description: 'ID of the pipeline'
field :iid, GraphQL::ID_TYPE, null: false,
field :iid, GraphQL::STRING_TYPE, null: false,
description: 'Internal ID of the pipeline'
field :sha, GraphQL::STRING_TYPE, null: false,

View File

@ -14,7 +14,7 @@ module Types
field :id, GraphQL::ID_TYPE, null: false,
description: 'ID of the merge request'
field :iid, GraphQL::ID_TYPE, null: false,
field :iid, GraphQL::STRING_TYPE, null: false,
description: 'Internal ID of the merge request'
field :title, GraphQL::STRING_TYPE, null: false,
description: 'Title of the merge request'

View File

@ -0,0 +1,5 @@
---
title: Enable Redis cache key compression
merge_request: 27254
author:
type: performance

View File

@ -0,0 +1,5 @@
---
title: Enable feature Dynamic Child Pipeline creation via artifact
merge_request: 26648
author:
type: added

View File

@ -258,7 +258,7 @@ module Gitlab
# Full list of options:
# https://api.rubyonrails.org/classes/ActiveSupport/Cache/RedisCacheStore.html#method-c-new
caching_config_hash = Gitlab::Redis::Cache.params
caching_config_hash[:compress] = false
caching_config_hash[:compress] = Gitlab::Utils.to_boolean(ENV.fetch('ENABLE_REDIS_CACHE_COMPRESSION', '1'))
caching_config_hash[:namespace] = Gitlab::Redis::Cache::CACHE_NAMESPACE
caching_config_hash[:expires_in] = 2.weeks # Cache should not grow forever
if Gitlab::Runtime.multi_threaded?

View File

@ -5,7 +5,7 @@ if Gitlab::Runtime.console?
puts '-' * 80
puts " GitLab:".ljust(justify) + "#{Gitlab::VERSION} (#{Gitlab.revision}) #{Gitlab.ee? ? 'EE' : 'FOSS'}"
puts " GitLab Shell:".ljust(justify) + "#{Gitlab::VersionInfo.parse(Gitlab::Shell.new.version)}"
puts " GitLab Shell:".ljust(justify) + "#{Gitlab::VersionInfo.parse(Gitlab::Shell.version)}"
if Gitlab::Database.exists?
puts " #{Gitlab::Database.human_adapter_name}:".ljust(justify) + Gitlab::Database.version

View File

@ -5,7 +5,8 @@ THROUGHPUT_LABELS = [
'security',
'bug',
'feature',
'backstage'
'backstage',
'documentation'
].freeze
if gitlab.mr_body.size < 5

View File

@ -3757,7 +3757,7 @@ input IssueSetConfidentialInput {
"""
The iid of the issue to mutate
"""
iid: ID!
iid: String!
"""
The project the issue to mutate is in
@ -3802,7 +3802,7 @@ input IssueSetDueDateInput {
"""
The iid of the issue to mutate
"""
iid: ID!
iid: String!
"""
The project the issue to mutate is in
@ -3842,7 +3842,7 @@ input IssueSetWeightInput {
"""
The iid of the issue to mutate
"""
iid: ID!
iid: String!
"""
The project the issue to mutate is in
@ -4150,7 +4150,7 @@ type MergeRequest implements Noteable {
"""
Internal ID of the merge request
"""
iid: ID!
iid: String!
"""
Commit SHA of the merge request if merge is in progress
@ -4550,7 +4550,7 @@ input MergeRequestSetAssigneesInput {
"""
The iid of the merge request to mutate
"""
iid: ID!
iid: String!
"""
The operation to perform. Defaults to REPLACE.
@ -4595,7 +4595,7 @@ input MergeRequestSetLabelsInput {
"""
The iid of the merge request to mutate
"""
iid: ID!
iid: String!
"""
The Label IDs to set. Replaces existing labels by default.
@ -4645,7 +4645,7 @@ input MergeRequestSetLockedInput {
"""
The iid of the merge request to mutate
"""
iid: ID!
iid: String!
"""
Whether or not to lock the merge request.
@ -4690,7 +4690,7 @@ input MergeRequestSetMilestoneInput {
"""
The iid of the merge request to mutate
"""
iid: ID!
iid: String!
"""
The milestone to assign to the merge request.
@ -4735,7 +4735,7 @@ input MergeRequestSetSubscriptionInput {
"""
The iid of the merge request to mutate
"""
iid: ID!
iid: String!
"""
The project the merge request to mutate is in
@ -4780,7 +4780,7 @@ input MergeRequestSetWipInput {
"""
The iid of the merge request to mutate
"""
iid: ID!
iid: String!
"""
The project the merge request to mutate is in
@ -5351,7 +5351,7 @@ type Pipeline {
"""
Internal ID of the pipeline
"""
iid: ID!
iid: String!
"""
SHA of the pipeline's commit
@ -5629,12 +5629,12 @@ type Project {
"""
IID of the issue. For example, "1"
"""
iid: ID
iid: String
"""
List of IIDs of issues. For example, [1, 2]
"""
iids: [ID!]
iids: [String!]
"""
Labels applied to this issue
@ -5724,12 +5724,12 @@ type Project {
"""
IID of the issue. For example, "1"
"""
iid: ID
iid: String
"""
List of IIDs of issues. For example, [1, 2]
"""
iids: [ID!]
iids: [String!]
"""
Labels applied to this issue
@ -5799,12 +5799,12 @@ type Project {
"""
The IID of the merge request, e.g., "1"
"""
iid: ID
iid: String
"""
The list of IIDs of issues, e.g., [1, 2]
"""
iids: [ID!]
iids: [String!]
): MergeRequest
"""
@ -5829,12 +5829,12 @@ type Project {
"""
The IID of the merge request, e.g., "1"
"""
iid: ID
iid: String
"""
The list of IIDs of issues, e.g., [1, 2]
"""
iids: [ID!]
iids: [String!]
"""
Returns the last _n_ elements from the list.
@ -8112,7 +8112,7 @@ input UpdateIssueInput {
"""
The iid of the issue to mutate
"""
iid: ID!
iid: String!
"""
The project the issue to mutate is in

View File

@ -10768,7 +10768,7 @@
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "ID",
"name": "String",
"ofType": null
}
},
@ -10898,7 +10898,7 @@
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "ID",
"name": "String",
"ofType": null
}
},
@ -11028,7 +11028,7 @@
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "ID",
"name": "String",
"ofType": null
}
},
@ -11861,7 +11861,7 @@
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "ID",
"name": "String",
"ofType": null
}
},
@ -13024,7 +13024,7 @@
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "ID",
"name": "String",
"ofType": null
}
},
@ -13172,7 +13172,7 @@
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "ID",
"name": "String",
"ofType": null
}
},
@ -13320,7 +13320,7 @@
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "ID",
"name": "String",
"ofType": null
}
},
@ -13450,7 +13450,7 @@
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "ID",
"name": "String",
"ofType": null
}
},
@ -13576,7 +13576,7 @@
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "ID",
"name": "String",
"ofType": null
}
},
@ -13706,7 +13706,7 @@
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "ID",
"name": "String",
"ofType": null
}
},
@ -16283,7 +16283,7 @@
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "ID",
"name": "String",
"ofType": null
}
},
@ -17021,7 +17021,7 @@
"description": "IID of the issue. For example, \"1\"",
"type": {
"kind": "SCALAR",
"name": "ID",
"name": "String",
"ofType": null
},
"defaultValue": null
@ -17037,7 +17037,7 @@
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "ID",
"name": "String",
"ofType": null
}
}
@ -17200,7 +17200,7 @@
"description": "IID of the issue. For example, \"1\"",
"type": {
"kind": "SCALAR",
"name": "ID",
"name": "String",
"ofType": null
},
"defaultValue": null
@ -17216,7 +17216,7 @@
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "ID",
"name": "String",
"ofType": null
}
}
@ -17475,7 +17475,7 @@
"description": "The IID of the merge request, e.g., \"1\"",
"type": {
"kind": "SCALAR",
"name": "ID",
"name": "String",
"ofType": null
},
"defaultValue": null
@ -17491,7 +17491,7 @@
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "ID",
"name": "String",
"ofType": null
}
}
@ -17516,7 +17516,7 @@
"description": "The IID of the merge request, e.g., \"1\"",
"type": {
"kind": "SCALAR",
"name": "ID",
"name": "String",
"ofType": null
},
"defaultValue": null
@ -17532,7 +17532,7 @@
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "ID",
"name": "String",
"ofType": null
}
}
@ -24526,7 +24526,7 @@
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "ID",
"name": "String",
"ofType": null
}
},

View File

@ -630,7 +630,7 @@ Autogenerated return type of MarkAsSpamSnippet
| `forceRemoveSourceBranch` | Boolean | Indicates if the project settings will lead to source branch deletion after merge |
| `headPipeline` | Pipeline | The pipeline running on the branch HEAD of the merge request |
| `id` | ID! | ID of the merge request |
| `iid` | ID! | Internal ID of the merge request |
| `iid` | String! | Internal ID of the merge request |
| `inProgressMergeCommitSha` | String | Commit SHA of the merge request if merge is in progress |
| `mergeCommitMessage` **{warning-solid}** | String | **Deprecated:** Renamed to defaultMergeCommitMessage |
| `mergeCommitSha` | String | SHA of the merge request commit (set once merged) |
@ -834,7 +834,7 @@ Information about pagination in a connection.
| `duration` | Int | Duration of the pipeline in seconds |
| `finishedAt` | Time | Timestamp of the pipeline's completion |
| `id` | ID! | ID of the pipeline |
| `iid` | ID! | Internal ID of the pipeline |
| `iid` | String! | Internal ID of the pipeline |
| `sha` | String! | SHA of the pipeline's commit |
| `startedAt` | Time | Timestamp when the pipeline was started |
| `status` | PipelineStatusEnum! | Status of the pipeline (CREATED, WAITING_FOR_RESOURCE, PREPARING, PENDING, RUNNING, FAILED, SUCCESS, CANCELED, SKIPPED, MANUAL, SCHEDULED) |

View File

@ -308,7 +308,12 @@ Example response:
}
],
"links":[
{
"id":3,
"name":"hoge",
"url":"https://gitlab.example.com/root/awesome-app/-/tags/v0.11.1/binaries/linux-amd64",
"external":true
}
],
"evidence_url":"https://gitlab.example.com/root/awesome-app/-/releases/v0.1/evidence.json"
},
@ -334,13 +339,14 @@ POST /projects/:id/releases
| `assets:links` | array of hash | no | An array of assets links. |
| `assets:links:name`| string | required by: `assets:links` | The name of the link. |
| `assets:links:url` | string | required by: `assets:links` | The url of the link. |
| `assets:links:filepath` | string | no | Optional path for a [Direct Asset link](../../user/project/releases.md).
| `released_at` | datetime | no | The date when the release will be/was ready. Defaults to the current time. Expected in ISO 8601 format (`2019-03-15T08:00:00Z`). |
Example request:
```shell
curl --header 'Content-Type: application/json' --header "PRIVATE-TOKEN: gDybLx3yrUK_HLp3qPjS" \
--data '{ "name": "New release", "tag_name": "v0.3", "description": "Super nice release", "milestones": ["v1.0", "v1.0-rc"], "assets": { "links": [{ "name": "hoge", "url": "https://google.com" }] } }' \
--data '{ "name": "New release", "tag_name": "v0.3", "description": "Super nice release", "milestones": ["v1.0", "v1.0-rc"], "assets": { "links": [{ "name": "hoge", "url": "https://google.com", "filepath": "/binaries/linux-amd64" }] } }' \
--request POST https://gitlab.example.com/api/v4/projects/24/releases
```
@ -441,7 +447,7 @@ Example response:
{
"id":3,
"name":"hoge",
"url":"https://google.com",
"url":"https://gitlab.example.com/root/awesome-app/-/tags/v0.11.1/binaries/linux-amd64",
"external":true
}
],

View File

@ -126,7 +126,22 @@ microservice_a:
script: ...
```
## Dynamic child pipelines
> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/35632) in GitLab 12.9.
Instead of running a child pipeline from a static YAML file, you can define a job that runs
your own script to generate a YAML file, which is then [used to trigger a child pipeline](yaml/README.md#trigger-child-pipeline-with-generated-configuration-file).
This technique can be very powerful in generating pipelines targeting content that changed or to
build a matrix of targets and architectures.
## Limitations
A parent pipeline can trigger many child pipelines, but a child pipeline cannot trigger
further child pipelines. See the [related issue](https://gitlab.com/gitlab-org/gitlab/issues/29651) for discussion on possible future improvements.
further child pipelines. See the [related issue](https://gitlab.com/gitlab-org/gitlab/issues/29651)
for discussion on possible future improvements.
When triggering dynamic child pipelines, if the job containing the CI config artifact is not a predecessor of the
trigger job, the child pipeline will fail to be created, causing also the parent pipeline to fail.
In the future we want to validate the trigger job's dependencies [at the time the parent pipeline is created](https://gitlab.com/gitlab-org/gitlab/-/issues/209070) rather than when the child pipeline is created.

View File

@ -2899,6 +2899,31 @@ trigger_job:
strategy: depend
```
##### Trigger child pipeline with generated configuration file
> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/35632) in GitLab 12.9.
You can also trigger a child pipeline from a [dynamically generated configuration file](../parent_child_pipelines.md#dynamic-child-pipelines):
```yaml
generate-config:
stage: build
script: generate-ci-config > generated-config.yml
artifacts:
paths:
- generated-config.yml
child-pipeline:
stage: test
trigger:
include:
- artifact: generated-config.yml
job: generate-config
```
The `generated-config.yml` is extracted from the artifacts and used as the configuration
for triggering the child pipeline.
#### Linking pipelines with `trigger:strategy`
By default, the `trigger` job completes with the `success` status

View File

@ -547,7 +547,7 @@ argument :project_path, GraphQL::ID_TYPE,
required: true,
description: "The project the merge request to mutate is in"
argument :iid, GraphQL::ID_TYPE,
argument :iid, GraphQL::STRING_TYPE,
required: true,
description: "The iid of the merge request to mutate"

View File

@ -40,7 +40,7 @@ scheduling into milestones. Labelling is a task for everyone.
Most issues will have labels for at least one of the following:
- Type: `~feature`, `~bug`, `~backstage`, etc.
- Type: `~feature`, `~bug`, `~backstage`, `~documentation`, etc.
- Stage: `~"devops::plan"`, `~"devops::create"`, etc.
- Group: `~"group::source code"`, `~"group::knowledge"`, `~"group::editor"`, etc.
- Category: `~"Category:Code Analytics"`, `~"Category:DevOps Score"`, `~"Category:Templates"`, etc.
@ -70,6 +70,7 @@ The current type labels are:
- ~backstage
- ~"support request"
- ~meta
- ~documentation
A number of type labels have a priority assigned to them, which automatically
makes them float to the top, depending on their importance.

View File

@ -20,8 +20,7 @@ directly affect the way that any user or administrator interacts with GitLab.
Regardless of the type of issue or merge request, certain labels are required when documentation
is added or updated. The following are added by the issue or merge request author:
- An appropriate [type label](../contributing/issue_workflow.md#type-labels). For example,
`~backstage`.
- An appropriate [type label](../contributing/issue_workflow.md#type-labels).
- The [stage label](../contributing/issue_workflow.md#stage-labels) and
[group label](../contributing/issue_workflow.md#group-labels). For example, `~devops::create` and
`~group::source code`.
@ -377,8 +376,10 @@ For complex features split over multiple merge requests:
## For all other documentation
These documentation changes are not associated with the release of a new or updated feature, and are
therefore labeled `backstage` in GitLab, rather than `feature`. They may include:
Documentation changes that are not associated with the release of a new or updated feature
do not take the `~feature` label, but still need the `~documentation` label.
They may include:
- Documentation created or updated to improve accuracy, completeness, ease of use, or any reason
other than a [feature change](#for-a-product-change).

View File

@ -186,6 +186,23 @@ As long as you have enough available CPU and memory capacity, it's okay to incre
To change the Unicorn workers when you have the Omnibus package (which defaults to the recommendation above) please see [the Unicorn settings in the Omnibus GitLab documentation](https://docs.gitlab.com/omnibus/settings/unicorn.html).
## Puma Workers
For most instances we recommend using: max(CPU cores * 0.9, 2) = Puma workers.
For example a node with 4 cores would have 3 Unicorn workers.
For all machines that have 4GB and up we recommend a minimum of three Puma workers.
If you have a 2GB machine we recommend to configure only one Puma worker to prevent excessive swapping.
By default each Puma worker runs with 4 threads. We do not recommend setting more,
due to how [Ruby MRI multi-threading](https://en.wikipedia.org/wiki/Global_interpreter_lock) works.
For cases when you have to use [Legacy Rugged code](../development/gitaly.md#legacy-rugged-code) it is recommended to set number of threads to 1.
As long as you have enough available CPU and memory capacity, it's okay to increase the number of Puma workers and this will usually help to reduce the response time of the applications and increase the ability to handle parallel requests.
To change the Puma workers when you have the Omnibus package (which defaults to the recommendation above) please see [the Puma settings in the Omnibus GitLab documentation](https://docs.gitlab.com/omnibus/settings/puma.html).
## Redis and Sidekiq
Redis stores all user sessions and the background task queue.

View File

@ -25,12 +25,7 @@ calculates a separate median for each stage.
Value Stream Analytics is available:
- From GitLab 12.3, at the group level in the analytics workspace (top navigation bar) at
**Analytics > Value Stream Analytics**. **(PREMIUM)**
In the future, multiple groups will be selectable which will effectively make this an
instance-level feature.
- From GitLab 12.9, at the group level via **Group > Analytics > Value Stream**. **(PREMIUM)**
- At the project level via **Project > Value Stream Analytics**.
There are seven stages that are tracked as part of the Value Stream Analytics calculations.

View File

@ -67,7 +67,43 @@ links from your GitLab instance.
NOTE: **NOTE**
You can manipulate links of each release entry with [Release Links API](../../../api/releases/links.md)
#### Releases associated with milestones
#### Permanent links to Release assets
> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/27300) in GitLab 12.9.
The assets associated with a Release are accessible through a permanent URL.
GitLab will always redirect this URL to the actual asset
location, so even if the assets move to a different location, you can continue
to use the same URL. This is defined during [link creation](../../../api/releases/links.md#create-a-link) or [updating](../../../api/releases/links.md#update-a-link).
Each asset has a name, a URL of the *actual* asset location, and optionally, a
`filepath` parameter, which, if you specify it, will create a URL pointing
to the asset for the Release. The format of the URL is:
```html
https://host/namespace/project/releases/:release/downloads/:filepath
```
If you have an asset for the `v11.9.0-rc2` release in the `gitlab-org`
namespace and `gitlab-runner` project on `gitlab.com`, for example:
```json
{
"name": "linux amd64",
"filepath": "/binaries/gitlab-runner-linux-amd64",
"url": "https://gitlab-runner-downloads.s3.amazonaws.com/v11.9.0-rc2/binaries/gitlab-runner-linux-amd64"
}
```
This asset has a direct link of:
```html
https://gitlab.com/gitlab-org/gitlab-runner/releases/v11.9.0-rc2/downloads/binaries/gitlab-runner-linux-amd64
```
The physical location of the asset can change at any time and the direct link will remain unchanged.
### Releases associated with milestones
> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/29020) in GitLab 12.5.

View File

@ -30,7 +30,7 @@ module Gitlab
def matching?
super &&
Feature.enabled?(:ci_dynamic_child_pipeline, project)
Feature.enabled?(:ci_dynamic_child_pipeline, project, default_enabled: true)
end
private

View File

@ -13858,6 +13858,9 @@ msgstr ""
msgid "PackageRegistry|Add NuGet Source"
msgstr ""
msgid "PackageRegistry|Conan"
msgstr ""
msgid "PackageRegistry|Conan Command"
msgstr ""
@ -13921,12 +13924,21 @@ msgstr ""
msgid "PackageRegistry|Learn how to %{noPackagesLinkStart}publish and share your packages%{noPackagesLinkEnd} with GitLab."
msgstr ""
msgid "PackageRegistry|Maven"
msgstr ""
msgid "PackageRegistry|Maven Command"
msgstr ""
msgid "PackageRegistry|Maven XML"
msgstr ""
msgid "PackageRegistry|NPM"
msgstr ""
msgid "PackageRegistry|NuGet"
msgstr ""
msgid "PackageRegistry|NuGet Command"
msgstr ""
@ -13942,6 +13954,9 @@ msgstr ""
msgid "PackageRegistry|Remove package"
msgstr ""
msgid "PackageRegistry|There are no %{packageType} packages yet"
msgstr ""
msgid "PackageRegistry|There are no packages yet"
msgstr ""

View File

@ -53,26 +53,22 @@ describe Gitlab::Diff::HighlightCache, :clean_gitlab_redis_cache do
fallback_diff_refs: diffs.fallback_diff_refs)
end
it 'does not calculate highlighting when reading from cache' do
before do
cache.write_if_empty
cache.decorate(diff_file)
end
it 'does not calculate highlighting when reading from cache' do
expect_any_instance_of(Gitlab::Diff::Highlight).not_to receive(:highlight)
diff_file.highlighted_diff_lines
end
it 'assigns highlighted diff lines to the DiffFile' do
cache.write_if_empty
cache.decorate(diff_file)
expect(diff_file.highlighted_diff_lines.size).to be > 5
end
it 'assigns highlighted diff lines which rich_text are HTML-safe' do
cache.write_if_empty
cache.decorate(diff_file)
rich_texts = diff_file.highlighted_diff_lines.map(&:rich_text)
expect(rich_texts).to all(be_html_safe)