Files
pezkuwi-subxt/scripts/ci/changelog/templates/high_priority.md.tera
T
Chevdor 242c111099 WIP: Fix templates (#2204)
* WIP

* More fixes

* Add API section and various fixes
2023-02-17 15:15:26 +00:00

57 lines
1.8 KiB
Plaintext

{%- import "change.md.tera" as m_c -%}
{# This macro convert a priority level into readable output #}
{%- macro high_priority(p, changes) -%}
{# real globals don't work so we count the number of host functions here as well #}
{# unfortunately, the next snippet is duplicated in the host_functions.md.tera template #}
{# as well #}
{%- set_global host_fn_count = 0 -%}
{# We loop first to count the number of host functions but we do not display anything yet #}
{%- for pr in changes -%}
{%- if pr.meta.B and pr.meta.B.B0 -%}
{#- We skip silent ones -#}
{%- else -%}
{%- if pr.meta.E and pr.meta.E.E4 -%}
{%- set_global host_fn_count = host_fn_count + 1 -%}
{%- endif -%}
{%- endif -%}
{%- endfor -%}
{%- if p >= 5 or host_fn_count > 0 -%}
{%- set prio = "‼️ HIGH" -%}
{%- set text = "This is a **high priority** release and you must upgrade as as soon as possible." -%}
{%- elif p >= 3 -%}
{%- set prio = "❗️ Medium" -%}
{%- set text = "This is a medium priority release and you should upgrade in a timely manner." -%}
{%- else -%}
{%- set prio = "Low" -%}
{%- set text = "This is a low priority release and you may upgrade at your convenience." -%}
{%- endif -%}
<!-- detected max prio is: {{p}} -->
{% if prio -%}
{{prio}}: {{text}}
{%- else -%}
<!-- No relevant Priority label as been detected -->
{%- endif %}
{# We only show details if Medium or High #}
{%- if p >= 5 -%}
The changes motivating this priority level are:
{% for pr in changes | sort(attribute="merged_at") -%}
{%- if pr.meta.C -%}
{%- if pr.meta.C.agg.max >= p %}
- {{ m_c::change(c=pr) }}
{%- if pr.meta.B and pr.meta.B.B1 and pr.meta.T and pr.meta.T.T1 %}
(RUNTIME)
{% endif %}
{%- endif -%}
{%- endif -%}
{%- endfor %}
{%- endif %}
{%- endmacro priority -%}