summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-08-18 09:10:05 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-08-18 09:10:05 +0000
commit89eff770d213e684b5fa4df121cb51a059e8d263 (patch)
treef2783e2aaf50ebba6051f11335a45029b8549d34 /app
parent681ca59b6f81a3a0057e3d528c27bcf96c2edd1b (diff)
downloadgitlab-ce-89eff770d213e684b5fa4df121cb51a059e8d263.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/monitoring/components/charts/time_series.vue3
-rw-r--r--app/graphql/resolvers/ci_configuration/sast_resolver.rb17
-rw-r--r--app/graphql/resolvers/project_pipeline_resolver.rb2
-rw-r--r--app/graphql/types/ci/pipeline_config_source_enum.rb11
-rw-r--r--app/graphql/types/ci/pipeline_type.rb2
-rw-r--r--app/graphql/types/ci_configuration/sast/analyzers_entity_type.rb25
-rw-r--r--app/graphql/types/ci_configuration/sast/entity_type.rb34
-rw-r--r--app/graphql/types/ci_configuration/sast/options_entity_type.rb19
-rw-r--r--app/graphql/types/ci_configuration/sast/type.rb22
-rw-r--r--app/graphql/types/project_type.rb4
-rw-r--r--app/validators/json_schemas/security_ci_configuration_schemas/sast_ui_schema.json76
11 files changed, 33 insertions, 182 deletions
diff --git a/app/assets/javascripts/monitoring/components/charts/time_series.vue b/app/assets/javascripts/monitoring/components/charts/time_series.vue
index e7cd612409f..054111c203e 100644
--- a/app/assets/javascripts/monitoring/components/charts/time_series.vue
+++ b/app/assets/javascripts/monitoring/components/charts/time_series.vue
@@ -1,6 +1,6 @@
<script>
import { isEmpty, omit, throttle } from 'lodash';
-import { GlLink, GlDeprecatedButton, GlTooltip, GlResizeObserverDirective } from '@gitlab/ui';
+import { GlLink, GlTooltip, GlResizeObserverDirective } from '@gitlab/ui';
import { GlAreaChart, GlLineChart, GlChartSeriesLabel } from '@gitlab/ui/dist/charts';
import { s__ } from '~/locale';
import { getSvgIconPathContent } from '~/lib/utils/icon_utils';
@@ -25,7 +25,6 @@ export default {
GlAreaChart,
GlLineChart,
GlTooltip,
- GlDeprecatedButton,
GlChartSeriesLabel,
GlLink,
Icon,
diff --git a/app/graphql/resolvers/ci_configuration/sast_resolver.rb b/app/graphql/resolvers/ci_configuration/sast_resolver.rb
deleted file mode 100644
index e8c42076ea2..00000000000
--- a/app/graphql/resolvers/ci_configuration/sast_resolver.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-require "json"
-
-module Resolvers
- module CiConfiguration
- class SastResolver < BaseResolver
- SAST_UI_SCHEMA_PATH = 'app/validators/json_schemas/security_ci_configuration_schemas/sast_ui_schema.json'
-
- type ::Types::CiConfiguration::Sast::Type, null: true
-
- def resolve(**args)
- Gitlab::Json.parse(File.read(Rails.root.join(SAST_UI_SCHEMA_PATH)))
- end
- end
- end
-end
diff --git a/app/graphql/resolvers/project_pipeline_resolver.rb b/app/graphql/resolvers/project_pipeline_resolver.rb
index 5bafe3dd140..181c1e77109 100644
--- a/app/graphql/resolvers/project_pipeline_resolver.rb
+++ b/app/graphql/resolvers/project_pipeline_resolver.rb
@@ -10,7 +10,7 @@ module Resolvers
def resolve(iid:)
BatchLoader::GraphQL.for(iid).batch(key: project) do |iids, loader, args|
- args[:key].ci_pipelines.for_iid(iids).each { |pl| loader.call(pl.iid.to_s, pl) }
+ args[:key].all_pipelines.for_iid(iids).each { |pl| loader.call(pl.iid.to_s, pl) }
end
end
end
diff --git a/app/graphql/types/ci/pipeline_config_source_enum.rb b/app/graphql/types/ci/pipeline_config_source_enum.rb
new file mode 100644
index 00000000000..48f88c133b4
--- /dev/null
+++ b/app/graphql/types/ci/pipeline_config_source_enum.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+module Types
+ module Ci
+ class PipelineConfigSourceEnum < BaseEnum
+ ::Ci::PipelineEnums.config_sources.keys.each do |state_symbol|
+ value state_symbol.to_s.upcase, value: state_symbol.to_s
+ end
+ end
+ end
+end
diff --git a/app/graphql/types/ci/pipeline_type.rb b/app/graphql/types/ci/pipeline_type.rb
index caa7079e2c6..c9cbae2d828 100644
--- a/app/graphql/types/ci/pipeline_type.rb
+++ b/app/graphql/types/ci/pipeline_type.rb
@@ -25,6 +25,8 @@ module Types
field :detailed_status, Types::Ci::DetailedStatusType, null: false,
description: 'Detailed status of the pipeline',
resolve: -> (obj, _args, ctx) { obj.detailed_status(ctx[:current_user]) }
+ field :config_source, PipelineConfigSourceEnum, null: true,
+ description: "Config source of the pipeline (#{::Ci::PipelineEnums.config_sources.keys.join(', ').upcase})"
field :duration, GraphQL::INT_TYPE, null: true,
description: 'Duration of the pipeline in seconds'
field :coverage, GraphQL::FLOAT_TYPE, null: true,
diff --git a/app/graphql/types/ci_configuration/sast/analyzers_entity_type.rb b/app/graphql/types/ci_configuration/sast/analyzers_entity_type.rb
deleted file mode 100644
index ccd1c7dd0eb..00000000000
--- a/app/graphql/types/ci_configuration/sast/analyzers_entity_type.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-# frozen_string_literal: true
-
-module Types
- module CiConfiguration
- module Sast
- # rubocop: disable Graphql/AuthorizeTypes
- class AnalyzersEntityType < BaseObject
- graphql_name 'SastCiConfigurationAnalyzersEntity'
- description 'Represents an analyzer entity in SAST CI configuration'
-
- field :name, GraphQL::STRING_TYPE, null: true,
- description: 'Name of the analyzer.'
-
- field :label, GraphQL::STRING_TYPE, null: true,
- description: 'Analyzer label used in the config UI.'
-
- field :enabled, GraphQL::BOOLEAN_TYPE, null: true,
- description: 'Indicates whether an analyzer is enabled.'
-
- field :description, GraphQL::STRING_TYPE, null: true,
- description: 'Analyzer description that is displayed on the form.'
- end
- end
- end
-end
diff --git a/app/graphql/types/ci_configuration/sast/entity_type.rb b/app/graphql/types/ci_configuration/sast/entity_type.rb
deleted file mode 100644
index b61b582ad20..00000000000
--- a/app/graphql/types/ci_configuration/sast/entity_type.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-# frozen_string_literal: true
-
-module Types
- module CiConfiguration
- module Sast
- # rubocop: disable Graphql/AuthorizeTypes
- class EntityType < BaseObject
- graphql_name 'SastCiConfigurationEntity'
- description 'Represents an entity in SAST CI configuration'
-
- field :field, GraphQL::STRING_TYPE, null: true,
- description: 'CI keyword of entity.'
-
- field :label, GraphQL::STRING_TYPE, null: true,
- description: 'Label for entity used in the form.'
-
- field :type, GraphQL::STRING_TYPE, null: true,
- description: 'Type of the field value.'
-
- field :options, ::Types::CiConfiguration::Sast::OptionsEntityType.connection_type, null: true,
- description: 'Different possible values of the field.'
-
- field :default_value, GraphQL::STRING_TYPE, null: true,
- description: 'Default value that is used if value is empty.'
-
- field :description, GraphQL::STRING_TYPE, null: true,
- description: 'Entity description that is displayed on the form.'
-
- field :value, GraphQL::STRING_TYPE, null: true,
- description: 'Current value of the entity.'
- end
- end
- end
-end
diff --git a/app/graphql/types/ci_configuration/sast/options_entity_type.rb b/app/graphql/types/ci_configuration/sast/options_entity_type.rb
deleted file mode 100644
index 86d104a7fda..00000000000
--- a/app/graphql/types/ci_configuration/sast/options_entity_type.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-module Types
- module CiConfiguration
- module Sast
- # rubocop: disable Graphql/AuthorizeTypes
- class OptionsEntityType < BaseObject
- graphql_name 'SastCiConfigurationOptionsEntity'
- description 'Represents an entity for options in SAST CI configuration'
-
- field :label, GraphQL::STRING_TYPE, null: true,
- description: 'Label of option entity.'
-
- field :value, GraphQL::STRING_TYPE, null: true,
- description: 'Value of option entity.'
- end
- end
- end
-end
diff --git a/app/graphql/types/ci_configuration/sast/type.rb b/app/graphql/types/ci_configuration/sast/type.rb
deleted file mode 100644
index 35d11584ac7..00000000000
--- a/app/graphql/types/ci_configuration/sast/type.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# frozen_string_literal: true
-
-module Types
- module CiConfiguration
- module Sast
- # rubocop: disable Graphql/AuthorizeTypes
- class Type < BaseObject
- graphql_name 'SastCiConfiguration'
- description 'Represents a CI configuration of SAST'
-
- field :global, ::Types::CiConfiguration::Sast::EntityType.connection_type, null: true,
- description: 'List of global entities related to SAST configuration.'
-
- field :pipeline, ::Types::CiConfiguration::Sast::EntityType.connection_type, null: true,
- description: 'List of pipeline entities related to SAST configuration.'
-
- field :analyzers, ::Types::CiConfiguration::Sast::AnalyzersEntityType.connection_type, null: true,
- description: 'List of analyzers entities attached to SAST configuration.'
- end
- end
- end
-end
diff --git a/app/graphql/types/project_type.rb b/app/graphql/types/project_type.rb
index 523e019b955..5562db69de6 100644
--- a/app/graphql/types/project_type.rb
+++ b/app/graphql/types/project_type.rb
@@ -175,10 +175,6 @@ module Types
description: 'A single environment of the project',
resolver: Resolvers::EnvironmentsResolver.single
- field :sast_ci_configuration, ::Types::CiConfiguration::Sast::Type, null: true,
- description: 'SAST CI configuration for the project',
- resolver: ::Resolvers::CiConfiguration::SastResolver
-
field :issue,
Types::IssueType,
null: true,
diff --git a/app/validators/json_schemas/security_ci_configuration_schemas/sast_ui_schema.json b/app/validators/json_schemas/security_ci_configuration_schemas/sast_ui_schema.json
index cce2b28529f..aa4dd60a9fb 100644
--- a/app/validators/json_schemas/security_ci_configuration_schemas/sast_ui_schema.json
+++ b/app/validators/json_schemas/security_ci_configuration_schemas/sast_ui_schema.json
@@ -4,83 +4,43 @@
"field" : "SECURE_ANALYZERS_PREFIX",
"label" : "Image prefix",
"type": "string",
- "default_value": "registry.gitlab.com/gitlab-org/security-products/analyzers",
- "value": ""
+ "default_value": "",
+ "value": "",
+ "description": "Analyzer image's registry prefix (or Name of the registry providing the analyzers' image)"
},
{
"field" : "SAST_EXCLUDED_PATHS",
"label" : "Excluded Paths",
"type": "string",
- "default_value": "spec, test, tests, tmp",
- "value": ""
+ "default_value": "",
+ "value": "",
+ "description": "Comma-separated list of paths to be excluded from analyzer output. Patterns can be globs, file paths, or folder paths."
},
{
"field" : "SAST_ANALYZER_IMAGE_TAG",
"label" : "Image tag",
"type": "string",
- "options": [],
- "default_value": "2",
- "value": ""
- },
- {
- "field" : "SAST_DISABLED",
- "label" : "Disable SAST",
- "type": "options",
- "options": [
- {
- "value" :"true",
- "label" : "true (disables SAST)"
- },
- {
- "value":"false",
- "label":"false (enables SAST)"
- }
- ],
- "default_value": "false",
- "value": ""
+ "default_value": "",
+ "value": "",
+ "description": "Analyzer image's tag"
}
],
"pipeline": [
{
"field" : "stage",
"label" : "Stage",
- "type": "dropdown",
- "options": [
- {
- "value" :"test",
- "label" : "test"
- },
- {
- "value":"build",
- "label":"build"
- }
- ],
- "default_value": "test",
- "value": ""
- },
- {
- "field" : "allow_failure",
- "label" : "Allow Failure",
- "type": "options",
- "options": [
- {
- "value" :"true",
- "label" : "Allows pipeline failure"
- },
- {
- "value": "false",
- "label": "Does not allow pipeline failure"
- }
- ],
- "default_value": "true",
- "value": ""
+ "type": "string",
+ "default_value": "",
+ "value": "",
+ "description": "Pipeline stage in which the scan jobs run"
},
{
- "field" : "rules",
- "label" : "Rules",
- "type": "multiline",
+ "field" : "SEARCH_MAX_DEPTH",
+ "label" : "Search maximum depth",
+ "type": "string",
"default_value": "",
- "value": ""
+ "value": "",
+ "description": "Maximum depth of language and framework detection"
}
],
"analyzers": [