{% macro git_material_link(material) -%}
{{ material.name }}
{%- endmacro %}
{% macro git_modification_link(modification, material) -%}
({{ modification.revision|truncate(7, true, '') }}
)
{%- endmacro %}
{% macro pipeline_material_link(pipeline_material) -%}
{{ pipeline_material.pipeline.title }}
{%- endmacro %}
{% macro pipeline_stage_link(pipeline, stage) -%}
{{ stage.name }}/{{ stage.counter }}
{%- endmacro %}
{% macro pipeline(pipeline, group_passed=False) %}
{%- if pipeline.git_material and not pipeline.pipeline_material %} Built changes from {{ git_material_link(pipeline.git_material) }} {{ git_modification_link(pipeline.git_material.modifications[0], pipeline.git_material) }}. {%- elif pipeline.pipeline_material and not pipeline.git_material %} Triggered by {{ pipeline_material_link(pipeline.pipeline_material) }}. {%- elif pipeline.pipeline_materials %} Triggered by {{ pipeline.pipeline_materials|length }} pipelines. {% else %}all No materials changed. {%- endif %}
{%- if pipeline.passed %} All stages passed. {%- elif pipeline.running %} Currently running stage {{ pipeline_stage_link(pipeline, pipeline.running_stage) }}. {%- elif pipeline.failed %} Failed on stage {{ pipeline_stage_link(pipeline, pipeline.failed_stage) }}. {%- endif %}