Skip to content

Parallel promotion tasks in bwc_pkg_promote_all do not fail correctly #127

@blag

Description

@blag

Creating an issue as per this comment.

Implementing promotion tasks in parallel does not work correctly - the process_completion task is never run, the workflow simply fails after all four tasks fail.

Here is the snippet:

  promote_all:
    next:
      - do:
          - promote_bwc_enterprise
          - promote_st2_auth_ldap
          - promote_st2flow
          - promote_bwc_ui
  promote_bwc_enterprise:
    action: st2ci.st2_pkg_promote_enterprise
    input:
      package: bwc-enterprise
      distro_version: <% ctx().pkg_distro_version %>
      release: <% ctx().release %>
      version: <% ctx().version %>
    next:
      - when: <% succeeded() %>
        publish:
          - promoted_bwc_enterprise: <% ctx().version + '-' + result().output.revision %>
        do:
          - process_completion
      - when: <% failed() %>
        do:
          - process_completion
  promote_st2_auth_ldap:
    action: st2ci.st2_pkg_promote_enterprise
    input:
      package: st2-auth-ldap
      distro_version: <% ctx().pkg_distro_version %>
      release: <% ctx().release %>
      version: <% ctx().version %>
    next:
      - when: <% succeeded() %>
        publish:
          - promoted_st2_auth_ldap: <% ctx().version + '-' + result().output.revision %>
        do:
          - process_completion
      - when: <% failed() %>
        do:
          - process_completion
  promote_st2flow:
    action: st2ci.st2_pkg_promote_enterprise
    input:
      package: st2flow
      distro_version: <% ctx().pkg_distro_version %>
      release: <% ctx().release %>
      version: <% ctx().version %>
    next:
      - when: <% succeeded() %>
        publish:
          - promoted_st2flow: <% ctx().version + '-' + result().output.revision %>
        do:
          - process_completion
      - when: <% failed() %>
        do:
          - process_completion
  promote_bwc_ui:
    action: st2ci.st2_pkg_promote_enterprise
    input:
      package: bwc-ui
      distro_version: <% ctx().pkg_distro_version %>
      release: <% ctx().release %>
      version: <% ctx().version %>
    next:
      - when: <% succeeded() %>
        publish:
          - promoted_bwc_ui: <% ctx().version + '-' + result().output.revision %>
        do:
          - process_completion
      - when: <% failed() %>
        do:
          - process_completion

  process_completion:
    action: core.noop
    join: all

    next:
      - when: <% succeeded() and     (ctx().promoted_bwc_enterprise and ctx().promoted_st2_auth_ldap and ctx().promoted_st2flow and ctx().promoted_bwc_ui) %>
        publish:
          - promoted: true
        do:
          - set_notify_success
      - when: <% succeeded() and not (ctx().promoted_bwc_enterprise and ctx().promoted_st2_auth_ldap and ctx().promoted_st2flow and ctx().promoted_bwc_ui) %>
        publish:
          - promoted: false
        do:
          - set_notify_failure

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions