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
3b2e49e6
Commit
3b2e49e6
authored
Sep 09, 2021
by
Fernando
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make feature flag scoping consistent
* Scope to instance
parent
1a2d8f8b
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
12 additions
and
12 deletions
+12
-12
app/views/projects/merge_requests/_widget.html.haml
app/views/projects/merge_requests/_widget.html.haml
+1
-1
ee/app/finders/security/findings_finder.rb
ee/app/finders/security/findings_finder.rb
+1
-1
ee/app/finders/security/pipeline_vulnerabilities_finder.rb
ee/app/finders/security/pipeline_vulnerabilities_finder.rb
+1
-1
ee/app/graphql/types/pipeline_security_report_finding_type.rb
...pp/graphql/types/pipeline_security_report_finding_type.rb
+1
-1
ee/app/graphql/types/vulnerability_type.rb
ee/app/graphql/types/vulnerability_type.rb
+1
-1
ee/app/helpers/ee/projects_helper.rb
ee/app/helpers/ee/projects_helper.rb
+1
-1
ee/app/helpers/groups/security_features_helper.rb
ee/app/helpers/groups/security_features_helper.rb
+1
-1
ee/app/serializers/vulnerabilities/finding_entity.rb
ee/app/serializers/vulnerabilities/finding_entity.rb
+1
-1
ee/app/services/security/store_report_service.rb
ee/app/services/security/store_report_service.rb
+1
-1
ee/app/views/projects/pipelines/_tabs_content.html.haml
ee/app/views/projects/pipelines/_tabs_content.html.haml
+1
-1
ee/app/views/projects/security/vulnerabilities/show.html.haml
...pp/views/projects/security/vulnerabilities/show.html.haml
+1
-1
ee/spec/graphql/types/vulnerability_type_spec.rb
ee/spec/graphql/types/vulnerability_type_spec.rb
+1
-1
No files found.
app/views/projects/merge_requests/_widget.html.haml
View file @
3b2e49e6
...
@@ -19,6 +19,6 @@
...
@@ -19,6 +19,6 @@
window.gl.mrWidgetData.pipelines_empty_svg_path = '
#{
image_path
(
'illustrations/pipelines_empty.svg'
)
}
';
window.gl.mrWidgetData.pipelines_empty_svg_path = '
#{
image_path
(
'illustrations/pipelines_empty.svg'
)
}
';
window.gl.mrWidgetData.codequality_help_path = '
#{
help_page_path
(
"user/project/merge_requests/code_quality"
,
anchor:
"code-quality-reports"
)
}
';
window.gl.mrWidgetData.codequality_help_path = '
#{
help_page_path
(
"user/project/merge_requests/code_quality"
,
anchor:
"code-quality-reports"
)
}
';
window.gl.mrWidgetData.false_positive_doc_url = '
#{
help_page_path
(
'user/application_security/vulnerabilities/index'
)
}
';
window.gl.mrWidgetData.false_positive_doc_url = '
#{
help_page_path
(
'user/application_security/vulnerabilities/index'
)
}
';
window.gl.mrWidgetData.can_view_false_positive = '
#{
(
Feature
.
enabled?
(
:vulnerability_flags
,
@merge_request
.
project
,
default_enabled: :yaml
)
&&
@merge_request
.
project
.
licensed_feature_available?
(
:sast_fp_reduction
)).
to_s
}
';
window.gl.mrWidgetData.can_view_false_positive = '
#{
(
Feature
.
enabled?
(
:vulnerability_flags
,
default_enabled: :yaml
)
&&
@merge_request
.
project
.
licensed_feature_available?
(
:sast_fp_reduction
)).
to_s
}
';
#js-vue-mr-widget
.mr-widget
#js-vue-mr-widget
.mr-widget
ee/app/finders/security/findings_finder.rb
View file @
3b2e49e6
...
@@ -82,7 +82,7 @@ module Security
...
@@ -82,7 +82,7 @@ module Security
end
end
def
calculate_false_positive?
def
calculate_false_positive?
::
Feature
.
enabled?
(
:vulnerability_flags
,
project
,
default_enabled: :yaml
)
&&
project
.
licensed_feature_available?
(
:sast_fp_reduction
)
::
Feature
.
enabled?
(
:vulnerability_flags
,
default_enabled: :yaml
)
&&
project
.
licensed_feature_available?
(
:sast_fp_reduction
)
end
end
def
existing_vulnerabilities
def
existing_vulnerabilities
...
...
ee/app/finders/security/pipeline_vulnerabilities_finder.rb
View file @
3b2e49e6
...
@@ -114,7 +114,7 @@ module Security
...
@@ -114,7 +114,7 @@ module Security
def
calculate_false_positive?
def
calculate_false_positive?
project
=
pipeline
.
project
project
=
pipeline
.
project
::
Feature
.
enabled?
(
:vulnerability_flags
,
project
,
default_enabled: :yaml
)
&&
project
.
licensed_feature_available?
(
:sast_fp_reduction
)
::
Feature
.
enabled?
(
:vulnerability_flags
,
default_enabled: :yaml
)
&&
project
.
licensed_feature_available?
(
:sast_fp_reduction
)
end
end
def
filter
(
findings
)
def
filter
(
findings
)
...
...
ee/app/graphql/types/pipeline_security_report_finding_type.rb
View file @
3b2e49e6
...
@@ -94,7 +94,7 @@ module Types
...
@@ -94,7 +94,7 @@ module Types
private
private
def
expose_false_positive?
def
expose_false_positive?
Feature
.
enabled?
(
:vulnerability_flags
,
object
.
project
,
default_enabled: :yaml
)
&&
object
.
project
.
licensed_feature_available?
(
:sast_fp_reduction
)
Feature
.
enabled?
(
:vulnerability_flags
,
default_enabled: :yaml
)
&&
object
.
project
.
licensed_feature_available?
(
:sast_fp_reduction
)
end
end
end
end
# rubocop: enable Graphql/AuthorizeTypes
# rubocop: enable Graphql/AuthorizeTypes
...
...
ee/app/graphql/types/vulnerability_type.rb
View file @
3b2e49e6
...
@@ -160,7 +160,7 @@ module Types
...
@@ -160,7 +160,7 @@ module Types
private
private
def
expose_false_positive?
def
expose_false_positive?
Feature
.
enabled?
(
:vulnerability_flags
,
object
.
project
,
default_enabled: :yaml
)
&&
object
.
project
.
licensed_feature_available?
(
:sast_fp_reduction
)
Feature
.
enabled?
(
:vulnerability_flags
,
default_enabled: :yaml
)
&&
object
.
project
.
licensed_feature_available?
(
:sast_fp_reduction
)
end
end
end
end
end
end
ee/app/helpers/ee/projects_helper.rb
View file @
3b2e49e6
...
@@ -210,7 +210,7 @@ module EE
...
@@ -210,7 +210,7 @@ module EE
end
end
def
can_view_false_positive?
def
can_view_false_positive?
(
::
Feature
.
enabled?
(
:vulnerability_flags
,
project
,
default_enabled: :yaml
)
&&
project
.
licensed_feature_available?
(
:sast_fp_reduction
)).
to_s
(
::
Feature
.
enabled?
(
:vulnerability_flags
,
default_enabled: :yaml
)
&&
project
.
licensed_feature_available?
(
:sast_fp_reduction
)).
to_s
end
end
def
can_update_security_orchestration_policy_project?
(
project
)
def
can_update_security_orchestration_policy_project?
(
project
)
...
...
ee/app/helpers/groups/security_features_helper.rb
View file @
3b2e49e6
...
@@ -28,7 +28,7 @@ module Groups::SecurityFeaturesHelper
...
@@ -28,7 +28,7 @@ module Groups::SecurityFeaturesHelper
scanners:
VulnerabilityScanners
::
ListService
.
new
(
group
).
execute
.
to_json
,
scanners:
VulnerabilityScanners
::
ListService
.
new
(
group
).
execute
.
to_json
,
can_admin_vulnerability:
can?
(
current_user
,
:admin_vulnerability
,
group
).
to_s
,
can_admin_vulnerability:
can?
(
current_user
,
:admin_vulnerability
,
group
).
to_s
,
false_positive_doc_url:
help_page_path
(
'user/application_security/vulnerabilities/index'
),
false_positive_doc_url:
help_page_path
(
'user/application_security/vulnerabilities/index'
),
can_view_false_positive:
(
::
Feature
.
enabled?
(
:vulnerability_flags
,
group
,
default_enabled: :yaml
)
&&
group
.
licensed_feature_available?
(
:sast_fp_reduction
)).
to_s
can_view_false_positive:
(
::
Feature
.
enabled?
(
:vulnerability_flags
,
default_enabled: :yaml
)
&&
group
.
licensed_feature_available?
(
:sast_fp_reduction
)).
to_s
}
}
end
end
end
end
ee/app/serializers/vulnerabilities/finding_entity.rb
View file @
3b2e49e6
...
@@ -62,7 +62,7 @@ class Vulnerabilities::FindingEntity < Grape::Entity
...
@@ -62,7 +62,7 @@ class Vulnerabilities::FindingEntity < Grape::Entity
def
expose_false_positive?
def
expose_false_positive?
project
=
occurrence
.
project
project
=
occurrence
.
project
::
Feature
.
enabled?
(
:vulnerability_flags
,
project
,
default_enabled: :yaml
)
&&
project
.
licensed_feature_available?
(
:sast_fp_reduction
)
::
Feature
.
enabled?
(
:vulnerability_flags
,
default_enabled: :yaml
)
&&
project
.
licensed_feature_available?
(
:sast_fp_reduction
)
end
end
end
end
...
...
ee/app/services/security/store_report_service.rb
View file @
3b2e49e6
...
@@ -59,7 +59,7 @@ module Security
...
@@ -59,7 +59,7 @@ module Security
update_vulnerabilities_identifiers
update_vulnerabilities_identifiers
update_vulnerabilities_finding_identifiers
update_vulnerabilities_finding_identifiers
if
::
Feature
.
enabled?
(
:vulnerability_flags
,
project
,
default_enabled: :yaml
)
&&
project
.
licensed_feature_available?
(
:sast_fp_reduction
)
if
::
Feature
.
enabled?
(
:vulnerability_flags
,
default_enabled: :yaml
)
&&
project
.
licensed_feature_available?
(
:sast_fp_reduction
)
create_vulnerability_flags_info
create_vulnerability_flags_info
end
end
...
...
ee/app/views/projects/pipelines/_tabs_content.html.haml
View file @
3b2e49e6
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
commit_path_template:
commit_path_template
(
project
),
commit_path_template:
commit_path_template
(
project
),
can_admin_vulnerability:
can?
(
current_user
,
:admin_vulnerability
,
project
).
to_s
,
can_admin_vulnerability:
can?
(
current_user
,
:admin_vulnerability
,
project
).
to_s
,
false_positive_doc_url:
help_page_path
(
'user/application_security/vulnerabilities/index'
),
false_positive_doc_url:
help_page_path
(
'user/application_security/vulnerabilities/index'
),
can_view_false_positive:
(
::
Feature
.
enabled?
(
:vulnerability_flags
,
project
,
default_enabled: :yaml
)
&&
project
.
licensed_feature_available?
(
:sast_fp_reduction
)).
to_s
,
can_view_false_positive:
(
::
Feature
.
enabled?
(
:vulnerability_flags
,
default_enabled: :yaml
)
&&
project
.
licensed_feature_available?
(
:sast_fp_reduction
)).
to_s
,
security_report_help_page_link:
help_page_path
(
'user/application_security/index'
,
anchor:
'security-report-validation'
)
}
}
security_report_help_page_link:
help_page_path
(
'user/application_security/index'
,
anchor:
'security-report-validation'
)
}
}
-
if
pipeline
.
expose_license_scanning_data?
-
if
pipeline
.
expose_license_scanning_data?
...
...
ee/app/views/projects/security/vulnerabilities/show.html.haml
View file @
3b2e49e6
...
@@ -7,5 +7,5 @@
...
@@ -7,5 +7,5 @@
#js-vulnerability-main
{
data:
{
vulnerability:
vulnerability_details_json
(
@vulnerability
,
@pipeline
),
#js-vulnerability-main
{
data:
{
vulnerability:
vulnerability_details_json
(
@vulnerability
,
@pipeline
),
false_positive_doc_url:
help_page_path
(
'user/application_security/vulnerabilities/index'
),
false_positive_doc_url:
help_page_path
(
'user/application_security/vulnerabilities/index'
),
can_view_false_positive:
(
::
Feature
.
enabled?
(
:vulnerability_flags
,
@project
,
default_enabled: :yaml
)
&&
@project
.
licensed_feature_available?
(
:sast_fp_reduction
)).
to_s
,
can_view_false_positive:
(
::
Feature
.
enabled?
(
:vulnerability_flags
,
default_enabled: :yaml
)
&&
@project
.
licensed_feature_available?
(
:sast_fp_reduction
)).
to_s
,
commit_path_template:
commit_path_template
(
@project
)
}
}
commit_path_template:
commit_path_template
(
@project
)
}
}
ee/spec/graphql/types/vulnerability_type_spec.rb
View file @
3b2e49e6
...
@@ -163,7 +163,7 @@ RSpec.describe GitlabSchema.types['Vulnerability'] do
...
@@ -163,7 +163,7 @@ RSpec.describe GitlabSchema.types['Vulnerability'] do
stub_feature_flags
(
vulnerability_flags:
false
)
stub_feature_flags
(
vulnerability_flags:
false
)
end
end
it
'retu
nr
s nil'
do
it
'retu
rn
s nil'
do
vulnerabilities
=
subject
.
dig
(
'data'
,
'project'
,
'vulnerabilities'
,
'nodes'
)
vulnerabilities
=
subject
.
dig
(
'data'
,
'project'
,
'vulnerabilities'
,
'nodes'
)
expect
(
vulnerabilities
.
first
[
'falsePositive'
]).
to
be_nil
expect
(
vulnerabilities
.
first
[
'falsePositive'
]).
to
be_nil
...
...
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