getporter / az-mixin

An Azure CLI mixin for Porter
https://getporter.org/mixins/az/
Apache License 2.0
0 stars 11 forks source link

Using a wrong outputs definition in porter.yaml, doesn't provide en error #24

Open mikkelhegn opened 3 years ago

mikkelhegn commented 3 years ago

In my example I was not specifying the jsonPath using correct case (I used jsonpath as opposed to jsonPath):

      outputs:
        - name: "WEBAPI_ID"
          jsonpath: "$.properties.outputs.webapi_id.value"

This resulted in the mixin to run without an error, but not picking up the output.

I think the desired outcome should be an error on parsing porter.yaml while running the mixin. Thoughts?

vdice commented 3 years ago

Ah, thanks for filing. It would definitely be good to bubble up errors of this nature. It could perhaps happen during linting or maybe at runtime (I'll have to refresh my memory as to if one of path/jsonPath/regex is mandatory... if so, we could error when none is supplied -- as I believe would be the case if the key is incorrect/unknown.) Maybe a linter check would be the best...

JasonFreeberg commented 3 years ago

I ran into this same problem, took me a few minutes to figure out what was going on.

carolynvs commented 3 years ago

I think we need to refresh the schema.json file for the az mixin, and then validate against it during lint. Then when you use VSCode you will get the proper autocomplete and porter build/lint will fail when you typo the outputs.