Commit c3091d4b authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch 'add_size_field_to_graphql' into 'master'

Add size field to SAST config graphql query

See merge request gitlab-org/gitlab!39736
parents 45929066 29327095
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
"type": "string", "type": "string",
"default_value": "", "default_value": "",
"value": "", "value": "",
"size": "MEDIUM",
"description": "Analyzer image's registry prefix (or Name of the registry providing the analyzers' image)" "description": "Analyzer image's registry prefix (or Name of the registry providing the analyzers' image)"
}, },
{ {
...@@ -14,6 +15,7 @@ ...@@ -14,6 +15,7 @@
"type": "string", "type": "string",
"default_value": "", "default_value": "",
"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." "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 @@ ...@@ -22,6 +24,7 @@
"type": "string", "type": "string",
"default_value": "", "default_value": "",
"value": "", "value": "",
"size": "SMALL",
"description": "Analyzer image's tag" "description": "Analyzer image's tag"
} }
], ],
...@@ -32,6 +35,7 @@ ...@@ -32,6 +35,7 @@
"type": "string", "type": "string",
"default_value": "", "default_value": "",
"value": "", "value": "",
"size": "MEDIUM",
"description": "Pipeline stage in which the scan jobs run" "description": "Pipeline stage in which the scan jobs run"
}, },
{ {
...@@ -40,6 +44,7 @@ ...@@ -40,6 +44,7 @@
"type": "string", "type": "string",
"default_value": "", "default_value": "",
"value": "", "value": "",
"size": "SMALL",
"description": "Maximum depth of language and framework detection" "description": "Maximum depth of language and framework detection"
} }
], ],
......
...@@ -13749,6 +13749,11 @@ type SastCiConfigurationEntity { ...@@ -13749,6 +13749,11 @@ type SastCiConfigurationEntity {
last: Int last: Int
): SastCiConfigurationOptionsEntityConnection ): SastCiConfigurationOptionsEntityConnection
"""
Size of the UI component.
"""
size: SastUiComponentSize
""" """
Type of the field value. Type of the field value.
""" """
...@@ -13845,6 +13850,15 @@ type SastCiConfigurationOptionsEntityEdge { ...@@ -13845,6 +13850,15 @@ type SastCiConfigurationOptionsEntityEdge {
node: SastCiConfigurationOptionsEntity node: SastCiConfigurationOptionsEntity
} }
"""
Size of UI component in SAST configuration page
"""
enum SastUiComponentSize {
LARGE
MEDIUM
SMALL
}
""" """
Represents a resource scanned by a security scan Represents a resource scanned by a security scan
""" """
......
...@@ -40151,6 +40151,20 @@ ...@@ -40151,6 +40151,20 @@
"isDeprecated": false, "isDeprecated": false,
"deprecationReason": null "deprecationReason": null
}, },
{
"name": "size",
"description": "Size of the UI component.",
"args": [
],
"type": {
"kind": "ENUM",
"name": "SastUiComponentSize",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{ {
"name": "type", "name": "type",
"description": "Type of the field value.", "description": "Type of the field value.",
...@@ -40452,6 +40466,35 @@ ...@@ -40452,6 +40466,35 @@
"enumValues": null, "enumValues": null,
"possibleTypes": 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", "kind": "OBJECT",
"name": "ScannedResource", "name": "ScannedResource",
...@@ -1948,6 +1948,7 @@ Represents an entity in SAST CI configuration ...@@ -1948,6 +1948,7 @@ Represents an entity in SAST CI configuration
| `description` | String | Entity description that is displayed on the form. | | `description` | String | Entity description that is displayed on the form. |
| `field` | String | CI keyword of entity. | | `field` | String | CI keyword of entity. |
| `label` | String | Label for entity used in the form. | | `label` | String | Label for entity used in the form. |
| `size` | SastUiComponentSize | Size of the UI component. |
| `type` | String | Type of the field value. | | `type` | String | Type of the field value. |
| `value` | String | Current value of the entity. | | `value` | String | Current value of the entity. |
......
...@@ -28,6 +28,9 @@ module Types ...@@ -28,6 +28,9 @@ module Types
field :value, GraphQL::STRING_TYPE, null: true, field :value, GraphQL::STRING_TYPE, null: true,
description: 'Current value of the entity.' description: 'Current value of the entity.'
field :size, ::Types::CiConfiguration::Sast::UiComponentSizeEnum, null: true,
description: 'Size of the UI component.'
end end
end end
end end
......
# 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
---
title: Add size field to graphql query to extract information about SAST Config UI
merge_request: 39736
author:
type: added
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe GitlabSchema.types['SastCiConfigurationEntity'] do 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') } it { expect(described_class.graphql_name).to eq('SastCiConfigurationEntity') }
......
# 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
...@@ -45,6 +45,7 @@ RSpec.describe GitlabSchema.types['Project'] do ...@@ -45,6 +45,7 @@ RSpec.describe GitlabSchema.types['Project'] do
label label
defaultValue defaultValue
value value
size
} }
} }
pipeline { pipeline {
...@@ -60,6 +61,7 @@ RSpec.describe GitlabSchema.types['Project'] do ...@@ -60,6 +61,7 @@ RSpec.describe GitlabSchema.types['Project'] do
label label
defaultValue defaultValue
value value
size
} }
} }
analyzers { analyzers {
...@@ -88,6 +90,7 @@ RSpec.describe GitlabSchema.types['Project'] do ...@@ -88,6 +90,7 @@ RSpec.describe GitlabSchema.types['Project'] do
expect(secure_analyzers_prefix['label']).to eq('Image prefix') 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['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['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 expect(secure_analyzers_prefix['options']).to be_nil
end end
...@@ -98,6 +101,7 @@ RSpec.describe GitlabSchema.types['Project'] do ...@@ -98,6 +101,7 @@ RSpec.describe GitlabSchema.types['Project'] do
expect(pipeline_stage['label']).to eq('Stage') expect(pipeline_stage['label']).to eq('Stage')
expect(pipeline_stage['defaultValue']).to eq('test') expect(pipeline_stage['defaultValue']).to eq('test')
expect(pipeline_stage['value']).to eq('test') expect(pipeline_stage['value']).to eq('test')
expect(pipeline_stage['size']).to eq('MEDIUM')
end end
it "returns the project's sast configuration for analyzer variables" do it "returns the project's sast configuration for analyzer variables" do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment