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 @@
"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"
}
],
......
......@@ -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
"""
......
......@@ -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",
......@@ -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. |
......
......@@ -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
......
# 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 @@
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') }
......
# 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
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
......
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