StackStorm / StackStorm/st2

changed console output behavior when running a workflow

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

Nobody has claimed this yet.

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

Description

  • SUMMARY

since the last update i've noticed a diffrence in cli output when running a workflow action, the "result_task" shows the first task result instead of the last one

st2 is still running but this change bother me, is there a way to set the content of "result_task" ?

ISSUE TYPE

Pick one below and delete the rest:

  • Bug Report
STACKSTORM VERSION

st2 --version :
st2 2.10.1, on Python 2.7.5

OS / ENVIRONMENT / INSTALL METHOD

Centos7

STEPS TO REPRODUCE

to reproduce the issue, i've created a simple testpack with a workflow that displays the date than tails the content of pack.yaml, below the yaml files :

pack.yaml

---
ref: testpack
name: test pack
description: test pack
keywords:
    - test
version: 0.1.0
author: mlalmi.
email: localhost@localhost.local

action test.yaml

---
name: test
pack: testpack
description: test
runner_type: mistral-v2
entry_point: "workflows/test.yaml"
enabled: true
parameters:
    path:
        type: string
        description: path to displayed file
        required: true
        position: 0
        default: /opt/stackstorm/packs/testpack/pack.yaml

workflow test.yaml

---
version: '2.0'
name: testpack.test
description: test
workflows:
    main:
        type: direct
        input:
        - path
        tasks:
            show_date:
                action: core.local
                input:
                    cmd: date
                on-success:
                    - show_conf
            show_conf:
                action: core.local
                input:
                    cmd: "tail -vn +1 <% $.path %>"
EXPECTED RESULTS

according to my example it's expected to see the value "show_conf" for the key "result_task:" in console output,

ACTUAL RESULTS
st2 run testpack.test
..
id: 5c45f8374eb8883a50704670
action.ref: testpack.test
parameters: None
status: succeeded
result_task: show_date
result: 
  failed: false
  return_code: 0
  stderr: ''
  stdout: Mon Jan 21 17:50:00 CET 2019
  succeeded: true
start_timestamp: Mon, 21 Jan 2019 16:49:59 UTC
end_timestamp: Mon, 21 Jan 2019 16:50:02 UTC
+--------------------------+------------------------+-----------+------------+--------------------+
| id                       | status                 | task      | action     | start_timestamp    |
+--------------------------+------------------------+-----------+------------+--------------------+
| 5c45f8374eb8883a50704673 | succeeded (1s elapsed) | show_date | core.local | Mon, 21 Jan 2019   |
|                          |                        |           |            | 16:49:59 UTC       |
| 5c45f8384eb8883a50704675 | succeeded (1s elapsed) | show_conf | core.local | Mon, 21 Jan 2019   |
|                          |                        |           |            | 16:50:00 UTC       |
+--------------------------+------------------------+-----------+------------+--------------------+

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

Start by running st2 run testpack.test with the provided pack.yaml, action test.yaml, and workflow test.yaml, then compare the reported result_task and result with the task table. The expected behavior is for result_task to identify show_conf and for the displayed result to correspond to the final workflow task.

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
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.