Fix release notes templates (#6697)

* WIP

* Fix templates

- fix conditions to fetch misc PRs
- render the misc section only if required
- add html comment to help debugging
- add a new API section to T2 labels
This commit is contained in:
Chevdor
2023-02-10 17:12:45 +01:00
committed by GitHub
parent f81f1bae4c
commit f17ea2cdd0
8 changed files with 44 additions and 3 deletions
@@ -33,5 +33,11 @@
{%- set repo = " " -%}
{%- endif -%}
{%- if c.meta.T and c.meta.T.value == 6 -%}
{%- set xcm = " [✉️ XCM]" -%}
{%- else -%}
{%- set xcm = "" -%}
{%- endif -%}
{{- repo }} {{ audit }}[`#{{c.number}}`]({{c.html_url}}) {{- prio }} - {{ c.title | capitalize | truncate(length=120, end="…") }}{{xcm }}
{%- endmacro change -%}
@@ -10,4 +10,6 @@
{% include "changes_runtime.md.tera" %}
{% include "changes_api.md.tera" %}
{% include "changes_misc.md.tera" %}
@@ -0,0 +1,19 @@
{% import "change.md.tera" as m_c -%}
### API
{#- The changes are sorted by merge date #}
{%- for pr in changes | sort(attribute="merged_at") %}
{%- if pr.meta.B %}
{%- if pr.meta.B.value == 0 %}
{#- We skip silent ones -#}
{%- else -%}
{%- if pr.meta.T and pr.meta.T.value == 2 and not pr.title is containing("ompanion") %}
- {{ m_c::change(c=pr) }}
{%- else %}
<!-- EXCLUDED PR#{{pr.number}} - {{pr.html_url}} -->
{%- endif -%}
{% endif -%}
{% endif -%}
{% endfor %}
@@ -11,6 +11,8 @@
{%- if pr.meta.T and pr.meta.T.value == 0 and not pr.title is containing("ompanion") %}
- {{ m_c::change(c=pr) }}
{%- else %}
<!-- EXCLUDED PR#{{pr.number}} - {{pr.html_url}} -->
{%- endif -%}
{% endif -%}
{% endif -%}
@@ -7,13 +7,15 @@
{%- if pr.meta.B.value == 0 -%}
{#- We skip silent ones -#}
{%- else -%}
{%- if pr.meta.T and pr.meta.T.value == 0 %}
{%- if pr.meta.T and pr.meta.T.value > 2 %}
{%- set_global misc_count = misc_count + 1 -%}
{%- endif -%}
{% endif -%}
{% endif -%}
{% endfor -%}
<!-- Found {{ misc_count }} misc PRs -->
{%- if misc_count > 0 %}
### Misc
{% if misc_count > 10 %}
@@ -27,7 +29,7 @@ There are other misc. changes. You can expand the list below to view them all.
{%- if pr.meta.B.value == 0 %}
{#- We skip silent ones -#}
{%- else -%}
{%- if pr.meta.T and pr.meta.T.value == 0 %}
{%- if pr.meta.T and pr.meta.T.value > 2 %}
- {{ m_c::change(c=pr) }}
{%- endif -%}
{% endif -%}
@@ -37,3 +39,4 @@ There are other misc. changes. You can expand the list below to view them all.
{% if misc_count > 10 %}
</details>
{% endif -%}
{% endif -%}
@@ -12,6 +12,8 @@
{%- if pr.meta.T and pr.meta.T.value == 1 and not pr.title is containing("ompanion") %}
- {{ m_c::change(c=pr) }}
{%- else %}
<!-- EXCLUDED PR#{{pr.number}} - {{pr.html_url}} -->
{%- endif -%}
{%- endif -%}