StackStorm / StackStorm/st2

Can't filter workflow execution using --attr flag

Open
#4,555 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

CLI status:to be verified
Dominant language
Python
Stars
6.5k
Forks
787
PR merge metrics
No merged PRs in 30d

Description

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)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the examples.mistral-basic workflow using st2 execution get <execution id> --attr id status. Start by tracing how the st2 execution get command handles attributes for workflow and task executions, then compare the two paths. Done means workflow execution output contains only the requested id and status fields, matching task execution behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.