Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-11-16 12:13:14 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-11-16 12:13:14 +0300
commit34a59635a9f25499193aa71a2cae3581f9892cbb (patch)
treef1c6ff54c44e22c81ce62984afa2d9f0f9cd5c32 /app
parent4b74e7efc0f9976cc0ecbab72a09fea8e3810608 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/editor/schema/ci.json24
-rw-r--r--app/validators/json_schema_validator.rb15
2 files changed, 3 insertions, 36 deletions
diff --git a/app/assets/javascripts/editor/schema/ci.json b/app/assets/javascripts/editor/schema/ci.json
index 2319ecccd5b..308a68544bc 100644
--- a/app/assets/javascripts/editor/schema/ci.json
+++ b/app/assets/javascripts/editor/schema/ci.json
@@ -509,18 +509,6 @@
"description": "Command or script that should be executed as the container's entrypoint. It will be translated to Docker's --entrypoint option while creating the container. The syntax is similar to Dockerfile's ENTRYPOINT directive, where each shell token is a separate string in the array.",
"minItems": 1
},
- "docker": {
- "type": "object",
- "description": "Options to pass to Runners Docker Executor",
- "additionalProperties": false,
- "properties": {
- "platform": {
- "type": "string",
- "minLength": 1,
- "description": "Image architecture to pull."
- }
- }
- },
"pull_policy": {
"markdownDescription": "Specifies how to pull the image in Runner. It can be one of `always`, `never` or `if-not-present`. The default value is `always`. [Learn more](https://docs.gitlab.com/ee/ci/yaml/#imagepull_policy).",
"default": "always",
@@ -591,18 +579,6 @@
"type": "string"
}
},
- "docker": {
- "type": "object",
- "description": "Options to pass to Runners Docker Executor",
- "additionalProperties": false,
- "properties": {
- "platform": {
- "type": "string",
- "minLength": 1,
- "description": "Image architecture to pull."
- }
- }
- },
"pull_policy": {
"markdownDescription": "Specifies how to pull the image in Runner. It can be one of `always`, `never` or `if-not-present`. The default value is `always`. [Learn more](https://docs.gitlab.com/ee/ci/yaml/#servicepull_policy).",
"default": "always",
diff --git a/app/validators/json_schema_validator.rb b/app/validators/json_schema_validator.rb
index b6b21f13546..2ef011df73e 100644
--- a/app/validators/json_schema_validator.rb
+++ b/app/validators/json_schema_validator.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-
#
# JsonSchemaValidator
#
@@ -25,19 +24,11 @@ class JsonSchemaValidator < ActiveModel::EachValidator
end
def validate_each(record, attribute, value)
- value = value.to_h.deep_stringify_keys if options[:hash_conversion] == true
+ value = value.to_h.stringify_keys if options[:hash_conversion] == true
value = Gitlab::Json.parse(value.to_s) if options[:parse_json] == true && !value.nil?
- if options[:detail_errors]
- validator.validate(value).each do |error|
- message = format(
- _("the '%{data_pointer}' must be a valid '%{type}'"),
- data_pointer: error['data_pointer'], type: error['type']
- )
- record.errors.add(attribute, message)
- end
- else
- record.errors.add(attribute, _("must be a valid json schema")) unless valid_schema?(value)
+ unless valid_schema?(value)
+ record.errors.add(attribute, _("must be a valid json schema"))
end
end