StackStorm / st2

StackStorm (aka "IFTTT for Ops") is event-driven automation for auto-remediation, incident responses, troubleshooting, deployments, and more for DevOps and SREs. Includes rules engine, workflow, 160 integration packs with 6000+ actions (see https://exchange.stackstorm.org) and ChatOps. Installer at https://docs.stackstorm.com/install/index.html
https://stackstorm.com/
Apache License 2.0
6.1k stars 746 forks source link

Changing nested "result" attribute in action reporting #3342

Open Mierdin opened 7 years ago

Mierdin commented 7 years ago

In building a custom response for an action alias, I realized that actions report their results via a nested set of result keys:

vagrant@st2vagrant:/opt/stackstorm/packs/napalm$ st2 run napalm.check_consistency hostname=vsrx01
.
id: 58e7f09cc4da5f5bc3963835
status: succeeded
parameters:
  hostname: vsrx01
result:
  exit_code: 0
  result: null
  stderr: ''
  stdout: ''

So, in my alias response, I had to use execution.result.result to refer to values returned by the action.

I'm fully acknowledging that I expect that the ratio of value to effort for changing this is probably skewed towards the "not worth it" direction, but figured I'd open the issue anyways to see if it's even worth the discussion. Value:effort aside, it would be nice if the inner attribute was named values or something else, other than result. execution.result.values would definitely look a bit better.

arm4b commented 7 years ago

I like the execution.result.values naming

Kami commented 7 years ago

Yeah, I agree, result.result is quite confusing.

The problem with that change is that it's breaking so we need to figure out a best way to make it backward compatible.

nmaludy commented 7 years ago

+1 (result.result just bit me)