Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
d8f9f357
Commit
d8f9f357
authored
Oct 28, 2020
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab master
parents
ba37d7ec
41aaa3c1
Changes
29
Hide whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
58 additions
and
83 deletions
+58
-83
app/assets/javascripts/monitoring/components/variables/dropdown_field.vue
...cripts/monitoring/components/variables/dropdown_field.vue
+7
-10
app/models/analytics/instance_statistics/measurement.rb
app/models/analytics/instance_statistics/measurement.rb
+1
-5
changelogs/unreleased/Replace-GlDeprecatedDropdown-with-GlDropdown-in-app-assets-javascripts-mo.yml
...Dropdown-with-GlDropdown-in-app-assets-javascripts-mo.yml
+5
-0
config/feature_flags/development/store_ci_pipeline_counts_by_status.yml
..._flags/development/store_ci_pipeline_counts_by_status.yml
+0
-7
ee/db/fixtures/development/20_vulnerabilities.rb
ee/db/fixtures/development/20_vulnerabilities.rb
+1
-1
ee/spec/controllers/projects/security/vulnerabilities_controller_spec.rb
...lers/projects/security/vulnerabilities_controller_spec.rb
+2
-2
ee/spec/factories/vulnerabilities/findings.rb
ee/spec/factories/vulnerabilities/findings.rb
+1
-1
ee/spec/graphql/resolvers/vulnerabilities/scanners_resolver_spec.rb
...aphql/resolvers/vulnerabilities/scanners_resolver_spec.rb
+2
-2
ee/spec/helpers/vulnerabilities_helper_spec.rb
ee/spec/helpers/vulnerabilities_helper_spec.rb
+1
-1
ee/spec/lib/ee/gitlab/background_migration/remove_undefined_occurrence_confidence_level_spec.rb
...tion/remove_undefined_occurrence_confidence_level_spec.rb
+1
-1
ee/spec/lib/ee/gitlab/background_migration/remove_undefined_occurrence_severity_level_spec.rb
...ration/remove_undefined_occurrence_severity_level_spec.rb
+1
-1
ee/spec/lib/ee/gitlab/background_migration/update_vulnerability_confidence_spec.rb
...kground_migration/update_vulnerability_confidence_spec.rb
+1
-1
ee/spec/migrations/update_cs_vulnerability_confidence_column_spec.rb
...rations/update_cs_vulnerability_confidence_column_spec.rb
+2
-2
ee/spec/migrations/update_occurrence_severity_column_spec.rb
ee/spec/migrations/update_occurrence_severity_column_spec.rb
+2
-2
ee/spec/migrations/update_undefined_confidence_from_occurrences_spec.rb
...ions/update_undefined_confidence_from_occurrences_spec.rb
+2
-2
ee/spec/models/ee/vulnerability_spec.rb
ee/spec/models/ee/vulnerability_spec.rb
+3
-3
ee/spec/presenters/vulnerabilities/finding_presenter_spec.rb
ee/spec/presenters/vulnerabilities/finding_presenter_spec.rb
+1
-1
ee/spec/requests/api/graphql/vulnerabilities/location_spec.rb
...pec/requests/api/graphql/vulnerabilities/location_spec.rb
+5
-5
ee/spec/requests/api/graphql/vulnerabilities/primary_identifier_spec.rb
...ts/api/graphql/vulnerabilities/primary_identifier_spec.rb
+1
-1
ee/spec/requests/api/graphql/vulnerabilities/scanner_spec.rb
ee/spec/requests/api/graphql/vulnerabilities/scanner_spec.rb
+1
-1
ee/spec/requests/api/vulnerabilities_spec.rb
ee/spec/requests/api/vulnerabilities_spec.rb
+4
-4
ee/spec/serializers/vulnerabilities/finding_entity_spec.rb
ee/spec/serializers/vulnerabilities/finding_entity_spec.rb
+1
-1
ee/spec/serializers/vulnerabilities/request_entity_spec.rb
ee/spec/serializers/vulnerabilities/request_entity_spec.rb
+1
-1
ee/spec/serializers/vulnerabilities/response_entity_spec.rb
ee/spec/serializers/vulnerabilities/response_entity_spec.rb
+1
-1
ee/spec/services/vulnerabilities/create_service_spec.rb
ee/spec/services/vulnerabilities/create_service_spec.rb
+3
-3
ee/spec/services/vulnerabilities/update_service_spec.rb
ee/spec/services/vulnerabilities/update_service_spec.rb
+1
-1
spec/features/issues/user_sees_live_update_spec.rb
spec/features/issues/user_sees_live_update_spec.rb
+1
-1
spec/frontend/monitoring/components/variables/dropdown_field_spec.js
...nd/monitoring/components/variables/dropdown_field_spec.js
+3
-3
spec/models/analytics/instance_statistics/measurement_spec.rb
.../models/analytics/instance_statistics/measurement_spec.rb
+3
-19
No files found.
app/assets/javascripts/monitoring/components/variables/dropdown_field.vue
View file @
d8f9f357
<
script
>
import
{
GlFormGroup
,
GlD
eprecatedDropdown
,
GlDeprecated
DropdownItem
}
from
'
@gitlab/ui
'
;
import
{
GlFormGroup
,
GlD
ropdown
,
Gl
DropdownItem
}
from
'
@gitlab/ui
'
;
export
default
{
components
:
{
GlFormGroup
,
GlD
eprecatedD
ropdown
,
GlD
eprecatedD
ropdownItem
,
GlDropdown
,
GlDropdownItem
,
},
props
:
{
name
:
{
...
...
@@ -41,16 +41,13 @@ export default {
</
script
>
<
template
>
<gl-form-group
:label=
"label"
>
<gl-deprecated-dropdown
toggle-class=
"dropdown-menu-toggle"
:text=
"text || s__('Metrics|Select a value')"
>
<gl-deprecated-dropdown-item
<gl-dropdown
toggle-class=
"dropdown-menu-toggle"
:text=
"text || s__('Metrics|Select a value')"
>
<gl-dropdown-item
v-for=
"val in options.values"
:key=
"val.value"
@
click=
"onUpdate(val.value)"
>
{{
val
.
text
}}
</gl-d
eprecated-d
ropdown-item
>
{{
val
.
text
}}
</gl-dropdown-item
>
</gl-d
eprecated-d
ropdown>
</gl-dropdown>
</gl-form-group>
</
template
>
app/models/analytics/instance_statistics/measurement.rb
View file @
d8f9f357
...
...
@@ -38,11 +38,7 @@ module Analytics
scope
:with_identifier
,
->
(
identifier
)
{
where
(
identifier:
identifier
)
}
def
self
.
measurement_identifier_values
if
Feature
.
enabled?
(
:store_ci_pipeline_counts_by_status
,
default_enabled:
true
)
identifiers
.
values
else
identifiers
.
values
-
EXPERIMENTAL_IDENTIFIERS
.
map
{
|
identifier
|
identifiers
[
identifier
]
}
end
identifiers
.
values
end
end
end
...
...
changelogs/unreleased/Replace-GlDeprecatedDropdown-with-GlDropdown-in-app-assets-javascripts-mo.yml
0 → 100644
View file @
d8f9f357
---
title
:
Replace-GlDeprecatedDropdown-with-GlDropdown-in-app/assets/javascripts/monitoring
merge_request
:
41422
author
:
nuwe1
type
:
other
config/feature_flags/development/store_ci_pipeline_counts_by_status.yml
deleted
100644 → 0
View file @
ba37d7ec
---
name
:
store_ci_pipeline_counts_by_status
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/43027
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/254721
type
:
development
group
:
group::analytics
default_enabled
:
true
ee/db/fixtures/development/20_vulnerabilities.rb
View file @
d8f9f357
...
...
@@ -67,7 +67,7 @@ class Gitlab::Seeder::Vulnerabilities
def
create_occurrence
(
vulnerability
,
rank
,
primary_identifier
)
scanner
=
FactoryBot
.
create
(
:vulnerabilities_scanner
,
project:
vulnerability
.
project
)
FactoryBot
.
create
(
:vulnerabilities_
occurrence
,
:vulnerabilities_
finding
,
project:
project
,
vulnerability:
vulnerability
,
scanner:
scanner
,
...
...
ee/spec/controllers/projects/security/vulnerabilities_controller_spec.rb
View file @
d8f9f357
...
...
@@ -24,7 +24,7 @@ RSpec.describe Projects::Security::VulnerabilitiesController do
end
context
"when there's an attached pipeline"
do
let_it_be
(
:finding
)
{
create
(
:vulnerabilities_
occurrence
,
vulnerability:
vulnerability
,
pipelines:
[
pipeline
])
}
let_it_be
(
:finding
)
{
create
(
:vulnerabilities_
finding
,
vulnerability:
vulnerability
,
pipelines:
[
pipeline
])
}
it
'renders the vulnerability page'
do
show_vulnerability
...
...
@@ -42,7 +42,7 @@ RSpec.describe Projects::Security::VulnerabilitiesController do
end
context
"when there's no attached pipeline"
do
let_it_be
(
:finding
)
{
create
(
:vulnerabilities_
occurrence
,
vulnerability:
vulnerability
)
}
let_it_be
(
:finding
)
{
create
(
:vulnerabilities_
finding
,
vulnerability:
vulnerability
)
}
it
'renders the vulnerability page'
do
show_vulnerability
...
...
ee/spec/factories/vulnerabilities/findings.rb
View file @
d8f9f357
...
...
@@ -25,7 +25,7 @@ FactoryBot.define do
end
end
factory
:vulnerabilities_finding
,
class:
'Vulnerabilities::Finding'
,
aliases:
[
:vulnerabilities_occurrence
]
do
factory
:vulnerabilities_finding
,
class:
'Vulnerabilities::Finding'
do
name
{
'Cipher with no integrity'
}
project
sequence
(
:uuid
)
{
generate
(
:vulnerability_finding_uuid
)
}
...
...
ee/spec/graphql/resolvers/vulnerabilities/scanners_resolver_spec.rb
View file @
d8f9f357
...
...
@@ -15,10 +15,10 @@ RSpec.describe Resolvers::Vulnerabilities::ScannersResolver do
let_it_be
(
:user
)
{
create
(
:user
,
security_dashboard_projects:
[
project_with_no_group
])
}
let_it_be
(
:vulnerability_scanner_1
)
{
create
(
:vulnerabilities_scanner
,
project:
project
)
}
let_it_be
(
:finding_1
)
{
create
(
:vulnerabilities_
occurrence
,
project:
project
,
scanner:
vulnerability_scanner_1
)
}
let_it_be
(
:finding_1
)
{
create
(
:vulnerabilities_
finding
,
project:
project
,
scanner:
vulnerability_scanner_1
)
}
let_it_be
(
:vulnerability_scanner_2
)
{
create
(
:vulnerabilities_scanner
,
project:
project_with_no_group
)
}
let_it_be
(
:finding_2
)
{
create
(
:vulnerabilities_
occurrence
,
project:
project_with_no_group
,
scanner:
vulnerability_scanner_2
)
}
let_it_be
(
:finding_2
)
{
create
(
:vulnerabilities_
finding
,
project:
project_with_no_group
,
scanner:
vulnerability_scanner_2
)
}
let
(
:current_user
)
{
user
}
...
...
ee/spec/helpers/vulnerabilities_helper_spec.rb
View file @
d8f9f357
...
...
@@ -6,7 +6,7 @@ RSpec.describe VulnerabilitiesHelper do
let_it_be
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
:public
)
}
let
(
:pipeline
)
{
create
(
:ci_pipeline
,
:success
,
project:
project
)
}
let
(
:finding
)
{
create
(
:vulnerabilities_
occurrence
,
pipelines:
[
pipeline
],
project:
project
,
severity: :high
)
}
let
(
:finding
)
{
create
(
:vulnerabilities_
finding
,
pipelines:
[
pipeline
],
project:
project
,
severity: :high
)
}
let
(
:vulnerability
)
{
create
(
:vulnerability
,
title:
"My vulnerability"
,
project:
project
,
findings:
[
finding
])
}
before
do
...
...
ee/spec/lib/ee/gitlab/background_migration/remove_undefined_occurrence_confidence_level_spec.rb
View file @
d8f9f357
...
...
@@ -34,7 +34,7 @@ RSpec.describe Gitlab::BackgroundMigration::RemoveUndefinedOccurrenceConfidenceL
end
def
vuln_params
(
primary_identifier_id
)
attrs
=
attributes_for
(
:vulnerabilities_
occurrence
)
attrs
=
attributes_for
(
:vulnerabilities_
finding
)
{
confidence:
0
,
...
...
ee/spec/lib/ee/gitlab/background_migration/remove_undefined_occurrence_severity_level_spec.rb
View file @
d8f9f357
...
...
@@ -34,7 +34,7 @@ RSpec.describe Gitlab::BackgroundMigration::RemoveUndefinedOccurrenceSeverityLev
end
def
vuln_params
(
primary_identifier_id
)
attrs
=
attributes_for
(
:vulnerabilities_
occurrence
)
attrs
=
attributes_for
(
:vulnerabilities_
finding
)
{
severity:
0
,
...
...
ee/spec/lib/ee/gitlab/background_migration/update_vulnerability_confidence_spec.rb
View file @
d8f9f357
...
...
@@ -36,7 +36,7 @@ RSpec.describe Gitlab::BackgroundMigration::UpdateVulnerabilityConfidence, schem
end
def
container_scanning_vuln_params
(
primary_identifier_id
)
attrs
=
attributes_for
(
:vulnerabilities_
occurrence
)
attrs
=
attributes_for
(
:vulnerabilities_
finding
)
{
severity:
2
,
...
...
ee/spec/migrations/update_cs_vulnerability_confidence_column_spec.rb
View file @
d8f9f357
...
...
@@ -8,8 +8,8 @@ RSpec.describe UpdateCsVulnerabilityConfidenceColumn do
let
(
:identifiers
)
{
table
(
:vulnerability_identifiers
)
}
let
(
:scanners
)
{
table
(
:vulnerability_scanners
)
}
let
(
:projects
)
{
table
(
:projects
)
}
let
(
:vul1
)
{
attributes_for
(
:vulnerabilities_
occurrence
,
id:
1
,
report_type:
2
,
confidence:
5
)
}
let
(
:vul2
)
{
attributes_for
(
:vulnerabilities_
occurrence
,
id:
2
,
report_type:
2
,
confidence:
5
)
}
let
(
:vul1
)
{
attributes_for
(
:vulnerabilities_
finding
,
id:
1
,
report_type:
2
,
confidence:
5
)
}
let
(
:vul2
)
{
attributes_for
(
:vulnerabilities_
finding
,
id:
2
,
report_type:
2
,
confidence:
5
)
}
before
do
stub_const
(
"
#{
described_class
}
::BATCH_SIZE"
,
2
)
...
...
ee/spec/migrations/update_occurrence_severity_column_spec.rb
View file @
d8f9f357
...
...
@@ -8,8 +8,8 @@ RSpec.describe UpdateOccurrenceSeverityColumn do
let
(
:identifiers
)
{
table
(
:vulnerability_identifiers
)
}
let
(
:scanners
)
{
table
(
:vulnerability_scanners
)
}
let
(
:projects
)
{
table
(
:projects
)
}
let
(
:vul1
)
{
attributes_for
(
:vulnerabilities_
occurrence
,
id:
1
,
report_type:
2
,
confidence:
5
)
}
let
(
:vul2
)
{
attributes_for
(
:vulnerabilities_
occurrence
,
id:
2
,
report_type:
2
,
confidence:
5
)
}
let
(
:vul1
)
{
attributes_for
(
:vulnerabilities_
finding
,
id:
1
,
report_type:
2
,
confidence:
5
)
}
let
(
:vul2
)
{
attributes_for
(
:vulnerabilities_
finding
,
id:
2
,
report_type:
2
,
confidence:
5
)
}
before
do
stub_const
(
"
#{
described_class
}
::BATCH_SIZE"
,
2
)
...
...
ee/spec/migrations/update_undefined_confidence_from_occurrences_spec.rb
View file @
d8f9f357
...
...
@@ -8,8 +8,8 @@ RSpec.describe UpdateUndefinedConfidenceFromOccurrences, :migration do
let
(
:identifiers
)
{
table
(
:vulnerability_identifiers
)
}
let
(
:scanners
)
{
table
(
:vulnerability_scanners
)
}
let
(
:projects
)
{
table
(
:projects
)
}
let
(
:vul1
)
{
attributes_for
(
:vulnerabilities_
occurrence
,
id:
1
,
report_type:
2
,
confidence:
5
)
}
let
(
:vul2
)
{
attributes_for
(
:vulnerabilities_
occurrence
,
id:
2
,
report_type:
2
,
confidence:
5
)
}
let
(
:vul1
)
{
attributes_for
(
:vulnerabilities_
finding
,
id:
1
,
report_type:
2
,
confidence:
5
)
}
let
(
:vul2
)
{
attributes_for
(
:vulnerabilities_
finding
,
id:
2
,
report_type:
2
,
confidence:
5
)
}
before
do
stub_const
(
"
#{
described_class
}
::BATCH_SIZE"
,
2
)
...
...
ee/spec/models/ee/vulnerability_spec.rb
View file @
d8f9f357
...
...
@@ -495,8 +495,8 @@ RSpec.describe Vulnerability do
describe
'#finding'
do
let_it_be
(
:project
)
{
create
(
:project
,
:with_vulnerability
)
}
let_it_be
(
:vulnerability
)
{
project
.
vulnerabilities
.
first
}
let_it_be
(
:finding1
)
{
create
(
:vulnerabilities_
occurrence
,
vulnerability:
vulnerability
)
}
let_it_be
(
:finding2
)
{
create
(
:vulnerabilities_
occurrence
,
vulnerability:
vulnerability
)
}
let_it_be
(
:finding1
)
{
create
(
:vulnerabilities_
finding
,
vulnerability:
vulnerability
)
}
let_it_be
(
:finding2
)
{
create
(
:vulnerabilities_
finding
,
vulnerability:
vulnerability
)
}
subject
{
vulnerability
.
finding
}
...
...
@@ -561,7 +561,7 @@ RSpec.describe Vulnerability do
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:occurrence
)
do
create
(
:vulnerabilities_
occurrence
,
:vulnerabilities_
finding
,
report_type: :dependency_scanning
,
project:
project
)
...
...
ee/spec/presenters/vulnerabilities/finding_presenter_spec.rb
View file @
d8f9f357
...
...
@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec
.
describe
Vulnerabilities
::
FindingPresenter
do
let
(
:presenter
)
{
described_class
.
new
(
occurrence
)
}
let
(
:occurrence
)
{
build_stubbed
(
:vulnerabilities_
occurrence
)
}
let
(
:occurrence
)
{
build_stubbed
(
:vulnerabilities_
finding
)
}
describe
'#blob_path'
do
subject
{
presenter
.
blob_path
}
...
...
ee/spec/requests/api/graphql/vulnerabilities/location_spec.rb
View file @
d8f9f357
...
...
@@ -90,7 +90,7 @@ RSpec.describe 'Query.vulnerabilities.location' do
let_it_be
(
:finding
)
do
create
(
:vulnerabilities_
occurrence
,
:vulnerabilities_
finding
,
vulnerability:
vulnerability
,
raw_metadata:
metadata
.
to_json
)
...
...
@@ -128,7 +128,7 @@ RSpec.describe 'Query.vulnerabilities.location' do
let_it_be
(
:finding
)
do
create
(
:vulnerabilities_
occurrence
,
:vulnerabilities_
finding
,
vulnerability:
vulnerability
,
raw_metadata:
metadata
.
to_json
)
...
...
@@ -163,7 +163,7 @@ RSpec.describe 'Query.vulnerabilities.location' do
let_it_be
(
:finding
)
do
create
(
:vulnerabilities_
occurrence
,
:vulnerabilities_
finding
,
vulnerability:
vulnerability
,
raw_metadata:
metadata
.
to_json
)
...
...
@@ -200,7 +200,7 @@ RSpec.describe 'Query.vulnerabilities.location' do
let_it_be
(
:finding
)
do
create
(
:vulnerabilities_
occurrence
,
:vulnerabilities_
finding
,
vulnerability:
vulnerability
,
raw_metadata:
metadata
.
to_json
)
...
...
@@ -236,7 +236,7 @@ RSpec.describe 'Query.vulnerabilities.location' do
let_it_be
(
:finding
)
do
create
(
:vulnerabilities_
occurrence
,
:vulnerabilities_
finding
,
vulnerability:
vulnerability
,
raw_metadata:
metadata
.
to_json
)
...
...
ee/spec/requests/api/graphql/vulnerabilities/primary_identifier_spec.rb
View file @
d8f9f357
...
...
@@ -37,7 +37,7 @@ RSpec.describe 'Query.vulnerabilities.primaryIdentifier' do
let_it_be
(
:finding
)
do
create
(
:vulnerabilities_
occurrence
,
:vulnerabilities_
finding
,
vulnerability:
vulnerability
,
primary_identifier:
primary_identifier
)
...
...
ee/spec/requests/api/graphql/vulnerabilities/scanner_spec.rb
View file @
d8f9f357
...
...
@@ -34,7 +34,7 @@ RSpec.describe 'Query.vulnerabilities.scanner' do
let_it_be
(
:finding
)
do
create
(
:vulnerabilities_
occurrence
,
:vulnerabilities_
finding
,
vulnerability:
vulnerability
,
scanner:
vulnerabilities_scanner
)
...
...
ee/spec/requests/api/vulnerabilities_spec.rb
View file @
d8f9f357
...
...
@@ -61,7 +61,7 @@ RSpec.describe API::Vulnerabilities do
describe
'GET /vulnerabilities/:id'
do
let_it_be
(
:project
)
{
create
(
:project
,
:with_vulnerabilities
)
}
let_it_be
(
:vulnerability
)
{
project
.
vulnerabilities
.
first
}
let_it_be
(
:finding
)
{
create
(
:vulnerabilities_
occurrence
,
vulnerability:
vulnerability
)
}
let_it_be
(
:finding
)
{
create
(
:vulnerabilities_
finding
,
vulnerability:
vulnerability
)
}
let
(
:vulnerability_id
)
{
vulnerability
.
id
}
subject
(
:get_vulnerability
)
{
get
api
(
"/vulnerabilities/
#{
vulnerability_id
}
"
,
user
)
}
...
...
@@ -106,7 +106,7 @@ RSpec.describe API::Vulnerabilities do
describe
'POST /projects/:id/vulnerabilities'
do
let_it_be
(
:project
)
{
create
(
:project
)
}
let
(
:finding
)
{
create
(
:vulnerabilities_
occurrence
,
project:
project
)
}
let
(
:finding
)
{
create
(
:vulnerabilities_
finding
,
project:
project
)
}
let
(
:finding_id
)
{
finding
.
id
}
let
(
:expected_error_messages
)
{
{
'base'
=>
[
'finding is not found or is already attached to a vulnerability'
]
}
}
...
...
@@ -177,7 +177,7 @@ RSpec.describe API::Vulnerabilities do
describe
'POST /vulnerabilities:id/dismiss'
do
before
do
create_list
(
:vulnerabilities_
occurrence
,
2
,
vulnerability:
vulnerability
,
project:
vulnerability
.
project
)
create_list
(
:vulnerabilities_
finding
,
2
,
vulnerability:
vulnerability
,
project:
vulnerability
.
project
)
end
let_it_be
(
:project
)
{
create
(
:project
,
:with_vulnerabilities
)
}
...
...
@@ -378,7 +378,7 @@ RSpec.describe API::Vulnerabilities do
describe
'POST /vulnerabilities:id/revert'
do
before
do
create_list
(
:vulnerabilities_
occurrence
,
2
,
vulnerability:
vulnerability
,
project:
vulnerability
.
project
)
create_list
(
:vulnerabilities_
finding
,
2
,
vulnerability:
vulnerability
,
project:
vulnerability
.
project
)
end
let_it_be
(
:project
)
{
create
(
:project
)
}
...
...
ee/spec/serializers/vulnerabilities/finding_entity_spec.rb
View file @
d8f9f357
...
...
@@ -19,7 +19,7 @@ RSpec.describe Vulnerabilities::FindingEntity do
let
(
:occurrence
)
do
build
(
:vulnerabilities_
occurrence
,
:vulnerabilities_
finding
,
scanner:
scanner
,
scan:
scan
,
project:
project
,
...
...
ee/spec/serializers/vulnerabilities/request_entity_spec.rb
View file @
d8f9f357
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
RSpec
.
describe
Vulnerabilities
::
RequestEntity
do
let
(
:request
)
{
create
(
:vulnerabilities_
occurrence
).
evidence
[
:request
]
}
let
(
:request
)
{
create
(
:vulnerabilities_
finding
).
evidence
[
:request
]
}
let
(
:entity
)
do
described_class
.
represent
(
request
)
...
...
ee/spec/serializers/vulnerabilities/response_entity_spec.rb
View file @
d8f9f357
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
RSpec
.
describe
Vulnerabilities
::
ResponseEntity
do
let
(
:response
)
{
create
(
:vulnerabilities_
occurrence
).
evidence
[
:response
]
}
let
(
:response
)
{
create
(
:vulnerabilities_
finding
).
evidence
[
:response
]
}
let
(
:entity
)
do
described_class
.
represent
(
response
)
...
...
ee/spec/services/vulnerabilities/create_service_spec.rb
View file @
d8f9f357
...
...
@@ -9,7 +9,7 @@ RSpec.describe Vulnerabilities::CreateService do
let_it_be
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
)
}
# cannot use let_it_be here: caching causes problems with permission-related tests
let
(
:finding
)
{
create
(
:vulnerabilities_
occurrence
,
project:
project
)
}
let
(
:finding
)
{
create
(
:vulnerabilities_
finding
,
project:
project
)
}
let
(
:finding_id
)
{
finding
.
id
}
let
(
:expected_error_messages
)
{
{
base:
[
'finding is not found or is already attached to a vulnerability'
]
}
}
...
...
@@ -39,7 +39,7 @@ RSpec.describe Vulnerabilities::CreateService do
end
context
'and finding is dismissed'
do
let
(
:finding
)
{
create
(
:vulnerabilities_
occurrence
,
:with_dismissal_feedback
,
project:
project
)
}
let
(
:finding
)
{
create
(
:vulnerabilities_
finding
,
:with_dismissal_feedback
,
project:
project
)
}
let
(
:vulnerability
)
{
project
.
vulnerabilities
.
last
}
it
'creates a vulnerability in a dismissed state and sets dismissal information'
do
...
...
@@ -67,7 +67,7 @@ RSpec.describe Vulnerabilities::CreateService do
end
context
'when finding does not belong to the vulnerability project'
do
let
(
:finding
)
{
create
(
:vulnerabilities_
occurrence
)
}
let
(
:finding
)
{
create
(
:vulnerabilities_
finding
)
}
it
'adds expected error to the response'
do
expect
(
subject
.
errors
.
messages
).
to
eq
(
expected_error_messages
)
...
...
ee/spec/services/vulnerabilities/update_service_spec.rb
View file @
d8f9f357
...
...
@@ -9,7 +9,7 @@ RSpec.describe Vulnerabilities::UpdateService do
let_it_be
(
:user
)
{
create
(
:user
)
}
let!
(
:project
)
{
create
(
:project
)
}
# cannot use let_it_be here: caching causes problems with permission-related tests
let!
(
:updated_finding
)
{
create
(
:vulnerabilities_
occurrence
,
project:
project
,
name:
'New title'
,
severity: :critical
,
confidence: :confirmed
,
vulnerability:
vulnerability
)
}
let!
(
:updated_finding
)
{
create
(
:vulnerabilities_
finding
,
project:
project
,
name:
'New title'
,
severity: :critical
,
confidence: :confirmed
,
vulnerability:
vulnerability
)
}
let!
(
:vulnerability
)
{
create
(
:vulnerability
,
project:
project
,
severity: :low
,
severity_overridden:
severity_overridden
,
confidence: :ignore
,
confidence_overridden:
confidence_overridden
)
}
let
(
:severity_overridden
)
{
false
}
...
...
spec/features/issues/user_sees_live_update_spec.rb
View file @
d8f9f357
...
...
@@ -26,7 +26,7 @@ RSpec.describe 'Issues > User sees live update', :js do
end
describe
'confidential issue#show'
do
it
'shows confidential sibebar information as confidential and can be turned off'
do
it
'shows confidential sibebar information as confidential and can be turned off'
,
quarantine:
'https://gitlab.com/gitlab-org/gitlab/-/issues/254644'
do
issue
=
create
(
:issue
,
:confidential
,
project:
project
)
visit
project_issue_path
(
project
,
issue
)
...
...
spec/frontend/monitoring/components/variables/dropdown_field_spec.js
View file @
d8f9f357
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlD
eprecatedDropdown
,
GlDeprecated
DropdownItem
}
from
'
@gitlab/ui
'
;
import
{
GlD
ropdown
,
Gl
DropdownItem
}
from
'
@gitlab/ui
'
;
import
DropdownField
from
'
~/monitoring/components/variables/dropdown_field.vue
'
;
describe
(
'
Custom variable component
'
,
()
=>
{
...
...
@@ -23,8 +23,8 @@ describe('Custom variable component', () => {
});
};
const
findDropdown
=
()
=>
wrapper
.
find
(
GlD
eprecatedD
ropdown
);
const
findDropdownItems
=
()
=>
wrapper
.
findAll
(
GlD
eprecatedD
ropdownItem
);
const
findDropdown
=
()
=>
wrapper
.
find
(
GlDropdown
);
const
findDropdownItems
=
()
=>
wrapper
.
findAll
(
GlDropdownItem
);
it
(
'
renders dropdown element when all necessary props are passed
'
,
()
=>
{
createShallowWrapper
();
...
...
spec/models/analytics/instance_statistics/measurement_spec.rb
View file @
d8f9f357
...
...
@@ -48,26 +48,10 @@ RSpec.describe Analytics::InstanceStatistics::Measurement, type: :model do
end
describe
'#measurement_identifier_values'
do
subject
{
described_class
.
measurement_identifier_values
.
count
}
context
'when the `store_ci_pipeline_counts_by_status` feature flag is off'
do
let
(
:expected_count
)
{
Analytics
::
InstanceStatistics
::
Measurement
.
identifiers
.
size
-
Analytics
::
InstanceStatistics
::
Measurement
::
EXPERIMENTAL_IDENTIFIERS
.
size
}
before
do
stub_feature_flags
(
store_ci_pipeline_counts_by_status:
false
)
end
it
{
is_expected
.
to
eq
(
expected_count
)
}
end
context
'when the `store_ci_pipeline_counts_by_status` feature flag is on'
do
let
(
:expected_count
)
{
Analytics
::
InstanceStatistics
::
Measurement
.
identifiers
.
size
}
let
(
:expected_count
)
{
Analytics
::
InstanceStatistics
::
Measurement
.
identifiers
.
size
}
before
do
stub_feature_flags
(
store_ci_pipeline_counts_by_status:
true
)
end
subject
{
described_class
.
measurement_identifier_values
.
count
}
it
{
is_expected
.
to
eq
(
expected_count
)
}
end
it
{
is_expected
.
to
eq
(
expected_count
)
}
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment