Follow-up from "Disallow usage of mountSources and sourceMapping in devfile"
The following discussion from !199305 (merged) should be addressed:
This issue is set to address the cyclomatic complexity cop warning.
-
@cwoolley-gitlab started a discussion: (+2 comments)
@onasser I finally got around to looking at this one. Sorry for the delay.
The catch here is that we need to handle the validation a little differently than we have done in the past.
We need to make it conditional on whether we have already "flattened" the devfile (i.e. sent it through the devfile gem / cli to be processed).
This is because the gem adds the
mountSourcesentry with the default value.So, in order to "disallow" it, we can only do that check BEFORE the flattening.
The crux of the change is to add a
is_processed_devfileflag to know which case we are in:context = { # NOTE: `processed_devfile` is not available in the context until the devfile has been flattened. # If the devfile is flattened, use `processed_devfile`. Else, use `devfile`. devfile: parent_context[:processed_devfile] || parent_context[:devfile], is_processed_devfile: parent_context[:processed_devfile].present?, errors: [] }...and then use it:
if container[:mountSources] && !is_processed_devfile append_err(format(_("Property 'mountSources' of component '%{component}' is not yet supported"), component: component_name), context) endOnce we do that conditional checking, then everything seems to work fine.
Specifically, you don't need to do anythiing extra to put new default values in
flattener.rb, or change any of the existing fixture files.All you need to do is put the new conditional logic in
restrictions_enforcer.rb, and update the spec accordingly to represent the two cases (before and after flattening).I've attached a patch with these changes.
NOTE: I had to do an ignore for a cyclomatic complexity cop warning. You can leave that in, or if you want you can refactor the method to extract out some of the logic to helper methods, which will fix the warning. It basically means you have too many conditionals in a single method
patch
Index: ee/spec/fixtures/remote_development/example.processed-devfile.yaml.erb IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/ee/spec/fixtures/remote_development/example.processed-devfile.yaml.erb b/ee/spec/fixtures/remote_development/example.processed-devfile.yaml.erb --- a/ee/spec/fixtures/remote_development/example.processed-devfile.yaml.erb (revision 4e14284777ffd23e19341b4354ff6b3f397e5164) +++ b/ee/spec/fixtures/remote_development/example.processed-devfile.yaml.erb (date 1756334985736) @@ -39,7 +39,7 @@ exposure: internal secure: true dedicatedPod: false - mountSources: false + mountSources: true - name: database-container attributes: overrideCommand: false @@ -52,7 +52,7 @@ - name: MYSQL_ROOT_PASSWORD value: "my-secret-pw" dedicatedPod: false - mountSources: false + mountSources: true - name: user-defined-entrypoint-cmd-component attributes: overrideCommand: false @@ -64,7 +64,7 @@ command: ["echo"] args: ["-n", "user-defined entrypoint command"] dedicatedPod: false - mountSources: false + mountSources: true - name: gl-tools-injector attributes: overrideCommand: false Index: ee/spec/lib/remote_development/workspace_operations/create/desired_config/main_integeration_spec.rb IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/ee/spec/lib/remote_development/workspace_operations/create/desired_config/main_integeration_spec.rb b/ee/spec/lib/remote_development/workspace_operations/create/desired_config/main_integeration_spec.rb --- a/ee/spec/lib/remote_development/workspace_operations/create/desired_config/main_integeration_spec.rb (revision 4e14284777ffd23e19341b4354ff6b3f397e5164) +++ b/ee/spec/lib/remote_development/workspace_operations/create/desired_config/main_integeration_spec.rb (date 1756334015957) @@ -234,7 +234,7 @@ secure: true protocol: https dedicatedPod: false - mountSources: false + mountSources: true - name: sidecar-container container: image: "sidecar-container:latest" @@ -309,7 +309,7 @@ secure: true protocol: https dedicatedPod: false - mountSources: false + mountSources: true - name: sidecar-container container: image: "sidecar-container:latest" @@ -383,7 +383,7 @@ secure: true protocol: https dedicatedPod: false - mountSources: false + mountSources: true - name: gl-project-cloner container: image: alpine/git:2.45.2 Index: ee/lib/remote_development/devfile_operations/restrictions_enforcer.rb IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/ee/lib/remote_development/devfile_operations/restrictions_enforcer.rb b/ee/lib/remote_development/devfile_operations/restrictions_enforcer.rb --- a/ee/lib/remote_development/devfile_operations/restrictions_enforcer.rb (revision 4e14284777ffd23e19341b4354ff6b3f397e5164) +++ b/ee/lib/remote_development/devfile_operations/restrictions_enforcer.rb (date 1756336188963) @@ -37,6 +37,7 @@ # NOTE: `processed_devfile` is not available in the context until the devfile has been flattened. # If the devfile is flattened, use `processed_devfile`. Else, use `devfile`. devfile: parent_context[:processed_devfile] || parent_context[:devfile], + is_processed_devfile: parent_context[:processed_devfile].present?, errors: [] } @@ -206,8 +207,12 @@ # @param [Hash] context # @return [Hash] + # rubocop:disable Metrics/CyclomaticComplexity -- TODO: Refactor this method to reduce its complexity, extract out some helper methods. def self.validate_containers(context) - context => { devfile: Hash => devfile } + context => { + devfile: Hash => devfile, + is_processed_devfile: is_processed_devfile + } components = devfile.fetch(:components, []) @@ -237,7 +242,7 @@ component: component_name), context) end - if container[:mountSources] + if container[:mountSources] && !is_processed_devfile append_err(format(_("Property 'mountSources' of component '%{component}' is not yet supported"), component: component_name), context) end @@ -273,6 +278,7 @@ context end + # rubocop:enable Metrics/CyclomaticComplexity # @param [Hash] context # @return [Hash] Index: ee/spec/fixtures/remote_development/example.container-commands-updated-devfile.yaml.erb IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/ee/spec/fixtures/remote_development/example.container-commands-updated-devfile.yaml.erb b/ee/spec/fixtures/remote_development/example.container-commands-updated-devfile.yaml.erb --- a/ee/spec/fixtures/remote_development/example.container-commands-updated-devfile.yaml.erb (revision 4e14284777ffd23e19341b4354ff6b3f397e5164) +++ b/ee/spec/fixtures/remote_development/example.container-commands-updated-devfile.yaml.erb (date 1756334860299) @@ -36,7 +36,7 @@ exposure: internal secure: true dedicatedPod: false - mountSources: false + mountSources: true - name: database-container attributes: overrideCommand: false @@ -46,7 +46,7 @@ - name: MYSQL_ROOT_PASSWORD value: "my-secret-pw" dedicatedPod: false - mountSources: false + mountSources: true - name: user-defined-entrypoint-cmd-component attributes: overrideCommand: false @@ -55,7 +55,7 @@ command: ["echo"] args: ["-n", "user-defined entrypoint command"] dedicatedPod: false - mountSources: false + mountSources: true - name: gl-tools-injector attributes: overrideCommand: false Index: ee/spec/fixtures/remote_development/example.legacy-poststart-in-container-command-processed-devfile.yaml.erb IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/ee/spec/fixtures/remote_development/example.legacy-poststart-in-container-command-processed-devfile.yaml.erb b/ee/spec/fixtures/remote_development/example.legacy-poststart-in-container-command-processed-devfile.yaml.erb --- a/ee/spec/fixtures/remote_development/example.legacy-poststart-in-container-command-processed-devfile.yaml.erb (revision 4e14284777ffd23e19341b4354ff6b3f397e5164) +++ b/ee/spec/fixtures/remote_development/example.legacy-poststart-in-container-command-processed-devfile.yaml.erb (date 1756334985727) @@ -38,7 +38,7 @@ exposure: internal secure: true dedicatedPod: false - mountSources: false + mountSources: true - name: database-container container: image: mysql @@ -49,7 +49,7 @@ - name: MYSQL_ROOT_PASSWORD value: "my-secret-pw" dedicatedPod: false - mountSources: false + mountSources: true - name: user-defined-entrypoint-cmd-component attributes: overrideCommand: false @@ -61,7 +61,7 @@ - name: gl-workspace-data path: /projects dedicatedPod: false - mountSources: false + mountSources: true - name: gl-tools-injector container: image: <%= WORKSPACE_TOOLS_IMAGE %> Index: ee/spec/fixtures/remote_development/example.tools-injector-inserted-devfile.yaml.erb IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/ee/spec/fixtures/remote_development/example.tools-injector-inserted-devfile.yaml.erb b/ee/spec/fixtures/remote_development/example.tools-injector-inserted-devfile.yaml.erb --- a/ee/spec/fixtures/remote_development/example.tools-injector-inserted-devfile.yaml.erb (revision 4e14284777ffd23e19341b4354ff6b3f397e5164) +++ b/ee/spec/fixtures/remote_development/example.tools-injector-inserted-devfile.yaml.erb (date 1756334985732) @@ -8,7 +8,7 @@ container: image: quay.io/mloriedo/universal-developer-image:ubi8-dw-demo dedicatedPod: false - mountSources: false + mountSources: true - name: database-container container: image: mysql @@ -16,7 +16,7 @@ - name: MYSQL_ROOT_PASSWORD value: "my-secret-pw" dedicatedPod: false - mountSources: false + mountSources: true - name: user-defined-entrypoint-cmd-component attributes: overrideCommand: false @@ -25,7 +25,7 @@ command: ["echo"] args: ["-n", "user-defined entrypoint command"] dedicatedPod: false - mountSources: false + mountSources: true - name: gl-tools-injector container: image: <%= WORKSPACE_TOOLS_IMAGE %> Index: ee/spec/fixtures/remote_development/example.flattened-devfile.yaml.erb IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/ee/spec/fixtures/remote_development/example.flattened-devfile.yaml.erb b/ee/spec/fixtures/remote_development/example.flattened-devfile.yaml.erb --- a/ee/spec/fixtures/remote_development/example.flattened-devfile.yaml.erb (revision 4e14284777ffd23e19341b4354ff6b3f397e5164) +++ b/ee/spec/fixtures/remote_development/example.flattened-devfile.yaml.erb (date 1756334860295) @@ -7,12 +7,12 @@ gl/inject-editor: true container: dedicatedPod: false - mountSources: false + mountSources: true image: quay.io/mloriedo/universal-developer-image:ubi8-dw-demo - name: database-container container: dedicatedPod: false - mountSources: false + mountSources: true image: mysql env: - name: MYSQL_ROOT_PASSWORD @@ -22,7 +22,7 @@ overrideCommand: false container: dedicatedPod: false - mountSources: false + mountSources: true image: quay.io/mloriedo/universal-developer-image:ubi8-dw-demo command: ["echo"] args: ["-n", "user-defined entrypoint command"] Index: ee/spec/fixtures/remote_development/example.main-container-updated-marketplace-disabled-devfile.yaml.erb IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/ee/spec/fixtures/remote_development/example.main-container-updated-marketplace-disabled-devfile.yaml.erb b/ee/spec/fixtures/remote_development/example.main-container-updated-marketplace-disabled-devfile.yaml.erb --- a/ee/spec/fixtures/remote_development/example.main-container-updated-marketplace-disabled-devfile.yaml.erb (revision 4e14284777ffd23e19341b4354ff6b3f397e5164) +++ b/ee/spec/fixtures/remote_development/example.main-container-updated-marketplace-disabled-devfile.yaml.erb (date 1756334985739) @@ -29,7 +29,7 @@ exposure: internal secure: true dedicatedPod: false - mountSources: false + mountSources: true - name: database-container container: image: mysql @@ -37,7 +37,7 @@ - name: MYSQL_ROOT_PASSWORD value: "my-secret-pw" dedicatedPod: false - mountSources: false + mountSources: true - name: user-defined-entrypoint-cmd-component attributes: overrideCommand: false @@ -46,7 +46,7 @@ command: ["echo"] args: ["-n", "user-defined entrypoint command"] dedicatedPod: false - mountSources: false + mountSources: true - name: gl-tools-injector container: image: <%= WORKSPACE_TOOLS_IMAGE %> Index: ee/spec/fixtures/remote_development/example.main-container-updated-devfile.yaml.erb IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/ee/spec/fixtures/remote_development/example.main-container-updated-devfile.yaml.erb b/ee/spec/fixtures/remote_development/example.main-container-updated-devfile.yaml.erb --- a/ee/spec/fixtures/remote_development/example.main-container-updated-devfile.yaml.erb (revision 4e14284777ffd23e19341b4354ff6b3f397e5164) +++ b/ee/spec/fixtures/remote_development/example.main-container-updated-devfile.yaml.erb (date 1756334985734) @@ -29,7 +29,7 @@ exposure: internal secure: true dedicatedPod: false - mountSources: false + mountSources: true - name: database-container container: image: mysql @@ -37,7 +37,7 @@ - name: MYSQL_ROOT_PASSWORD value: "my-secret-pw" dedicatedPod: false - mountSources: false + mountSources: true - name: user-defined-entrypoint-cmd-component attributes: overrideCommand: false @@ -46,7 +46,7 @@ command: ["echo"] args: ["-n", "user-defined entrypoint command"] dedicatedPod: false - mountSources: false + mountSources: true - name: gl-tools-injector container: image: <%= WORKSPACE_TOOLS_IMAGE %> Index: ee/spec/fixtures/remote_development/example.legacy-no-poststart-in-container-command-processed-devfile.yaml.erb IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/ee/spec/fixtures/remote_development/example.legacy-no-poststart-in-container-command-processed-devfile.yaml.erb b/ee/spec/fixtures/remote_development/example.legacy-no-poststart-in-container-command-processed-devfile.yaml.erb --- a/ee/spec/fixtures/remote_development/example.legacy-no-poststart-in-container-command-processed-devfile.yaml.erb (revision 4e14284777ffd23e19341b4354ff6b3f397e5164) +++ b/ee/spec/fixtures/remote_development/example.legacy-no-poststart-in-container-command-processed-devfile.yaml.erb (date 1756334889766) @@ -39,7 +39,7 @@ exposure: internal secure: true dedicatedPod: false - mountSources: false + mountSources: true - name: database-container container: image: mysql @@ -50,7 +50,7 @@ - name: MYSQL_ROOT_PASSWORD value: "my-secret-pw" dedicatedPod: false - mountSources: false + mountSources: true - name: user-defined-entrypoint-cmd-component attributes: overrideCommand: false @@ -62,7 +62,7 @@ - name: gl-workspace-data path: /projects dedicatedPod: false - mountSources: false + mountSources: true - name: gl-tools-injector container: image: <%= WORKSPACE_TOOLS_IMAGE %> Index: ee/spec/fixtures/remote_development/example.flattened-with-entries-devfile.yaml.erb IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/ee/spec/fixtures/remote_development/example.flattened-with-entries-devfile.yaml.erb b/ee/spec/fixtures/remote_development/example.flattened-with-entries-devfile.yaml.erb --- a/ee/spec/fixtures/remote_development/example.flattened-with-entries-devfile.yaml.erb (revision 4e14284777ffd23e19341b4354ff6b3f397e5164) +++ b/ee/spec/fixtures/remote_development/example.flattened-with-entries-devfile.yaml.erb (date 1756334860297) @@ -7,7 +7,7 @@ gl/inject-editor: true container: dedicatedPod: false - mountSources: false + mountSources: true image: quay.io/mloriedo/universal-developer-image:ubi8-dw-demo commands: - id: example Index: ee/spec/fixtures/remote_development/example.invalid-extra-field-devfile.yaml.erb IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/ee/spec/fixtures/remote_development/example.invalid-extra-field-devfile.yaml.erb b/ee/spec/fixtures/remote_development/example.invalid-extra-field-devfile.yaml.erb --- a/ee/spec/fixtures/remote_development/example.invalid-extra-field-devfile.yaml.erb (revision 4e14284777ffd23e19341b4354ff6b3f397e5164) +++ b/ee/spec/fixtures/remote_development/example.invalid-extra-field-devfile.yaml.erb (date 1756334889763) @@ -11,7 +11,7 @@ targetPort: 8080 image: quay.io/devfile/golang:latest memoryLimit: 1024Mi - mountSources: false + mountSources: true commands: [] events: {} variables: {} Index: ee/spec/fixtures/remote_development/example.internal-poststart-commands-inserted-devfile.yaml.erb IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/ee/spec/fixtures/remote_development/example.internal-poststart-commands-inserted-devfile.yaml.erb b/ee/spec/fixtures/remote_development/example.internal-poststart-commands-inserted-devfile.yaml.erb --- a/ee/spec/fixtures/remote_development/example.internal-poststart-commands-inserted-devfile.yaml.erb (revision 4e14284777ffd23e19341b4354ff6b3f397e5164) +++ b/ee/spec/fixtures/remote_development/example.internal-poststart-commands-inserted-devfile.yaml.erb (date 1756334889758) @@ -36,7 +36,7 @@ exposure: internal secure: true dedicatedPod: false - mountSources: false + mountSources: true - name: database-container attributes: overrideCommand: false @@ -46,7 +46,7 @@ - name: MYSQL_ROOT_PASSWORD value: "my-secret-pw" dedicatedPod: false - mountSources: false + mountSources: true - name: user-defined-entrypoint-cmd-component attributes: overrideCommand: false @@ -55,7 +55,7 @@ command: ["echo"] args: ["-n", "user-defined entrypoint command"] dedicatedPod: false - mountSources: false + mountSources: true - name: gl-tools-injector attributes: overrideCommand: false Index: ee/lib/remote_development/devfile_operations/flattener.rb IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/ee/lib/remote_development/devfile_operations/flattener.rb b/ee/lib/remote_development/devfile_operations/flattener.rb --- a/ee/lib/remote_development/devfile_operations/flattener.rb (revision 4e14284777ffd23e19341b4354ff6b3f397e5164) +++ b/ee/lib/remote_development/devfile_operations/flattener.rb (date 1756334005727) @@ -29,12 +29,6 @@ processed_devfile[:events][:preStart] ||= [] processed_devfile[:events][:postStart] ||= [] processed_devfile[:variables] ||= {} - processed_devfile[:components]&.each do |component| - next unless component[:container] - - component[:container][:dedicatedPod] = false - component[:container][:mountSources] = false - end Gitlab::Fp::Result.ok(context.merge(processed_devfile: processed_devfile)) end Index: ee/spec/lib/remote_development/devfile_operations/restrictions_enforcer_spec.rb IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/ee/spec/lib/remote_development/devfile_operations/restrictions_enforcer_spec.rb b/ee/spec/lib/remote_development/devfile_operations/restrictions_enforcer_spec.rb --- a/ee/spec/lib/remote_development/devfile_operations/restrictions_enforcer_spec.rb (revision 4e14284777ffd23e19341b4354ff6b3f397e5164) +++ b/ee/spec/lib/remote_development/devfile_operations/restrictions_enforcer_spec.rb (date 1756335926227) @@ -12,7 +12,8 @@ end let(:input_devfile) { read_devfile(input_devfile_name) } - let(:context) { { devfile: input_devfile } } + let(:input_devfile_key) { :processed_devfile } + let(:context) { { "#{input_devfile_key}": input_devfile } } subject(:result) do described_class.enforce(context) @@ -73,60 +74,60 @@ using RSpec::Parameterized::TableSyntax # rubocop:disable Layout/LineLength -- we want single lines for RSpec::Parameterized::TableSyntax - where(:input_devfile_name, :error_str) do - "example.invalid-attributes-override-command-with-command-args-present-devfile.yaml.erb" | "Properties 'command', 'args' for component 'tooling-container' can only be specified when the 'overrideCommand' attribute is set to false" - "example.invalid-attributes-override-command-with-non-boolean-value-devfile.yaml.erb" | "Property 'overrideCommand' of component 'tooling-container' must be a boolean (true or false)" - "example.invalid-attributes-tools-injector-absent-devfile.yaml.erb" | "No component has '#{main_component_indicator_attribute}' attribute" - "example.invalid-attributes-tools-injector-multiple-devfile.yaml.erb" | "Multiple components '[\"tooling-container\", \"tooling-container-2\"]' have '#{main_component_indicator_attribute}' attribute" - "example.invalid-component-missing-name.yaml.erb" | "A component must have a 'name'" - "example.invalid-command-missing-component-devfile.yaml.erb" | "'exec' command 'missing-component-command' must specify a 'component'" - "example.invalid-components-attributes-container-overrides-devfile.yaml.erb" | "Attribute 'container-overrides' is not yet supported" - "example.invalid-components-attributes-pod-overrides-devfile.yaml.erb" | "Attribute 'pod-overrides' is not yet supported" - "example.invalid-components-entry-empty-devfile.yaml.erb" | "No components present in devfile" - "example.invalid-components-entry-missing-devfile.yaml.erb" | "No components present in devfile" - "example.invalid-invalid-schema-version-devfile.yaml.erb" | "Invalid 'schemaVersion' 'example'" - "example.invalid-no-elements-devfile.yaml.erb" | "No components present in devfile" - "example.invalid-no-elements-flattened-devfile.yaml.erb" | "No components present in devfile" - "example.invalid-restricted-prefix-command-apply-component-name-devfile.yaml.erb" | "Component name 'gl-example' for command id 'example' must not start with 'gl-'" - "example.invalid-restricted-prefix-command-exec-component-name-devfile.yaml.erb" | "Component name 'gl-example' for command id 'example' must not start with 'gl-'" - "example.invalid-restricted-prefix-command-name-devfile.yaml.erb" | "Command id 'gl-example' must not start with 'gl-'" - "example.invalid-restricted-prefix-component-container-endpoint-name-devfile.yaml.erb" | "Endpoint name 'gl-example' of component 'example' must not start with 'gl-'" - "example.invalid-restricted-prefix-component-name-devfile.yaml.erb" | "Component name 'gl-example' must not start with 'gl-'" - "example.invalid-component-name-field-type-devfile.yaml.erb" | "'Component name' must be a String" - "example.invalid-variables-field-type-devfile.yaml.erb" | "'Variables' must be a Hash" - "example.invalid-events-field-type-devfile.yaml.erb" | "'Events' must be a Hash" - "example.invalid-endpoints-field-type-devfile.yaml.erb" | "'Endpoints' must be an Array" - "example.invalid-commands-field-type-devfile.yaml.erb" | "'Commands' must be an Array" - "example.invalid-command-field-type-devfile.yaml.erb" | "'command' must be a Hash" - "example.invalid-container-field-type-devfile.yaml.erb" | "'container' in component 'gl-example' must be a Hash" - "example.invalid-component-field-type-devfile.yaml.erb" | "Each element in 'components' must be a Hash" - "example.invalid-components-field-type-devfile.yaml.erb" | "'Components' must be an Array" - "example.invalid-schema-version-field-type-devfile.yaml.erb" | "'schemaVersion' must be a String" - "example.invalid-root-attributes-field-type-devfile.yaml.erb" | "'Attributes' must be a Hash" - "example.invalid-component-attributes-field-type-devfile.yaml.erb" | "'attributes' for component 'gl-example' must be a Hash" - "example.invalid-restricted-prefix-event-type-prestart-name-devfile.yaml.erb" | "Event 'gl-example' of type 'preStart' must not start with 'gl-'" - "example.invalid-restricted-prefix-variable-name-devfile.yaml.erb" | "Variable name 'gl-example' must not start with 'gl-'" - "example.invalid-restricted-prefix-command-apply-label-devfile.yaml.erb" | "Label 'gl-example' for command id 'example' must not start with 'gl-'" - "example.invalid-restricted-prefix-command-exec-label-devfile.yaml.erb" | "Label 'gl-example' for command id 'example' must not start with 'gl-'" - "example.invalid-restricted-prefix-variable-name-with-underscore-devfile.yaml.erb" | "Variable name 'gl_example' must not start with 'gl_'" - "example.invalid-root-attributes-pod-overrides-devfile.yaml.erb" | "Attribute 'pod-overrides' is not yet supported" - "example.invalid-unsupported-command-exec-hot-reload-capable-option-devfile.yaml.erb" | "Property 'hotReloadCapable' for exec command 'unsupported-hot-reload-option' must be false when specified" - "example.invalid-unsupported-command-exec-options-devfile.yaml.erb" | "Unsupported options 'unsupportedOption' for exec command 'unsupported-options'. Only 'commandLine, component, label, hotReloadCapable' are supported." - "example.invalid-unsupported-command-type-devfile.yaml.erb" | "Command 'composite-command' must have one of the supported command types: exec, apply" - "example.invalid-unsupported-command-type-poststart-event-devfile.yaml.erb" | "PostStart event references command 'apply-command' which is not an exec command. Only exec commands are supported in postStart events" - "example.invalid-poststart-event-nonexistent-command-devfile.yaml.erb" | "PostStart event references command 'nonexistent-command' which has no command definition." - "example.invalid-unsupported-component-container-dedicated-pod-devfile.yaml.erb" | "Property 'dedicatedPod' of component 'example' is not yet supported" - "example.invalid-unsupported-component-type-image-devfile.yaml.erb" | "Component type 'image' is not yet supported" - "example.invalid-unsupported-component-type-kubernetes-devfile.yaml.erb" | "Component type 'kubernetes' is not yet supported" - "example.invalid-unsupported-component-type-openshift-devfile.yaml.erb" | "Component type 'openshift' is not yet supported" - "example.invalid-unsupported-event-type-poststop-devfile.yaml.erb" | "Event type 'postStop' is not yet supported" - "example.invalid-unsupported-event-type-prestop-devfile.yaml.erb" | "Event type 'preStop' is not yet supported" - "example.invalid-unsupported-parent-inheritance-devfile.yaml.erb" | "Inheriting from 'parent' is not yet supported" - "example.invalid-unsupported-projects-devfile.yaml.erb" | "'projects' is not yet supported" - "example.invalid-unsupported-schema-version-devfile.yaml.erb" | "'schemaVersion' '2.0.0' is not supported, it must be '2.2.0'" - "example.invalid-unsupported-starter-projects-devfile.yaml.erb" | "'starterProjects' is not yet supported" - "example.invalid-unsupported-component-container-source-mapping-devfile.yaml.erb" | "Property 'sourceMapping' of component 'example' is not yet supported" - "example.invalid-unsupported-component-container-mount-sources-devfile.yaml.erb" | "Property 'mountSources' of component 'example' is not yet supported" + where(:input_devfile_name, :error_str, :input_devfile_key) do + "example.invalid-attributes-override-command-with-command-args-present-devfile.yaml.erb" | "Properties 'command', 'args' for component 'tooling-container' can only be specified when the 'overrideCommand' attribute is set to false" | :processed_devfile + "example.invalid-attributes-override-command-with-non-boolean-value-devfile.yaml.erb" | "Property 'overrideCommand' of component 'tooling-container' must be a boolean (true or false)" | :processed_devfile + "example.invalid-attributes-tools-injector-absent-devfile.yaml.erb" | "No component has '#{main_component_indicator_attribute}' attribute" | :processed_devfile + "example.invalid-attributes-tools-injector-multiple-devfile.yaml.erb" | "Multiple components '[\"tooling-container\", \"tooling-container-2\"]' have '#{main_component_indicator_attribute}' attribute" | :processed_devfile + "example.invalid-component-missing-name.yaml.erb" | "A component must have a 'name'" | :processed_devfile + "example.invalid-command-missing-component-devfile.yaml.erb" | "'exec' command 'missing-component-command' must specify a 'component'" | :processed_devfile + "example.invalid-components-attributes-container-overrides-devfile.yaml.erb" | "Attribute 'container-overrides' is not yet supported" | :processed_devfile + "example.invalid-components-attributes-pod-overrides-devfile.yaml.erb" | "Attribute 'pod-overrides' is not yet supported" | :processed_devfile + "example.invalid-components-entry-empty-devfile.yaml.erb" | "No components present in devfile" | :processed_devfile + "example.invalid-components-entry-missing-devfile.yaml.erb" | "No components present in devfile" | :processed_devfile + "example.invalid-invalid-schema-version-devfile.yaml.erb" | "Invalid 'schemaVersion' 'example'" | :processed_devfile + "example.invalid-no-elements-devfile.yaml.erb" | "No components present in devfile" | :processed_devfile + "example.invalid-no-elements-flattened-devfile.yaml.erb" | "No components present in devfile" | :processed_devfile + "example.invalid-restricted-prefix-command-apply-component-name-devfile.yaml.erb" | "Component name 'gl-example' for command id 'example' must not start with 'gl-'" | :processed_devfile + "example.invalid-restricted-prefix-command-exec-component-name-devfile.yaml.erb" | "Component name 'gl-example' for command id 'example' must not start with 'gl-'" | :processed_devfile + "example.invalid-restricted-prefix-command-name-devfile.yaml.erb" | "Command id 'gl-example' must not start with 'gl-'" | :processed_devfile + "example.invalid-restricted-prefix-component-container-endpoint-name-devfile.yaml.erb" | "Endpoint name 'gl-example' of component 'example' must not start with 'gl-'" | :processed_devfile + "example.invalid-restricted-prefix-component-name-devfile.yaml.erb" | "Component name 'gl-example' must not start with 'gl-'" | :processed_devfile + "example.invalid-component-name-field-type-devfile.yaml.erb" | "'Component name' must be a String" | :processed_devfile + "example.invalid-variables-field-type-devfile.yaml.erb" | "'Variables' must be a Hash" | :processed_devfile + "example.invalid-events-field-type-devfile.yaml.erb" | "'Events' must be a Hash" | :processed_devfile + "example.invalid-endpoints-field-type-devfile.yaml.erb" | "'Endpoints' must be an Array" | :processed_devfile + "example.invalid-commands-field-type-devfile.yaml.erb" | "'Commands' must be an Array" | :processed_devfile + "example.invalid-command-field-type-devfile.yaml.erb" | "'command' must be a Hash" | :processed_devfile + "example.invalid-container-field-type-devfile.yaml.erb" | "'container' in component 'gl-example' must be a Hash" | :processed_devfile + "example.invalid-component-field-type-devfile.yaml.erb" | "Each element in 'components' must be a Hash" | :processed_devfile + "example.invalid-components-field-type-devfile.yaml.erb" | "'Components' must be an Array" | :processed_devfile + "example.invalid-schema-version-field-type-devfile.yaml.erb" | "'schemaVersion' must be a String" | :processed_devfile + "example.invalid-root-attributes-field-type-devfile.yaml.erb" | "'Attributes' must be a Hash" | :processed_devfile + "example.invalid-component-attributes-field-type-devfile.yaml.erb" | "'attributes' for component 'gl-example' must be a Hash" | :processed_devfile + "example.invalid-restricted-prefix-event-type-prestart-name-devfile.yaml.erb" | "Event 'gl-example' of type 'preStart' must not start with 'gl-'" | :processed_devfile + "example.invalid-restricted-prefix-variable-name-devfile.yaml.erb" | "Variable name 'gl-example' must not start with 'gl-'" | :processed_devfile + "example.invalid-restricted-prefix-command-apply-label-devfile.yaml.erb" | "Label 'gl-example' for command id 'example' must not start with 'gl-'" | :processed_devfile + "example.invalid-restricted-prefix-command-exec-label-devfile.yaml.erb" | "Label 'gl-example' for command id 'example' must not start with 'gl-'" | :processed_devfile + "example.invalid-restricted-prefix-variable-name-with-underscore-devfile.yaml.erb" | "Variable name 'gl_example' must not start with 'gl_'" | :processed_devfile + "example.invalid-root-attributes-pod-overrides-devfile.yaml.erb" | "Attribute 'pod-overrides' is not yet supported" | :processed_devfile + "example.invalid-unsupported-command-exec-hot-reload-capable-option-devfile.yaml.erb" | "Property 'hotReloadCapable' for exec command 'unsupported-hot-reload-option' must be false when specified" | :processed_devfile + "example.invalid-unsupported-command-exec-options-devfile.yaml.erb" | "Unsupported options 'unsupportedOption' for exec command 'unsupported-options'. Only 'commandLine, component, label, hotReloadCapable' are supported." | :processed_devfile + "example.invalid-unsupported-command-type-devfile.yaml.erb" | "Command 'composite-command' must have one of the supported command types: exec, apply" | :processed_devfile + "example.invalid-unsupported-command-type-poststart-event-devfile.yaml.erb" | "PostStart event references command 'apply-command' which is not an exec command. Only exec commands are supported in postStart events" | :processed_devfile + "example.invalid-poststart-event-nonexistent-command-devfile.yaml.erb" | "PostStart event references command 'nonexistent-command' which has no command definition." | :processed_devfile + "example.invalid-unsupported-component-container-dedicated-pod-devfile.yaml.erb" | "Property 'dedicatedPod' of component 'example' is not yet supported" | :processed_devfile + "example.invalid-unsupported-component-type-image-devfile.yaml.erb" | "Component type 'image' is not yet supported" | :processed_devfile + "example.invalid-unsupported-component-type-kubernetes-devfile.yaml.erb" | "Component type 'kubernetes' is not yet supported" | :processed_devfile + "example.invalid-unsupported-component-type-openshift-devfile.yaml.erb" | "Component type 'openshift' is not yet supported" | :processed_devfile + "example.invalid-unsupported-event-type-poststop-devfile.yaml.erb" | "Event type 'postStop' is not yet supported" | :processed_devfile + "example.invalid-unsupported-event-type-prestop-devfile.yaml.erb" | "Event type 'preStop' is not yet supported" | :processed_devfile + "example.invalid-unsupported-parent-inheritance-devfile.yaml.erb" | "Inheriting from 'parent' is not yet supported" | :processed_devfile + "example.invalid-unsupported-projects-devfile.yaml.erb" | "'projects' is not yet supported" | :processed_devfile + "example.invalid-unsupported-schema-version-devfile.yaml.erb" | "'schemaVersion' '2.0.0' is not supported, it must be '2.2.0'" | :processed_devfile + "example.invalid-unsupported-starter-projects-devfile.yaml.erb" | "'starterProjects' is not yet supported" | :processed_devfile + "example.invalid-unsupported-component-container-source-mapping-devfile.yaml.erb" | "Property 'sourceMapping' of component 'example' is not yet supported" | :processed_devfile + "example.invalid-unsupported-component-container-mount-sources-devfile.yaml.erb" | "Property 'mountSources' of component 'example' is not yet supported" | :devfile end # rubocop:enable Layout/LineLength