org-formation-cli icon indicating copy to clipboard operation
org-formation-cli copied to clipboard

Recursive Task File Validation

Open mbarneyjr opened this issue 4 years ago • 1 comments

Validating Task files

If your project layout looks something like this:

organization-tasks.yml (contains update-organization and include task types for module1 and module2)
module1/
  organization-tasks.yml (contains update-stacks task types)
module2/
  organization-tasks.yml (contains update-stacks task types)

Calling validate-tasks on the root organization-tasks.yml does not perform the full validation of module1/organization-tasks.yml and module2/organization-tasks.yml. I do notice some validation, for instance task types in nested task files must be valid, but in my testing the Template property of an 'update-stacks' task is not validated to reference a valid path (where if you call validate-tasks on the module1/organization-tasks.yml directly it does get validated).

Previously I was calling validate-tasks on each task file individually, but that was giving me errors when I added new accounts to the organization.yml since update-organization is only called in one task file (and it only gracefully exits when update-organization is called, since that seems to be what updates the validation's internal model of what the organization looks like) - so ideally the same model is used recursively throughout the validation of nested task files.

Your environment

  • version of org-foramtion (ofn --version)
$ ofn -v
0.9.18
  • version of node (node --version)
$ node -v
v14.18.2
  • which OS/distro
$ uname -a
Darwin
# macOS Monterrey version 12.2

Expected behaviour

The same level of validation happens on included task files, perhaps with a recursive flag to not break existing validations?

Actual behaviour

It seems like a basic level of validation is performed

mbarneyjr avatar Feb 11 '22 15:02 mbarneyjr

As discussed in slack, recursive validation is implemented and works fine if there are no new accounts

I get full recursive validation if there are no new accounts in organization.yml (incorrect Template path in a nested update-stacks task does in fact raise an error)

I do not get full recursive validation if there are new accounts in organization.yml (an incorrect Template path in a nested update-stacks task does not raise an error)

mbarneyjr avatar Feb 11 '22 18:02 mbarneyjr