<commit_before>---
version: '2.0'
name: tripleo.validations.v1
description: TripleO Validations Workflows v1

workflows:

  run_validation:
    input:
      - validation_name
      - plan: overcloud
      - queue_name: tripleo

    tasks:

      notify_running:
        on-complete: run_validation
        action: zaqar.queue_post
        retry: count=5 delay=1
        input:
          queue_name: <% $.queue_name %>
          messages:
            body:
              type: tripleo.validations.v1.run_validation
              payload:
                validation_name: <% $.validation_name %>
                plan: <% $.plan %>
                status: RUNNING
                execution: <% execution() %>

      run_validation:
        on-success: send_message
        on-error: set_status_failed
        action: tripleo.validations.run_validation validation=<% $.validation_name %> plan=<% $.plan %>
        publish:
          status: SUCCESS
          stdout: <% task(run_validation).result.stdout %>
          stderr: <% task(run_validation).result.stderr %>

      set_status_failed:
        on-complete: send_message
        publish:
          status: FAILED
          stdout: <% task(run_validation).result.stdout %>
          stderr: <% task(run_validation).result.stderr %>

      send_message:
        action: zaqar.queue_post
        retry: count=5 delay=1
        input:
          queue_name: <% $.queue_name %>
          messages:
            body:
              type: tripleo.validations.v1.run_validation
              payload:
                validation_name: <% $.validation_name %>
                plan: <% $.plan %>
                status: <% $.get('status', 'SUCCESS') %>
                stdout: <% $.stdout %>
                stderr: <% $.stderr %>
                execution: <% execution() %>

  run_validations:
    input:
      - validation_names: []
      - plan: overcloud
      - queue_name: tripleo

    tasks:

      notify_running:
        on-complete: run_validations
        action: zaqar.queue_post
        retry: count=5 delay=1
        input:
          queue_name: <% $.queue_name %>
          messages:
            body:
              type: tripleo.validations.v1.run_validations
              payload:
                validation_names: <% $.validation_names %>
                plan: <% $.plan %>
                status: RUNNING
                execution: <% execution() %>

      run_validations:
        on-success: send_message
        on-error: set_status_failed
        workflow: tripleo.validations.v1.run_validation validation_name=<% $.validation %> plan=<% $.plan %> queue_name=<% $.queue_name %>
        with-items: validation in <% $.validation_names %>
        publish:
          status: SUCCESS

      set_status_failed:
        on-complete: send_message
        publish:
          status: FAILED

      send_message:
        action: zaqar.queue_post
        retry: count=5 delay=1
        input:
          queue_name: <% $.queue_name %>
          messages:
            body:
              type: tripleo.validations.v1.run_validations
              payload:
                validation_names: <% $.validation_names %>
                plan: <% $.plan %>
                status: <% $.get('status', 'SUCCESS') %>
                execution: <% execution() %>

  run_groups:
    input:
      - group_names: []
      - plan: overcloud
      - queue_name: tripleo

    tasks:

      find_validations:
        on-success: notify_running
        action: tripleo.validations.list_validations groups=<% $.group_names %>
        publish:
          validations: <% task(find_validations).result %>

      notify_running:
        on-complete: run_validation_group
        action: zaqar.queue_post
        retry: count=5 delay=1
        input:
          queue_name: <% $.queue_name %>
          messages:
            body:
              type: tripleo.validations.v1.run_validations
              payload:
                group_names: <% $.group_names %>
                validation_names: <% $.validations.id %>
                plan: <% $.plan %>
                status: RUNNING
                execution: <% execution() %>

      run_validation_group:
        on-success: send_message
        on-error: set_status_failed
        workflow: tripleo.validations.v1.run_validation validation_name=<% $.validation %> plan=<% $.plan %> queue_name=<% $.queue_name %>
        with-items: validation in <% $.validations.id %>
        publish:
          status: SUCCESS

      set_status_failed:
        on-complete: send_message
        publish:
          status: FAILED

      send_message:
        action: zaqar.queue_post
        retry: count=5 delay=1
        input:
          queue_name: <% $.queue_name %>
          messages:
            body:
              type: tripleo.validations.v1.run_groups
              payload:
                group_names: <% $.group_names %>
                validation_names: <% $.validations.id %>
                plan: <% $.plan %>
                status: <% $.get('status', 'SUCCESS') %>
                execution: <% execution() %>

  list:
    input:
      - group_names: []
    tasks:
      find_validations:
        action: tripleo.validations.list_validations groups=<% $.group_names %>

  list_groups:
    tasks:
      find_groups:
        action: tripleo.validations.list_groups

  add_validation_ssh_key_parameter:
    input:
     - container<commit_msg>Fail the validation workflows when sending a "FAILED" message<commit_after>---
version: '2.0'
name: tripleo.validations.v1
description: TripleO Validations Workflows v1

