From b552dc0967a7b74ddc2442849f8efe7fbb730eef Mon Sep 17 00:00:00 2001 From: joao-paulo-parity Date: Fri, 10 Feb 2023 15:42:45 -0300 Subject: [PATCH 01/12] update templates to upcoming context.json format --- scripts/ci/changelog/templates/change.md.tera | 16 ++++++++-------- .../changelog/templates/changes_client.md.tera | 4 ++-- .../ci/changelog/templates/changes_misc.md.tera | 9 +++++---- .../changelog/templates/changes_runtime.md.tera | 4 ++-- scripts/ci/changelog/templates/debug.md.tera | 2 +- .../ci/changelog/templates/high_priority.md.tera | 4 ++-- .../changelog/templates/host_functions.md.tera | 4 ++-- .../ci/changelog/templates/migrations-db.md.tera | 8 ++++---- .../templates/migrations-runtime.md.tera | 8 ++++---- 9 files changed, 30 insertions(+), 29 deletions(-) diff --git a/scripts/ci/changelog/templates/change.md.tera b/scripts/ci/changelog/templates/change.md.tera index 0cb23226cc4c..608af2e55b0a 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.D1 -%} {%- set audit = "✅ audited " -%} -{%- elif c.meta.D and c.meta.D.value == 2 -%} +{%- elif c.meta.D and c.meta.D2 -%} {%- set audit = "✅ trivial " -%} -{%- elif c.meta.D and c.meta.D.value == 3 -%} +{%- elif c.meta.D and c.meta.D3 -%} {%- set audit = "✅ trivial " -%} -{%- elif c.meta.D and c.meta.D.value == 5 -%} +{%- elif c.meta.D and c.meta.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.T6 -%} {%- set xcm = " [✉️ XCM]" -%} {%- else -%} {%- set xcm = "" -%} diff --git a/scripts/ci/changelog/templates/changes_client.md.tera b/scripts/ci/changelog/templates/changes_client.md.tera index 20e7fe8fe7cb..76ba30d89167 100644 --- a/scripts/ci/changelog/templates/changes_client.md.tera +++ b/scripts/ci/changelog/templates/changes_client.md.tera @@ -5,11 +5,11 @@ {%- for pr in changes | sort(attribute="merged_at") %} {%- if pr.meta.B %} - {%- if pr.meta.B.value == 0 %} + {%- if pr.meta.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.T0 and not pr.title is containing("ompanion") %} - {{ m_c::change(c=pr) }} {%- else %} diff --git a/scripts/ci/changelog/templates/changes_misc.md.tera b/scripts/ci/changelog/templates/changes_misc.md.tera index af38104f2db4..aa66434e4e0f 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.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,11 @@ 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.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 %} + {%- if pr.meta.T and pr.meta.T0 %} - {{ 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..c1857992b21e 100644 --- a/scripts/ci/changelog/templates/changes_runtime.md.tera +++ b/scripts/ci/changelog/templates/changes_runtime.md.tera @@ -6,11 +6,11 @@ {% for pr in changes | sort(attribute="merged_at") -%} {%- if pr.meta.B -%} -{%- if pr.meta.B.value == 0 -%} +{%- if pr.meta.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.T1 and not pr.title is containing("ompanion") %} - {{ m_c::change(c=pr) }} {%- else %} diff --git a/scripts/ci/changelog/templates/debug.md.tera b/scripts/ci/changelog/templates/debug.md.tera index 41f3702d7c01..4e5c9cd1c630 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.B0", value=0) %} diff --git a/scripts/ci/changelog/templates/changes_client.md.tera b/scripts/ci/changelog/templates/changes_client.md.tera index 76ba30d89167..6711f7f1f7c1 100644 --- a/scripts/ci/changelog/templates/changes_client.md.tera +++ b/scripts/ci/changelog/templates/changes_client.md.tera @@ -5,11 +5,11 @@ {%- for pr in changes | sort(attribute="merged_at") %} {%- if pr.meta.B %} - {%- if pr.meta.B0 %} + {%- if pr.meta.B.B0 %} {#- We skip silent ones -#} {%- else -%} - {%- if pr.meta.T and pr.meta.T0 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 %} diff --git a/scripts/ci/changelog/templates/changes_misc.md.tera b/scripts/ci/changelog/templates/changes_misc.md.tera index e2ebb7e700f2..725b03081eb3 100644 --- a/scripts/ci/changelog/templates/changes_misc.md.tera +++ b/scripts/ci/changelog/templates/changes_misc.md.tera @@ -4,7 +4,7 @@ {#- First pass to count #} {%- for pr in changes -%} {%- if pr.meta.B %} - {%- if pr.meta.B0 -%} + {%- if pr.meta.B.B0 -%} {#- We skip silent ones -#} {%- else -%} {%- if pr.meta.T and pr.meta.T.agg.max > 2 %} @@ -26,7 +26,7 @@ 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.B0 %} + {%- if pr.meta.B.B0 %} {#- We skip silent ones -#} {%- else -%} {%- if pr.meta.T and pr.meta.T.agg.max > 2 %} diff --git a/scripts/ci/changelog/templates/changes_runtime.md.tera b/scripts/ci/changelog/templates/changes_runtime.md.tera index c1857992b21e..6848b1958acf 100644 --- a/scripts/ci/changelog/templates/changes_runtime.md.tera +++ b/scripts/ci/changelog/templates/changes_runtime.md.tera @@ -6,11 +6,11 @@ {% for pr in changes | sort(attribute="merged_at") -%} {%- if pr.meta.B -%} -{%- if pr.meta.B0 -%} +{%- if pr.meta.B.B0 -%} {#- We skip silent ones -#} {%- else -%} -{%- if pr.meta.T and pr.meta.T1 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 %} diff --git a/scripts/ci/changelog/templates/high_priority.md.tera b/scripts/ci/changelog/templates/high_priority.md.tera index 86bd936516b9..39938da44d17 100644 --- a/scripts/ci/changelog/templates/high_priority.md.tera +++ b/scripts/ci/changelog/templates/high_priority.md.tera @@ -25,7 +25,7 @@ The changes motivating this priority level are: {%- if pr.meta.C -%} {%- if pr.meta.C.agg.max >= p %} - {{ m_c::change(c=pr) }} -{%- if pr.meta.T and pr.meta.T1 %} (RUNTIME) +{%- if pr.meta.T and pr.meta.T.T1 %} (RUNTIME) {% endif %} {%- endif -%} {%- endif -%} diff --git a/scripts/ci/changelog/templates/host_functions.md.tera b/scripts/ci/changelog/templates/host_functions.md.tera index 03b95ce81447..6d9d09a43dab 100644 --- a/scripts/ci/changelog/templates/host_functions.md.tera +++ b/scripts/ci/changelog/templates/host_functions.md.tera @@ -3,10 +3,10 @@ {% for pr in changes | sort(attribute="merged_at") -%} -{%- if pr.meta.B and pr.meta.B0 -%} +{%- if pr.meta.B and pr.meta.B.B0 -%} {#- We skip silent ones -#} {%- else -%} - {%- if pr.meta.E and pr.meta.E4 -%} + {%- if pr.meta.E and pr.meta.E.E4 -%} {%- set_global host_fn_count = host_fn_count + 1 -%} - {{ m_c::change(c=pr) }} {% endif -%} diff --git a/scripts/ci/changelog/templates/migrations-db.md.tera b/scripts/ci/changelog/templates/migrations-db.md.tera index efbce665a7f1..f70914aa8efd 100644 --- a/scripts/ci/changelog/templates/migrations-db.md.tera +++ b/scripts/ci/changelog/templates/migrations-db.md.tera @@ -1,9 +1,9 @@ {% import "change.md.tera" as m_c %} {%- set_global db_migration_count = 0 -%} {%- for pr in changes -%} - {%- if pr.meta.B and pr.meta.B0 %} + {%- if pr.meta.B and pr.meta.B.B0 %} {#- We skip silent ones -#} - {%- elif pr.meta.E and pr.meta.E2 -%} + {%- elif pr.meta.E and pr.meta.E.E2 -%} {%- set_global db_migration_count = db_migration_count + 1 -%} {%- endif -%} {%- endfor %} @@ -22,9 +22,9 @@ Some migrations may break compatibility, making a backup of your database is hig {%- endif %} {% for pr in changes | sort(attribute="merged_at") -%} -{%- if pr.meta.B and pr.meta.B0 %} +{%- if pr.meta.B and pr.meta.B.B0 %} {#- We skip silent ones -#} -{%- elif pr.meta.E and pr.meta.E2 -%} +{%- elif pr.meta.E and pr.meta.E.E2 -%} - {{ m_c::change(c=pr) }} {% endif -%} {% endfor -%} diff --git a/scripts/ci/changelog/templates/migrations-runtime.md.tera b/scripts/ci/changelog/templates/migrations-runtime.md.tera index 945a3021353f..1cd67f6cc560 100644 --- a/scripts/ci/changelog/templates/migrations-runtime.md.tera +++ b/scripts/ci/changelog/templates/migrations-runtime.md.tera @@ -1,9 +1,9 @@ {%- import "change.md.tera" as m_c %} {%- set_global runtime_migration_count = 0 -%} {%- for pr in changes -%} - {%- if pr.meta.B and pr.meta.B0 %} + {%- if pr.meta.B and pr.meta.B.B0 %} {#- We skip silent ones -#} - {%- elif pr.meta.E and pr.meta.E1 -%} + {%- elif pr.meta.E and pr.meta.E.E1 -%} {%- set_global runtime_migration_count = runtime_migration_count + 1 -%} {%- endif -%} {%- endfor %} @@ -21,9 +21,9 @@ Runtime migrations are operations running once during a runtime upgrade. {%- endif %} {% for pr in changes | sort(attribute="merged_at") -%} -{%- if pr.meta.B and pr.meta.B0 %} +{%- if pr.meta.B and pr.meta.B.B0 %} {#- We skip silent ones -#} -{%- elif pr.meta.E and pr.meta.E1 -%} +{%- elif pr.meta.E and pr.meta.E.E1 -%} - {{ m_c::change(c=pr) }} {% endif -%} {% endfor -%} From 2e26fdccc5fe3d0c4b1a04d1edb8c32daa184bec Mon Sep 17 00:00:00 2001 From: joao-paulo-parity Date: Wed, 15 Feb 2023 13:12:49 -0300 Subject: [PATCH 04/12] fix templates --- scripts/ci/changelog/templates/change.md.tera | 8 ++++---- scripts/ci/changelog/templates/debug.md.tera | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/ci/changelog/templates/change.md.tera b/scripts/ci/changelog/templates/change.md.tera index 608af2e55b0a..361337159859 100644 --- a/scripts/ci/changelog/templates/change.md.tera +++ b/scripts/ci/changelog/templates/change.md.tera @@ -13,13 +13,13 @@ {%- set audit = "" -%} -{%- if c.meta.D and c.meta.D1 -%} +{%- if c.meta.D and c.meta.D.D1 -%} {%- set audit = "✅ audited " -%} -{%- elif c.meta.D and c.meta.D2 -%} +{%- elif c.meta.D and c.meta.D.D2 -%} {%- set audit = "✅ trivial " -%} -{%- elif c.meta.D and c.meta.D3 -%} +{%- elif c.meta.D and c.meta.D.D3 -%} {%- set audit = "✅ trivial " -%} -{%- elif c.meta.D and c.meta.D5 -%} +{%- elif c.meta.D and c.meta.D.D5 -%} {%- set audit = "⏳ pending non-critical audit " -%} {%- else -%} {%- set audit = "" -%} diff --git a/scripts/ci/changelog/templates/debug.md.tera b/scripts/ci/changelog/templates/debug.md.tera index 4e5c9cd1c630..604e35e3d51b 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.B0", value=0) %} +{%- set to_ignore = changes | filter(attribute="meta.B.B0", value=0) %} {%- endif -%} {% endif -%} {% endif -%} diff --git a/scripts/ci/changelog/templates/changes_client.md.tera b/scripts/ci/changelog/templates/changes_client.md.tera index 6711f7f1f7c1..6d31961c3650 100644 --- a/scripts/ci/changelog/templates/changes_client.md.tera +++ b/scripts/ci/changelog/templates/changes_client.md.tera @@ -11,8 +11,6 @@ {%- 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_runtime.md.tera b/scripts/ci/changelog/templates/changes_runtime.md.tera index 6848b1958acf..bd126c0628c4 100644 --- a/scripts/ci/changelog/templates/changes_runtime.md.tera +++ b/scripts/ci/changelog/templates/changes_runtime.md.tera @@ -12,8 +12,6 @@ {%- if pr.meta.T and pr.meta.T.T1 and not pr.title is containing("ompanion") %} - {{ m_c::change(c=pr) }} -{%- else %} - {%- endif -%} {%- endif -%} From ba9433e7b17cc746e99f55eb04e7c0957ac1f140 Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Wed, 15 Feb 2023 17:20:12 +0100 Subject: [PATCH 09/12] WIP --- scripts/ci/changelog/Gemfile | 3 ++- scripts/ci/changelog/Gemfile.lock | 14 ++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/scripts/ci/changelog/Gemfile b/scripts/ci/changelog/Gemfile index 948e9ddaafcd..c5e994596fe0 100644 --- a/scripts/ci/changelog/Gemfile +++ b/scripts/ci/changelog/Gemfile @@ -16,7 +16,8 @@ gem 'optparse', '~> 0.1.1' gem 'logger', '~> 1.4' -gem 'changelogerator', '0.9.1' +#gem 'changelogerator', '0.9.1' +gem 'changelogerator', git: 'https://github.com/paritytech/changelogerator', ref: '0de7e512c6aafce348df16baf15d2433d4068260'\ gem 'test-unit', group: :dev diff --git a/scripts/ci/changelog/Gemfile.lock b/scripts/ci/changelog/Gemfile.lock index 8bad7ea9d8b2..abae4cdc3765 100644 --- a/scripts/ci/changelog/Gemfile.lock +++ b/scripts/ci/changelog/Gemfile.lock @@ -1,12 +1,18 @@ +GIT + remote: https://github.com/paritytech/changelogerator + revision: 0de7e512c6aafce348df16baf15d2433d4068260 + ref: 0de7e512c6aafce348df16baf15d2433d4068260 + specs: + changelogerator (0.10.0) + git_diff_parser (~> 3) + octokit (~> 4) + GEM remote: https://rubygems.org/ specs: 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) @@ -70,7 +76,7 @@ PLATFORMS x86_64-darwin-22 DEPENDENCIES - changelogerator (= 0.9.1) + changelogerator! git_diff_parser (~> 3) logger (~> 1.4) octokit (~> 4) From 284e050fad3b891d603a74393a51afd8abf1f58e Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Thu, 16 Feb 2023 09:14:36 +0100 Subject: [PATCH 10/12] Switch to changelogerator v0.10.1 --- scripts/ci/changelog/Gemfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/ci/changelog/Gemfile b/scripts/ci/changelog/Gemfile index c5e994596fe0..46b058e3c500 100644 --- a/scripts/ci/changelog/Gemfile +++ b/scripts/ci/changelog/Gemfile @@ -16,8 +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 From 4e13c9443cec44abd3904a713ae3f0f65af4b065 Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Thu, 16 Feb 2023 09:17:13 +0100 Subject: [PATCH 11/12] Update bundle deps --- scripts/ci/changelog/Gemfile.lock | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/scripts/ci/changelog/Gemfile.lock b/scripts/ci/changelog/Gemfile.lock index abae4cdc3765..422aa3a8844b 100644 --- a/scripts/ci/changelog/Gemfile.lock +++ b/scripts/ci/changelog/Gemfile.lock @@ -1,18 +1,12 @@ -GIT - remote: https://github.com/paritytech/changelogerator - revision: 0de7e512c6aafce348df16baf15d2433d4068260 - ref: 0de7e512c6aafce348df16baf15d2433d4068260 - specs: - changelogerator (0.10.0) - git_diff_parser (~> 3) - octokit (~> 4) - GEM remote: https://rubygems.org/ specs: 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 +70,7 @@ PLATFORMS x86_64-darwin-22 DEPENDENCIES - changelogerator! + changelogerator (= 0.10.1) git_diff_parser (~> 3) logger (~> 1.4) octokit (~> 4) From b2593a9bc1195485ed7c00ac48382d18928424be Mon Sep 17 00:00:00 2001 From: joao-paulo-parity Date: Thu, 16 Feb 2023 06:26:06 -0300 Subject: [PATCH 12/12] fix --- scripts/ci/changelog/templates/debug.md.tera | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ci/changelog/templates/debug.md.tera b/scripts/ci/changelog/templates/debug.md.tera index 604e35e3d51b..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.B0", value=0) %} +{%- set to_ignore = changes | filter(attribute="meta.B.B0") %}