preserve key order in workflow definition

Bug #1815515 reported by Oleg Ovcharuk
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mistral
Fix Released
Medium
Oleg Ovcharuk

Bug Description

It is very important to save workflow definitions "as is", without any changes.
If user creates one workflow by request, Mistral saves it correctly, but if there are multiple workflows in one request, Mistral perform double conversion to separate workflow definitions from one yaml. In this case keys of incoming yaml could be sorted, which could broke user's business.
Test case:
wfs.yaml
version: "2.0"
wf1:
  tasks:
    task1:
      action: std.noop
      publish:
        we: 1
        dont_want: 2
        to_be_sorted: 3
wf2:
  tasks:
    task1:
      action: std.noop

1) Create these workflows by one request.
2) Get workflow definition of wf1

Expected:

version: "2.0"
wf1:
  tasks:
    task1:
      action: std.noop
      publish: {we: 1, dont_want: 2, to_be_sorted: 3}

Actual:

version: "2.0"
wf1:
  tasks:
    task1:
      action: std.noop
      publish: {dont_want: 2, to_be_sorted: 3, we: 1}

Changed in mistral:
assignee: nobody → Oleg Ovcharuk (vgvoleg)
status: New → Confirmed
importance: Undecided → Medium
milestone: none → stein-3
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/636583

Changed in mistral:
status: Confirmed → In Progress
Changed in mistral:
milestone: stein-3 → train-1
Changed in mistral:
milestone: train-1 → ussuri-1
Changed in mistral:
milestone: ussuri-1 → ussuri-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to mistral (master)

Reviewed: https://review.opendev.org/636583
Committed: https://git.openstack.org/cgit/openstack/mistral/commit/?id=c1c21d7cddca2f307e93f42b4758e64fcdf0a630
Submitter: Zuul
Branch: master

commit c1c21d7cddca2f307e93f42b4758e64fcdf0a630
Author: Oleg Ovcharuk <email address hidden>
Date: Tue Feb 12 01:43:09 2019 +0300

    Disable key sorting in workflow definition

    Update to PyYAML 5.1 to be able to turn off key sorting
    in workflow definitions. We should not change user's data
    until user asks to.

    Change-Id: I888008ac8f9c12bd92a9bd72bd7c276a11827847
    Closes-Bug: #1815515
    Signed-off-by: Oleg Ovcharuk <email address hidden>

Changed in mistral:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/mistral 10.0.0.0b2

This issue was fixed in the openstack/mistral 10.0.0.0b2 development milestone.

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.