diff --git a/polkadot/scripts/ci/changelog/Gemfile b/polkadot/scripts/ci/changelog/Gemfile index f2d7c3bd71..948e9ddaaf 100644 --- a/polkadot/scripts/ci/changelog/Gemfile +++ b/polkadot/scripts/ci/changelog/Gemfile @@ -16,6 +16,8 @@ gem 'optparse', '~> 0.1.1' gem 'logger', '~> 1.4' +gem 'changelogerator', '0.9.1' + gem 'test-unit', group: :dev gem 'rubocop', group: :dev, require: false diff --git a/polkadot/scripts/ci/changelog/Gemfile.lock b/polkadot/scripts/ci/changelog/Gemfile.lock index 855d7f91a5..8bad7ea9d8 100644 --- a/polkadot/scripts/ci/changelog/Gemfile.lock +++ b/polkadot/scripts/ci/changelog/Gemfile.lock @@ -4,6 +4,9 @@ GEM addressable (2.8.0) public_suffix (>= 2.0.2, < 5.0) ast (2.4.2) + changelogerator (0.9.1) + git_diff_parser (~> 3) + octokit (~> 4) faraday (1.8.0) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) @@ -64,8 +67,10 @@ GEM PLATFORMS x86_64-darwin-20 + x86_64-darwin-22 DEPENDENCIES + changelogerator (= 0.9.1) git_diff_parser (~> 3) logger (~> 1.4) octokit (~> 4) @@ -76,4 +81,4 @@ DEPENDENCIES toml (~> 0.3.0) BUNDLED WITH - 2.2.22 + 2.4.6 diff --git a/polkadot/scripts/ci/changelog/templates/change.md.tera b/polkadot/scripts/ci/changelog/templates/change.md.tera index 6d133439e2..0cb23226cc 100644 --- a/polkadot/scripts/ci/changelog/templates/change.md.tera +++ b/polkadot/scripts/ci/changelog/templates/change.md.tera @@ -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 -%} diff --git a/polkadot/scripts/ci/changelog/templates/changes.md.tera b/polkadot/scripts/ci/changelog/templates/changes.md.tera index 67124430ea..f598b2fe83 100644 --- a/polkadot/scripts/ci/changelog/templates/changes.md.tera +++ b/polkadot/scripts/ci/changelog/templates/changes.md.tera @@ -10,4 +10,6 @@ {% include "changes_runtime.md.tera" %} +{% include "changes_api.md.tera" %} + {% include "changes_misc.md.tera" %} diff --git a/polkadot/scripts/ci/changelog/templates/changes_api.md.tera b/polkadot/scripts/ci/changelog/templates/changes_api.md.tera new file mode 100644 index 0000000000..0096065e43 --- /dev/null +++ b/polkadot/scripts/ci/changelog/templates/changes_api.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 %} + + {%- endif -%} + {% endif -%} + {% endif -%} +{% endfor %} diff --git a/polkadot/scripts/ci/changelog/templates/changes_client.md.tera b/polkadot/scripts/ci/changelog/templates/changes_client.md.tera index 5c911407ac..20e7fe8fe7 100644 --- a/polkadot/scripts/ci/changelog/templates/changes_client.md.tera +++ b/polkadot/scripts/ci/changelog/templates/changes_client.md.tera @@ -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 %} + {%- endif -%} {% endif -%} {% endif -%} diff --git a/polkadot/scripts/ci/changelog/templates/changes_misc.md.tera b/polkadot/scripts/ci/changelog/templates/changes_misc.md.tera index 9c5662f70a..af38104f2d 100644 --- a/polkadot/scripts/ci/changelog/templates/changes_misc.md.tera +++ b/polkadot/scripts/ci/changelog/templates/changes_misc.md.tera @@ -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 -%} + +{%- 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 %} {% endif -%} +{% endif -%} diff --git a/polkadot/scripts/ci/changelog/templates/changes_runtime.md.tera b/polkadot/scripts/ci/changelog/templates/changes_runtime.md.tera index db7f6bff11..ccc44ef785 100644 --- a/polkadot/scripts/ci/changelog/templates/changes_runtime.md.tera +++ b/polkadot/scripts/ci/changelog/templates/changes_runtime.md.tera @@ -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 %} + {%- endif -%} {%- endif -%}