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
29327095
Commit
29327095
authored
Aug 19, 2020
by
Saikat Sarkar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add size field to SAST config graphql query
parent
bbd825bd
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
103 additions
and
1 deletion
+103
-1
app/validators/json_schemas/security_ci_configuration_schemas/sast_ui_schema.json
...mas/security_ci_configuration_schemas/sast_ui_schema.json
+5
-0
doc/api/graphql/reference/gitlab_schema.graphql
doc/api/graphql/reference/gitlab_schema.graphql
+14
-0
doc/api/graphql/reference/gitlab_schema.json
doc/api/graphql/reference/gitlab_schema.json
+43
-0
doc/api/graphql/reference/index.md
doc/api/graphql/reference/index.md
+1
-0
ee/app/graphql/types/ci_configuration/sast/entity_type.rb
ee/app/graphql/types/ci_configuration/sast/entity_type.rb
+3
-0
ee/app/graphql/types/ci_configuration/sast/ui_component_size_enum.rb
...hql/types/ci_configuration/sast/ui_component_size_enum.rb
+16
-0
ee/changelogs/unreleased/add_size_field_to_graphql.yml
ee/changelogs/unreleased/add_size_field_to_graphql.yml
+5
-0
ee/spec/graphql/types/ci_configuration/sast/entity_type_spec.rb
...c/graphql/types/ci_configuration/sast/entity_type_spec.rb
+1
-1
ee/spec/graphql/types/ci_configuration/sast/ui_component_size_enum_spec.rb
...ypes/ci_configuration/sast/ui_component_size_enum_spec.rb
+11
-0
ee/spec/graphql/types/project_type_spec.rb
ee/spec/graphql/types/project_type_spec.rb
+4
-0
No files found.
app/validators/json_schemas/security_ci_configuration_schemas/sast_ui_schema.json
View file @
29327095
...
...
@@ -6,6 +6,7 @@
"type"
:
"string"
,
"default_value"
:
""
,
"value"
:
""
,
"size"
:
"MEDIUM"
,
"description"
:
"Analyzer image's registry prefix (or Name of the registry providing the analyzers' image)"
},
{
...
...
@@ -14,6 +15,7 @@
"type"
:
"string"
,
"default_value"
:
""
,
"value"
:
""
,
"size"
:
"LARGE"
,
"description"
:
"Comma-separated list of paths to be excluded from analyzer output. Patterns can be globs, file paths, or folder paths."
},
{
...
...
@@ -22,6 +24,7 @@
"type"
:
"string"
,
"default_value"
:
""
,
"value"
:
""
,
"size"
:
"SMALL"
,
"description"
:
"Analyzer image's tag"
}
],
...
...
@@ -32,6 +35,7 @@
"type"
:
"string"
,
"default_value"
:
""
,
"value"
:
""
,
"size"
:
"MEDIUM"
,
"description"
:
"Pipeline stage in which the scan jobs run"
},
{
...
...
@@ -40,6 +44,7 @@
"type"
:
"string"
,
"default_value"
:
""
,
"value"
:
""
,
"size"
:
"SMALL"
,
"description"
:
"Maximum depth of language and framework detection"
}
],
...
...
doc/api/graphql/reference/gitlab_schema.graphql
View file @
29327095
...
...
@@ -13749,6 +13749,11 @@ type SastCiConfigurationEntity {
last
:
Int
):
SastCiConfigurationOptionsEntityConnection
"""
Size
of
the
UI
component
.
"""
size
:
SastUiComponentSize
"""
Type
of
the
field
value
.
"""
...
...
@@ -13845,6 +13850,15 @@ type SastCiConfigurationOptionsEntityEdge {
node
:
SastCiConfigurationOptionsEntity
}
"""
Size of UI component in SAST configuration page
"""
enum
SastUiComponentSize
{
LARGE
MEDIUM
SMALL
}
"""
Represents a resource scanned by a security scan
"""
...
...
doc/api/graphql/reference/gitlab_schema.json
View file @
29327095
...
...
@@ -40151,6 +40151,20 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "size",
"description": "Size of the UI component.",
"args": [
],
"type": {
"kind": "ENUM",
"name": "SastUiComponentSize",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "type",
"description": "Type of the field value.",
...
...
@@ -40452,6 +40466,35 @@
"enumValues": null,
"possibleTypes": null
},
{
"kind": "ENUM",
"name": "SastUiComponentSize",
"description": "Size of UI component in SAST configuration page",
"fields": null,
"inputFields": null,
"interfaces": null,
"enumValues": [
{
"name": "SMALL",
"description": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "MEDIUM",
"description": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "LARGE",
"description": null,
"isDeprecated": false,
"deprecationReason": null
}
],
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "ScannedResource",
doc/api/graphql/reference/index.md
View file @
29327095
...
...
@@ -1948,6 +1948,7 @@ Represents an entity in SAST CI configuration
|
`description`
| String | Entity description that is displayed on the form. |
|
`field`
| String | CI keyword of entity. |
|
`label`
| String | Label for entity used in the form. |
|
`size`
| SastUiComponentSize | Size of the UI component. |
|
`type`
| String | Type of the field value. |
|
`value`
| String | Current value of the entity. |
...
...
ee/app/graphql/types/ci_configuration/sast/entity_type.rb
View file @
29327095
...
...
@@ -28,6 +28,9 @@ module Types
field
:value
,
GraphQL
::
STRING_TYPE
,
null:
true
,
description:
'Current value of the entity.'
field
:size
,
::
Types
::
CiConfiguration
::
Sast
::
UiComponentSizeEnum
,
null:
true
,
description:
'Size of the UI component.'
end
end
end
...
...
ee/app/graphql/types/ci_configuration/sast/ui_component_size_enum.rb
0 → 100644
View file @
29327095
# frozen_string_literal: true
module
Types
module
CiConfiguration
module
Sast
class
UiComponentSizeEnum
<
BaseEnum
graphql_name
'SastUiComponentSize'
description
'Size of UI component in SAST configuration page'
value
'SMALL'
value
'MEDIUM'
value
'LARGE'
end
end
end
end
ee/changelogs/unreleased/add_size_field_to_graphql.yml
0 → 100644
View file @
29327095
---
title
:
Add size field to graphql query to extract information about SAST Config UI
merge_request
:
39736
author
:
type
:
added
ee/spec/graphql/types/ci_configuration/sast/entity_type_spec.rb
View file @
29327095
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
RSpec
.
describe
GitlabSchema
.
types
[
'SastCiConfigurationEntity'
]
do
let
(
:fields
)
{
%i[field label description type options default_value value]
}
let
(
:fields
)
{
%i[field label description type options default_value value
size
]
}
it
{
expect
(
described_class
.
graphql_name
).
to
eq
(
'SastCiConfigurationEntity'
)
}
...
...
ee/spec/graphql/types/ci_configuration/sast/ui_component_size_enum_spec.rb
0 → 100644
View file @
29327095
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
Types
::
CiConfiguration
::
Sast
::
UiComponentSizeEnum
do
specify
{
expect
(
described_class
.
graphql_name
).
to
eq
(
'SastUiComponentSize'
)
}
it
'exposes all sizes of ui components'
do
expect
(
described_class
.
values
.
keys
).
to
include
(
*
%w[SMALL MEDIUM LARGE]
)
end
end
ee/spec/graphql/types/project_type_spec.rb
View file @
29327095
...
...
@@ -45,6 +45,7 @@ RSpec.describe GitlabSchema.types['Project'] do
label
defaultValue
value
size
}
}
pipeline {
...
...
@@ -60,6 +61,7 @@ RSpec.describe GitlabSchema.types['Project'] do
label
defaultValue
value
size
}
}
analyzers {
...
...
@@ -88,6 +90,7 @@ RSpec.describe GitlabSchema.types['Project'] do
expect
(
secure_analyzers_prefix
[
'label'
]).
to
eq
(
'Image prefix'
)
expect
(
secure_analyzers_prefix
[
'defaultValue'
]).
to
eq
(
'registry.gitlab.com/gitlab-org/security-products/analyzers'
)
expect
(
secure_analyzers_prefix
[
'value'
]).
to
eq
(
'registry.gitlab.com/gitlab-org/security-products/analyzers'
)
expect
(
secure_analyzers_prefix
[
'size'
]).
to
eq
(
'MEDIUM'
)
expect
(
secure_analyzers_prefix
[
'options'
]).
to
be_nil
end
...
...
@@ -98,6 +101,7 @@ RSpec.describe GitlabSchema.types['Project'] do
expect
(
pipeline_stage
[
'label'
]).
to
eq
(
'Stage'
)
expect
(
pipeline_stage
[
'defaultValue'
]).
to
eq
(
'test'
)
expect
(
pipeline_stage
[
'value'
]).
to
eq
(
'test'
)
expect
(
pipeline_stage
[
'size'
]).
to
eq
(
'MEDIUM'
)
end
it
"returns the project's sast configuration for analyzer variables"
do
...
...
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