diff --git a/scripts/ci/changelog/Gemfile b/scripts/ci/changelog/Gemfile index 0a158d1d2426..46b058e3c500 100644 --- a/scripts/ci/changelog/Gemfile +++ b/scripts/ci/changelog/Gemfile @@ -16,9 +16,7 @@ gem 'optparse', '~> 0.1.1' gem 'logger', '~> 1.4' -# gem 'changelogerator', '0.9.1' -gem 'changelogerator', git: 'https://github.com/paritytech/changelogerator', ref: '0de7e512c6aafce348df16baf15d2433d4068260' - +gem 'changelogerator', '0.10.1' gem 'test-unit', group: :dev diff --git a/scripts/ci/changelog/Gemfile.lock b/scripts/ci/changelog/Gemfile.lock index abae4cdc3765..e8926b261bdb 100644 --- a/scripts/ci/changelog/Gemfile.lock +++ b/scripts/ci/changelog/Gemfile.lock @@ -13,6 +13,9 @@ GEM addressable (2.8.0) public_suffix (>= 2.0.2, < 5.0) ast (2.4.2) + changelogerator (0.10.1) + git_diff_parser (~> 3) + octokit (~> 4) faraday (1.8.0) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) @@ -76,7 +79,7 @@ PLATFORMS x86_64-darwin-22 DEPENDENCIES - changelogerator! + changelogerator (= 0.10.1) git_diff_parser (~> 3) logger (~> 1.4) octokit (~> 4) diff --git a/scripts/ci/changelog/bin/changelog b/scripts/ci/changelog/bin/changelog index 6627502b25be..e642a4489043 100755 --- a/scripts/ci/changelog/bin/changelog +++ b/scripts/ci/changelog/bin/changelog @@ -19,6 +19,9 @@ logger = Logger.new($stdout) logger.level = Logger::DEBUG logger.debug('Starting') +changelogerator_version = `changelogerator --version` +logger.debug(changelogerator_version) + owner = 'paritytech' repo = 'polkadot' diff --git a/scripts/ci/changelog/templates/change.md.tera b/scripts/ci/changelog/templates/change.md.tera index 0cb23226cc4c..cfde3be6e85f 100644 --- a/scripts/ci/changelog/templates/change.md.tera +++ b/scripts/ci/changelog/templates/change.md.tera @@ -1,11 +1,11 @@ {# This macro shows ONE change #} {%- macro change(c, cml="[C]", dot="[P]", sub="[S]") -%} -{%- if c.meta.C and c.meta.C.value >= 7 -%} +{%- if c.meta.C and c.meta.C.agg.max >= 7 -%} {%- set prio = " ‼️ HIGH" -%} -{%- elif c.meta.C and c.meta.C.value >= 3 -%} +{%- elif c.meta.C and c.meta.C.agg.max >= 3 -%} {%- set prio = " ❗️ Medium" -%} -{%- elif c.meta.C and c.meta.C.value < 3 -%} +{%- elif c.meta.C and c.meta.C.agg.max < 3 -%} {%- set prio = " Low" -%} {%- else -%} {%- set prio = "" -%} @@ -13,13 +13,13 @@ {%- set audit = "" -%} -{%- if c.meta.D and c.meta.D.value == 1 -%} +{%- if c.meta.D and c.meta.D.D1 -%} {%- set audit = "✅ audited " -%} -{%- elif c.meta.D and c.meta.D.value == 2 -%} +{%- elif c.meta.D and c.meta.D.D2 -%} {%- set audit = "✅ trivial " -%} -{%- elif c.meta.D and c.meta.D.value == 3 -%} +{%- elif c.meta.D and c.meta.D.D3 -%} {%- set audit = "✅ trivial " -%} -{%- elif c.meta.D and c.meta.D.value == 5 -%} +{%- elif c.meta.D and c.meta.D.D5 -%} {%- set audit = "⏳ pending non-critical audit " -%} {%- else -%} {%- set audit = "" -%} @@ -33,7 +33,7 @@ {%- set repo = " " -%} {%- endif -%} -{%- if c.meta.T and c.meta.T.value == 6 -%} +{%- if c.meta.T and c.meta.T.T6 -%} {%- set xcm = " [✉️ XCM]" -%} {%- else -%} {%- set xcm = "" -%} diff --git a/scripts/ci/changelog/templates/changes_api.md.tera b/scripts/ci/changelog/templates/changes_api.md.tera index 0096065e43e0..29e08b8cd382 100644 --- a/scripts/ci/changelog/templates/changes_api.md.tera +++ b/scripts/ci/changelog/templates/changes_api.md.tera @@ -5,14 +5,12 @@ {%- for pr in changes | sort(attribute="merged_at") %} {%- if pr.meta.B %} - {%- if pr.meta.B.value == 0 %} + {%- if pr.meta.B.B0 %} {#- We skip silent ones -#} {%- else -%} - {%- if pr.meta.T and pr.meta.T.value == 2 and not pr.title is containing("ompanion") %} + {%- if pr.meta.T and pr.meta.T.T2 and not pr.title is containing("ompanion") %} - {{ m_c::change(c=pr) }} -{%- else %} - {%- endif -%} {% endif -%} {% endif -%} diff --git a/scripts/ci/changelog/templates/changes_client.md.tera b/scripts/ci/changelog/templates/changes_client.md.tera index 20e7fe8fe7cb..6d31961c3650 100644 --- a/scripts/ci/changelog/templates/changes_client.md.tera +++ b/scripts/ci/changelog/templates/changes_client.md.tera @@ -5,14 +5,12 @@ {%- for pr in changes | sort(attribute="merged_at") %} {%- if pr.meta.B %} - {%- if pr.meta.B.value == 0 %} + {%- if pr.meta.B.B0 %} {#- We skip silent ones -#} {%- else -%} - {%- if pr.meta.T and pr.meta.T.value == 0 and not pr.title is containing("ompanion") %} + {%- if pr.meta.T and pr.meta.T.T0 and not pr.title is containing("ompanion") %} - {{ m_c::change(c=pr) }} -{%- else %} - {%- endif -%} {% endif -%} {% endif -%} diff --git a/scripts/ci/changelog/templates/changes_misc.md.tera b/scripts/ci/changelog/templates/changes_misc.md.tera index af38104f2db4..725b03081eb3 100644 --- a/scripts/ci/changelog/templates/changes_misc.md.tera +++ b/scripts/ci/changelog/templates/changes_misc.md.tera @@ -4,10 +4,10 @@ {#- First pass to count #} {%- for pr in changes -%} {%- if pr.meta.B %} - {%- if pr.meta.B.value == 0 -%} + {%- if pr.meta.B.B0 -%} {#- We skip silent ones -#} {%- else -%} - {%- if pr.meta.T and pr.meta.T.value > 2 %} + {%- if pr.meta.T and pr.meta.T.agg.max > 2 %} {%- set_global misc_count = misc_count + 1 -%} {%- endif -%} {% endif -%} @@ -26,10 +26,10 @@ There are other misc. changes. You can expand the list below to view them all. {#- The changes are sorted by merge date #} {%- for pr in changes | sort(attribute="merged_at") %} {%- if pr.meta.B and not pr.title is containing("ompanion") %} - {%- if pr.meta.B.value == 0 %} + {%- if pr.meta.B.B0 %} {#- We skip silent ones -#} {%- else -%} - {%- if pr.meta.T and pr.meta.T.value > 2 %} + {%- if pr.meta.T and pr.meta.T.agg.max > 2 %} - {{ m_c::change(c=pr) }} {%- endif -%} {% endif -%} diff --git a/scripts/ci/changelog/templates/changes_runtime.md.tera b/scripts/ci/changelog/templates/changes_runtime.md.tera index ccc44ef7852e..bd126c0628c4 100644 --- a/scripts/ci/changelog/templates/changes_runtime.md.tera +++ b/scripts/ci/changelog/templates/changes_runtime.md.tera @@ -6,14 +6,12 @@ {% for pr in changes | sort(attribute="merged_at") -%} {%- if pr.meta.B -%} -{%- if pr.meta.B.value == 0 -%} +{%- if pr.meta.B.B0 -%} {#- We skip silent ones -#} {%- else -%} -{%- if pr.meta.T and pr.meta.T.value == 1 and not pr.title is containing("ompanion") %} +{%- if pr.meta.T and pr.meta.T.T1 and not pr.title is containing("ompanion") %} - {{ m_c::change(c=pr) }} -{%- else %} - {%- endif -%} {%- endif -%} diff --git a/scripts/ci/changelog/templates/debug.md.tera b/scripts/ci/changelog/templates/debug.md.tera index 41f3702d7c01..8c829b09ffe2 100644 --- a/scripts/ci/changelog/templates/debug.md.tera +++ b/scripts/ci/changelog/templates/debug.md.tera @@ -1,4 +1,4 @@ -{%- set to_ignore = changes | filter(attribute="meta.B.value", value=0) %} +{%- set to_ignore = changes | filter(attribute="meta.B.B0") %}