ods-jenkins-shared-library icon indicating copy to clipboard operation
ods-jenkins-shared-library copied to clipboard

Validation layer for orchestration pipeline's YAML

Open felipecruz91 opened this issue 4 years ago • 4 comments

Is your feature request related to a problem? Please describe. I've seen many mistakes by users when editing the Release Manager's metadata.yml file and unfortunately the orchestration pipeline is not able to return a meaningful message indicating what the problem is.

Examples of the most common mistakes I've seen so far:

  1. Bad YAML indentation after editing the metadata.yml file.

  2. They forget to remove the array after specifying the repositories

repositories: [] <---- *** This***
  - id: A
    url: https://github.com/my-org/my-repo-A.git
    branch: master
    type: ods
  1. Template version should wrapped in double quotes:
capabilities:
 - LeVADocs:
     GAMPCategory: 5
     templatesVersion: "1.1"   <---- *** This ***

Describe the solution you'd like I would like a validation layer that evaluates the metadata.yml's content and check if it is valid or not, syntax-wise and returns a meaningful message indicating the line number and why it failed. This will help a lot of users that are not familiar with YAML and will show a more mature product face to these end-users.

Describe alternatives you've considered

Additional context

felipecruz91 avatar Feb 18 '21 11:02 felipecruz91

considering the criticity of RM I think we should code a validator

segator avatar Feb 18 '21 11:02 segator

Not needed @segator. An explicit conversion to String when the parameter is read in the MRO is good enough.

metmajer avatar Feb 18 '21 11:02 metmajer

I like the idea of a validator - eg. the template still comes with a "[ ]" which I usually forget to remove

nichtraunzer avatar Feb 18 '21 11:02 nichtraunzer

Hi,

Today I got a different user that made the mistake of including a whitespace just right before the 'c' character in the word capabilities:

# Uncomment (below) to generate documents	  
 capabilities: <--- *** notice there's an extra whitespace at the beginning of the line ***
  - LeVADocs:
      GAMPCategory: 5

felipecruz91 avatar Feb 23 '21 08:02 felipecruz91