From 34a59635a9f25499193aa71a2cae3581f9892cbb Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 16 Nov 2023 09:13:14 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- app/assets/javascripts/editor/schema/ci.json | 24 ------------------------ app/validators/json_schema_validator.rb | 15 +++------------ 2 files changed, 3 insertions(+), 36 deletions(-) (limited to 'app') 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 -- cgit v1.2.3