workflows:

  run_validation:
    input:
      - validation_name
      - plan: overcloud
      - queue_name: tripleo

    tasks:

      notify_running:
        on-complete: run_validation
        action: zaqar.queue_post
        retry: count=5 delay=1
        input:
          queue_name: <% $.queue_name %>
          messages:
            body:
              type: tripleo.validations.v1.run_validation
              payload:
                validation_name: <% $.validation_name %>
                plan: <% $.plan %>
                status: RUNNING
                execution: <% execution() %>

      run_validation:
        on-success: send_message
        on-error: set_status_failed
        action: tripleo.validations.run_validation validation=<% $.validation_name %> plan=<% $.plan %>
        publish:
          status: SUCCESS
          stdout: <% task(run_validation).result.stdout %>
          stderr: <% task(run_validation).result.stderr %>

      set_status_failed:
        on-complete: send_message
        publish:
          status: FAILED
          stdout: <% task(run_validation).result.stdout %>
          stderr: <% task(run_validation).result.stderr %>

      send_message:
        action: zaqar.queue_post
        retry: count=5 delay=1
        input:
          queue_name: <% $.queue_name %>
          messages:
            body:
              type: tripleo.validations.v1.run_validation
              payload:
                validation_name: <% $.validation_name %>
                plan: <% $.plan %>
                status: <% $.get('status', 'SUCCESS') %>
                stdout: <% $.stdout %>
                stderr: <% $.stderr %>
                execution: <% execution() %>
        on-success:
          - fail_workflow: <% $.get('status') = "FAILED" %>

      fail_workflow:
        action: std.fail

  run_validations:
    input:
      - validation_names: []
      - plan: overcloud
      - queue_name: tripleo

    tasks:

      notify_running:
        on-complete: run_validations
        action: zaqar.queue_post
        retry: count=5 delay=1
        input:
          queue_name: <% $.queue_name %>
          messages:
            body:
              type: tripleo.validations.v1.run_validations
              payload:
                validation_names: <% $.validation_names %>
                plan: <% $.plan %>
                status: RUNNING
                execution: <% execution() %>

      run_validations:
        on-success: send_message
        on-error: set_status_failed
        workflow: tripleo.validations.v1.run_validation validation_name=<% $.validation %> plan=<% $.plan %> queue_name=<% $.queue_name %>
        with-items: validation in <% $.validation_names %>
        publish:
          status: SUCCESS

      set_status_failed:
        on-complete: send_message
        publish:
          status: FAILED

      send_message:
        action: zaqar.queue_post
        retry: count=5 delay=1
        input:
          queue_name: <% $.queue_name %>
          messages:
            body:
              type: tripleo.validations.v1.run_validations
              payload:
                validation_names: <% $.validation_names %>
                plan: <% $.plan %>
                status: <% $.get('status', 'SUCCESS') %>
                execution: <% execution() %>
        on-success:
          - fail_workflow: <% $.get('status') = "FAILED" %>

      fail_workflow:
        action: std.fail

  run_groups:
    input:
      - group_names: []
      - plan: overcloud
      - queue_name: tripleo

    tasks:

      find_validations:
        on-success: notify_running
        action: tripleo.validations.list_validations groups=<% $.group_names %>
        publish:
          validations: <% task(find_validations).result %>

      notify_running:
        on-complete: run_validation_group
        action: zaqar.queue_post
        retry: count=5 delay=1
        input:
          queue_name: <% $.queue_name %>
          messages:
            body:
              type: tripleo.validations.v1.run_validations
              payload:
                group_names: <% $.group_names %>
                validation_names: <% $.validations.id %>
                plan: <% $.plan %>
                status: RUNNING
                execution: <% execution() %>

      run_validation_group:
        on-success: send_message
        on-error: set_status_failed
        workflow: tripleo.validations.v1.run_validation validation_name=<% $.validation %> plan=<% $.plan %> queue_name=<% $.queue_name %>
        with-items: validation in <% $.validations.id %>
        publish:
          status: SUCCESS

      set_status_failed:
        on-complete: send_message
        publish:
          status: FAILED

      send_message:
        action: zaqar.queue_post
        retry: count=5 delay=1
        input:
          queue_name: <% $.queue_name %>
          messages:
            body:
              type: tripleo.validations.v1.run_groups
              payload:
                group_names: <% $.group_names %>
                validation_names: <% $.validations.id %>
                plan: <% $.plan %>
                status: <% $.get('status', 'SUCCESS') %>
                execution: <% execution() %>
        on-success:
          - fail_workflow: <% $.get('status') = "FAILED" %>

      fail_workflow:
        action: std.fail

  list:
    input:
      - group_names: []
    tasks:
      find_validations:
        action: tripleo.validations.list_validations groups=<% $.group_names %>

  list_groups:
    tasks:
      find_groups:
        action: tripleo.validations.list_groups

  add_validation_ssh_key_parameter:
    input:
     - container
{'fraction_non_alphanumeric': 0.10891352549889136, 'fraction_numerical': 0.004257206208425721, 'mean_word_length': 1.6828455864858434, 'pattern_counts': {'":': 0, '<': 102, '<?xml version=': 0, '>': 102, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4009355', 'n_tokens_mistral': 3319, 'n_tokens_neox': 3095, 'n_words': 610}