uffizzi_core 2.0.16 → 2.0.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/uffizzi_core/api/cli/v1/ci/sessions_controller.rb +1 -1
- data/app/services/uffizzi_core/compose_file/parsers/services/healthcheck_parser_service.rb +12 -1
- data/app/services/uffizzi_core/compose_file_service.rb +3 -2
- data/config/locales/en.yml +2 -1
- data/lib/uffizzi_core/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 27d02aca43ff2ab5f8b044c11ef8d93605d8bd599d9044fd60f61297b54bbae0
|
4
|
+
data.tar.gz: 9a4e89d809f96b3ab344c2ba427ebe46f0a61c07b90aef0b5031a4a1a60ab7f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '08eeba65a18db53c778c0ba1561ff08b586d7dcb5fe491617fa04faa299c7b9d1e7dd5ab58b250332dbc47922715d1a84c8f8ea05b18529bcc9ced5c9528ca13'
|
7
|
+
data.tar.gz: e67a50482809ae07adcdcc21546b700816a675115e970385772813bbbde93f93169fee5bd2f3f256b0b71bc41fe551883e9fb5c067d13018f56d7571e8622579
|
@@ -2,12 +2,19 @@
|
|
2
2
|
|
3
3
|
class UffizziCore::ComposeFile::Parsers::Services::HealthcheckParserService
|
4
4
|
REQUIRED_START_COMMANDS = ['NONE', 'CMD', 'CMD-SHELL'].freeze
|
5
|
+
REQUIRED_OPTIONS = ['test', 'disable'].freeze
|
5
6
|
|
6
7
|
class << self
|
7
8
|
def parse(healthcheck_data)
|
8
9
|
return {} if healthcheck_data.blank?
|
9
10
|
|
10
|
-
|
11
|
+
unless required_options_any?(healthcheck_data)
|
12
|
+
raise UffizziCore::ComposeFile::ParseError,
|
13
|
+
I18n.t('compose.healthcheck_missing_required_option',
|
14
|
+
required_options: REQUIRED_OPTIONS.join(', '))
|
15
|
+
end
|
16
|
+
|
17
|
+
command = parse_command(healthcheck_data) if healthcheck_data['test'].present?
|
11
18
|
|
12
19
|
{
|
13
20
|
test: command,
|
@@ -85,5 +92,9 @@ class UffizziCore::ComposeFile::Parsers::Services::HealthcheckParserService
|
|
85
92
|
|
86
93
|
raise UffizziCore::ComposeFile::ParseError, I18n.t('compose.invalid_bool_value', field: 'disable', value: value)
|
87
94
|
end
|
95
|
+
|
96
|
+
def required_options_any?(healthcheck_data)
|
97
|
+
(REQUIRED_OPTIONS & healthcheck_data.keys).present?
|
98
|
+
end
|
88
99
|
end
|
89
100
|
end
|
@@ -186,8 +186,9 @@ class UffizziCore::ComposeFileService
|
|
186
186
|
def load_compose_data(compose_content)
|
187
187
|
begin
|
188
188
|
compose_data = YAML.safe_load(compose_content, aliases: true)
|
189
|
-
rescue Psych::SyntaxError
|
190
|
-
|
189
|
+
rescue Psych::SyntaxError => e
|
190
|
+
err = [e.problem, e.context].compact.join(' ')
|
191
|
+
raise UffizziCore::ComposeFile::ParseError, I18n.t('compose.invalid_file', err: err, line: e.line, column: e.column)
|
191
192
|
end
|
192
193
|
raise UffizziCore::ComposeFile::ParseError, I18n.t('compose.unsupported_file') if compose_data.nil?
|
193
194
|
|
data/config/locales/en.yml
CHANGED
@@ -12,7 +12,7 @@ en:
|
|
12
12
|
Uffizzi was unable to deploy a preview of this pull request because the compose file in this branch is invalid.
|
13
13
|
compose:
|
14
14
|
unsupported_file: Unsupported compose file
|
15
|
-
invalid_file:
|
15
|
+
invalid_file: 'Syntax error: %{err} at line %{line} column %{column}'
|
16
16
|
invalid_config_option: Invalid config option '%{value}' - only a-zA-Z0-9._- characters are allowed
|
17
17
|
no_services: Service services has neither an image nor a build context specified. At least one must be provided.
|
18
18
|
no_ingress: Service ingress has not been defined.
|
@@ -69,6 +69,7 @@ en:
|
|
69
69
|
invalid_volume_destination: Invalid volume specification '%{spec}' destination can't be '/'
|
70
70
|
required_start_commands: "When 'test' is a list the first item must be one of: '%{available_commands}'"
|
71
71
|
volumes_should_be_array: Volumes '%{volumes}' should be an arra
|
72
|
+
healthcheck_missing_required_option: "One of these options is required: %{required_options}"
|
72
73
|
secrets:
|
73
74
|
duplicates_exists: Secret with key %{secrets} already exist.
|
74
75
|
invalid_key_length: A secret key must be no longer than 256 characters.
|
data/lib/uffizzi_core/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uffizzi_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Thurman
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-12-
|
12
|
+
date: 2022-12-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: aasm
|