__env is not evaluated by with_items

Bug #1413338 reported by Dmitri Zimine
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mistral
Fix Released
Medium
Nikolay Makhotkin
Liberty
Fix Released
Medium
Nikolay Makhotkin

Bug Description

Bug:

_env is evaluated here,
https://github.com/stackforge/mistral/blob/master/mistral/workflow/data_flow.py#L100-L102

but not here:
https://github.com/stackforge/mistral/blob/master/mistral/workflow/with_items.py#L57-L60

I think once we split the logic here,
 - https://github.com/stackforge/mistral/blob/fix_output_result/mistral/workflow/base.py#L133-L141
it leads to code and logic duplication is doomed to diverge. Thoughs on how to refactor it?

DZ>

Changed in mistral:
milestone: none → kilo-2
importance: Undecided → Medium
status: New → Confirmed
Changed in mistral:
milestone: kilo-2 → kilo-3
Revision history for this message
Nikolay Makhotkin (nmakhotkin) wrote :

Can't reproduce:

1. Create workbook:

version: "2.0"

name: wb1

workflows:
  with_items:
    type: direct

    input:
     - names

    tasks:
      task1:
        with-items: name in <% $.names %>
        action: std.echo output="http://<% $.name %>! <% $.__env.adj %>"

2. Start execution: mistral execution-create wb1.with_items '{"names": [1, 2, 3]}' '{"env": {"adj": "Mistral"}}'

3. get the result:

$ mistral task-list dc8b2335-aa67-4a28-a734-5002a8db9628

+--------------------------------------+-------+----------------+--------------------------------------+---------+
| ID | Name | Workflow name | Execution ID | State |
+--------------------------------------+-------+----------------+--------------------------------------+---------+
| cf15aa56-f5a6-4aa0-a22c-57d88137c1b7 | task1 | wb1.with_items | dc8b2335-aa67-4a28-a734-5002a8db9628 | SUCCESS |
+--------------------------------------+-------+----------------+--------------------------------------+---------+
$ mistral task-get-result cf15aa56-f5a6-4aa0-a22c-57d88137c1b7

[
    "http://2! Mistral",
    "http://3! Mistral",
    "http://1! Mistral"
]

no longer affects: mistral/kilo
Revision history for this message
Renat Akhmerov (rakhmerov) wrote :

Check if we have corresponding tests.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to mistral (master)

Fix proposed to branch: master
Review: https://review.openstack.org/223103

Changed in mistral:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to mistral (master)

Reviewed: https://review.openstack.org/223103
Committed: https://git.openstack.org/cgit/openstack/mistral/commit/?id=9009788e26e47a21800a35f54e8641dba292eed9
Submitter: Jenkins
Branch: master

commit 9009788e26e47a21800a35f54e8641dba292eed9
Author: Nikolay Mahotkin <email address hidden>
Date: Mon Sep 14 16:46:32 2015 +0300

    Adding test where with-items evaluates 'env'

    Closes-Bug: #1413338

    Change-Id: Iffd4de3358c4800fd915d2c740ee74a6c154c333

Changed in mistral:
status: In Progress → Fix Committed
Changed in mistral:
milestone: 1.0.0 → none
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.