peartherapeutics / bitrise-aws-device-farm-file-deploy

MIT License
6 stars 15 forks source link

Get the result of the create-upload command as JSON #10

Closed otusweb closed 7 years ago

otusweb commented 7 years ago
fadookie commented 7 years ago

Also the order of the response variables should be guaranteed due to my JMESPath query.

otusweb commented 7 years ago

While it is safe to assume for now don't have a space, what happens if the query returns an error. With JSOn parser, you'll get the error bubbled right away. where I believe that with the current code, it will most likely fail silently. As for running slower, you're probably right, but i doubt that it is in a measurably significant way.

fadookie commented 7 years ago

@otusweb JMESPath syntax errors will cause awscli to exit nonzero, causing the step to fail immediately. However I tried a syntactically correct nonsense query and you are correct that it does not raise an error. In text mode however, it will cause the query to return None. So how about this... I can add an explicit check if the first field is equal to None at which point the step will fail.

example:

$ aws devicefarm list-projects --query='foo['

Bad value for --query foo[: Invalid jmespath expression: Incomplete expression:
"foo["
     ^
$ echo $?
255
$ aws devicefarm list-projects --query='foobar' --output=text
None
otusweb commented 7 years ago

Sounds good. Thanks for considering!

fadookie commented 7 years ago

@otusweb Of course! Feel free to send more PRs in the future regarding the other issue you opened or whatever.