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.05k stars 745 forks source link

Can't filter workflow execution using --attr flag #4555

Open matrulda opened 5 years ago

matrulda commented 5 years ago
SUMMARY

Hi!

It looks like the --attr flag has no effect when trying to retrieve info from a workflow execution. The flag works when using it on a task execution.

ISSUE TYPE

Bug Report

STACKSTORM VERSION

st2 2.10.1, on Python 2.7.6

OS / ENVIRONMENT / INSTALL METHOD

Vagrant - bento/ubuntu-14.04 one-line install (using https://stackstorm.com/packages/install.sh)

STEPS TO REPRODUCE

I was able to reproduce this issue using this pack: https://github.com/StackStorm/st2/blob/master/contrib/examples

$ st2 run examples.mistral-basic cmd="echo Hello World"
$ st2 execution get <execution id of the execution above> --attr id status
EXPECTED RESULTS
id: <execution id>
status: <status>

in my case:

id: 5c6a8b652f0a5604b1130ac6
status: succeeded (1s elapsed)
ACTUAL RESULTS
id: 5c6a8b652f0a5604b1130ac6
action.ref: examples.mistral-basic
parameters: 
  cmd: echo Hello World
status: succeeded (1s elapsed)
result_task: task1
result: 
  failed: false
  return_code: 0
  stderr: ''
  stdout: Hello World
  succeeded: true
start_timestamp: Mon, 18 Feb 2019 10:39:33 UTC
end_timestamp: Mon, 18 Feb 2019 10:39:34 UTC
+--------------------------+------------------------+-------+------------+-------------------------------+
| id                       | status                 | task  | action     | start_timestamp               |
+--------------------------+------------------------+-------+------------+-------------------------------+
| 5c6a8b652f0a5604b1130ac9 | succeeded (0s elapsed) | task1 | core.local | Mon, 18 Feb 2019 10:39:33 UTC |
+--------------------------+------------------------+-------+------------+-------------------------------+
Extra info

When listing task1, it works as expected: $ st2 execution get 5c6a8b652f0a5604b1130ac9 --attr id status

Result:

id: 5c6a8b652f0a5604b1130ac9
status: succeeded (0s elapsed)
Kami commented 5 years ago

Thanks for reporting this.

We will have a look and try to reproduce it shortly.

johandahlberg commented 5 years ago

Any updates on this? :smile: