From e752f3012b897206dc287ea8f1b13c5e2b385163 Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Thu, 11 Nov 2021 21:09:24 +0100 Subject: [PATCH 01/46] WIP Release notes generation and templates --- scripts/changelog/.env | 7 +++ scripts/changelog/.gitignore | 3 + scripts/changelog/README.md | 64 +++++++++++++++++++-- scripts/changelog/changelog.sh | 55 +++++++++++++++--- scripts/changelog/digests/.gitignore | 1 + scripts/changelog/digests/.gitkeep | 0 scripts/changelog/templates/change.md | 27 +++++++++ scripts/changelog/templates/docker_image.md | 10 ++++ scripts/changelog/templates/runtimes.md | 12 ++++ scripts/changelog/templates/template.md | 13 +++++ 10 files changed, 181 insertions(+), 11 deletions(-) create mode 100644 scripts/changelog/.env create mode 100644 scripts/changelog/digests/.gitignore create mode 100644 scripts/changelog/digests/.gitkeep create mode 100644 scripts/changelog/templates/change.md create mode 100644 scripts/changelog/templates/docker_image.md create mode 100644 scripts/changelog/templates/runtimes.md create mode 100644 scripts/changelog/templates/template.md diff --git a/scripts/changelog/.env b/scripts/changelog/.env new file mode 100644 index 00000000000..93d7cab9902 --- /dev/null +++ b/scripts/changelog/.env @@ -0,0 +1,7 @@ +RUST_STABLE="1.55.0 (c8dfcfe04 2021-09-06)" +RUST_NIGHTLY="1.57.0-nightly (51e514c0f 2021-09-12)" +OWNER=paritytech +REPO=polkadot +REF1=v0.9.10 +REF2=v0.9.11 +PRE_RELEASE=true diff --git a/scripts/changelog/.gitignore b/scripts/changelog/.gitignore index 1a13c36382e..0bc0f0b1ed7 100644 --- a/scripts/changelog/.gitignore +++ b/scripts/changelog/.gitignore @@ -1 +1,4 @@ changelog.md +context.json +cumulus.json +release-notes*.md diff --git a/scripts/changelog/README.md b/scripts/changelog/README.md index 318e3a32e2f..8a79827fdd8 100644 --- a/scripts/changelog/README.md +++ b/scripts/changelog/README.md @@ -1,13 +1,69 @@ # Changelog -Currently, the changelog is built locally. -Run: +For now, a bit of preparation is required before you can run the script: +- fetch the srtool digests +- store them under the `digests` folder as `-srtool-digest.json` +- ensure the `.env` file is up to date with correct information + +The content of the release notes is generated from the template files under the `scripts/changelog/templates` folder. For readability and maintenance, the template is split into several small snippets. +Run: ``` -./changelog.sh +./bin/changelog [=HEAD] ``` For instance: ``` -./changelog.sh statemine_v4 +./bin/changelog statemine-v5.0.0 +``` + +A file called `release-notes.md` will be generated and can be used for the release. + +## ENV + +You may use the following ENV for testing: + +``` +RUSTC_STABLE="rustc 1.56.1 (59eed8a2a 2021-11-01)" +RUSTC_NIGHTLY="rustc 1.57.0-nightly (51e514c0f 2021-09-12)" +PRE_RELEASE=true +HIDE_SRTOOL_ROCOCO=true +HIDE_SRTOOL_SHELL=true +REF1=statemine-v5.0.0 +REF2=HEAD +DEBUG=1 +NO_CACHE=1 ``` +## Considered labels + +The following list will likely evolve over time and it will be hard to keep it in sync. +In any case, if you want to find all the labels that are used, search for `meta` in the templates. +Currently, the considered labels are: + +- Priority: C labels +- Audit: D labels +- E4 => new host function +- B0 => silent, not showing up +- B1-releasenotes (misc unless other labels) +- B5-client (client changes) +- B7-runtimenoteworthy (runtime changes) +- T6-XCM + +Note that labels with the same letter are mutually exclusive. +A PR should not have both `B0` and `B5`, or both `C1` and `C9`. In case of conflicts, the template will +decide which label will be considered. + +## Dev and debuggin + +### Hot Reload + +The following command allows **Hot Reload**: +``` +fswatch templates -e ".*\.md$" | xargs -n1 -I{} ./bin/changelog statemine-v5.0.0 +``` +### Caching + +By default, if the changelog data from Github is already present, the calls to the Github API will be skipped +and the local version of the data will be used. This is much faster. +If you know that some labels have changed in Github, you probably want to refresh the data. +You can then either delete manually the `cumulus.json` file or `export NO_CACHE=1` to force refreshing the data. diff --git a/scripts/changelog/changelog.sh b/scripts/changelog/changelog.sh index cf04e21c1f0..fde7a5d9348 100755 --- a/scripts/changelog/changelog.sh +++ b/scripts/changelog/changelog.sh @@ -1,11 +1,52 @@ #!/usr/bin/env bash -REF1=$1 +set -e -JSON=$(git log $REF1..HEAD \ - --pretty=format:'{ "commit": "%H", "short_sha": "%h", "author": "%an", "date": "%ad", "message": "%s"},' \ - $@ | \ - perl -pe 'BEGIN{print "{ \"since\": \"'${REF1}'\", \"commits\": ["}; END{print "]}"}' | \ - perl -pe 's/},]/}]/') +DIR=`dirname "$BASH_SOURCE"` +pushd $DIR -echo $JSON | tera --template templates/changelog.md --stdin | tee +# The following is fake and comes from CI +source .env + +# call for instance as: +# ./build-cl.sh statemine-v5.0.0 +OWNER=paritytech +REPO=cumulus +REF1=${1} +REF2=${2:-HEAD} + +CL_FILE=$REPO.json + +echo Using CL_FILE: $CL_FILE +echo Building changelog for $OWNER/$REPO between $REF1 and $REF2 + +export RUST_LOG=debug; + +# This is acting as cache so we don't spend time querying while testing +if [ ! -f "$CL_FILE" ]; then + echo Generating $CL_FILE + changelogerator $OWNER/$REPO -f $REF1 -t $REF2 > $CL_FILE +else + echo Re-using $CL_FILE +fi + +# Here we compose all the pieces together into one +# single big json file. +jq \ + --slurpfile srtool_rococo digests/rococo-srtool-digest.json \ + --slurpfile srtool_shell digests/shell-srtool-digest.json \ + --slurpfile srtool_westmint digests/westmint-srtool-digest.json \ + --slurpfile srtool_statemint digests/statemint-srtool-digest.json \ + --slurpfile srtool_statemine digests/statemine-srtool-digest.json \ + --slurpfile cl $CL_FILE \ + -n '{ cl: $cl[0], srtool: [ + { name: "rococo", data: $srtool_rococo[0] }, + { name: "shell", data: $srtool_shell[0] }, + { name: "westmint", data: $srtool_westmint[0] }, + { name: "statemint", data: $srtool_statemint[0] }, + { name: "statemine", data: $srtool_statemine[0] } + ] }' | tee context.json + +tera --env --env-key env --include-path templates --template templates/template.md context.json | tee release-notes-cumulus.md + +popd diff --git a/scripts/changelog/digests/.gitignore b/scripts/changelog/digests/.gitignore new file mode 100644 index 00000000000..a6c57f5fb2f --- /dev/null +++ b/scripts/changelog/digests/.gitignore @@ -0,0 +1 @@ +*.json diff --git a/scripts/changelog/digests/.gitkeep b/scripts/changelog/digests/.gitkeep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/scripts/changelog/templates/change.md b/scripts/changelog/templates/change.md new file mode 100644 index 00000000000..64b59ffdee9 --- /dev/null +++ b/scripts/changelog/templates/change.md @@ -0,0 +1,27 @@ +{%- macro change(c) -%} + +{%- if c.meta.C and c.meta.C.value >= 7-%} +{%- set prio = "❗️HIGH" -%} +{%- elif c.meta.C and c.meta.C.value >= 5 -%} +{%- set prio = "📣 Medium" -%} +{%- elif c.meta.C and c.meta.C.value >= 3 -%} +{%- set prio = "📌 Low" -%} +{%- else -%} +{%- set prio = "" -%} +{%- endif -%} + +{%- if c.meta.D and c.meta.D.value == 1-%} +{%- set audit = "✅ audtited" -%} +{%- elif c.meta.D and c.meta.D.value == 2 -%} +{%- set audit = "✅ trivial" -%} +{%- elif c.meta.D and c.meta.D.value == 3 -%} +{%- set audit = "✅ trivial" -%} +{%- elif c.meta.D and c.meta.D.value == 5 -%} +{%- set audit = "⏳ pending non-critical audit" -%} +{%- else -%} +{%- set audit = "" -%} +{%- endif -%} + + +{{ audit }} [`#{{c.number}}`]({{c.html_url}}) {{ prio }} - {{ c.title | capitalize }} +{%- endmacro change %} diff --git a/scripts/changelog/templates/docker_image.md b/scripts/changelog/templates/docker_image.md new file mode 100644 index 00000000000..f28a6d54b0c --- /dev/null +++ b/scripts/changelog/templates/docker_image.md @@ -0,0 +1,10 @@ + diff --git a/scripts/changelog/templates/runtimes.md b/scripts/changelog/templates/runtimes.md new file mode 100644 index 00000000000..5e36e48a801 --- /dev/null +++ b/scripts/changelog/templates/runtimes.md @@ -0,0 +1,12 @@ +## Runtimes + +{%- for runtime in srtool %} +### {{ runtime.name | capitalize }}: +``` +🏋️ Runtime Size: {{runtime.data.runtimes.compressed.subwasm.size | filesizeformat }} +🎁 Metadata version: V{{runtime.data.runtimes.compressed.subwasm.metadata_version }} +🔥 Core Version: {{runtime.data.runtimes.compressed.subwasm.core_version }} +🗳️ system.setCode hash: {{runtime.data.runtimes.compressed.subwasm.proposal_hash }} +``` + +{% endfor %} diff --git a/scripts/changelog/templates/template.md b/scripts/changelog/templates/template.md new file mode 100644 index 00000000000..d9ebc13b4c0 --- /dev/null +++ b/scripts/changelog/templates/template.md @@ -0,0 +1,13 @@ +{%- import "change.md" as m_c -%} + +# {{cl.repository.name | capitalize }} + +Our changelog has {{ cl.changes | length }} commits. + +{% for pr in cl.changes -%} +- {{ m_c::change(c=pr) }} +{% endfor %} + +{%- include "runtimes.md" -%} + +{%- include "docker_image.md" -%} From ac0be3ec09fcbaf80fbabe58570cf973c5e6f58a Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Thu, 11 Nov 2021 22:08:20 +0100 Subject: [PATCH 02/46] WIP Add new sections to the template --- scripts/changelog/templates/changes.md | 11 +++++++++++ scripts/changelog/templates/host_functions.md | 10 ++++++++++ scripts/changelog/templates/priority.md | 17 +++++++++++++++++ scripts/changelog/templates/runtimes.md | 7 +++++++ scripts/changelog/templates/template.md | 12 ++++-------- 5 files changed, 49 insertions(+), 8 deletions(-) create mode 100644 scripts/changelog/templates/changes.md create mode 100644 scripts/changelog/templates/host_functions.md create mode 100644 scripts/changelog/templates/priority.md diff --git a/scripts/changelog/templates/changes.md b/scripts/changelog/templates/changes.md new file mode 100644 index 00000000000..c3e384652ea --- /dev/null +++ b/scripts/changelog/templates/changes.md @@ -0,0 +1,11 @@ +{%- import "change.md" as m_c -%} + +## Changes + +You can find below the full list of the {{ cl.changes | length }} in this release. + + +{% for pr in cl.changes | sort(attribute="merged_at") %} +- {{ m_c::change(c=pr) }} +{% endfor %} + diff --git a/scripts/changelog/templates/host_functions.md b/scripts/changelog/templates/host_functions.md new file mode 100644 index 00000000000..7228fd4fb53 --- /dev/null +++ b/scripts/changelog/templates/host_functions.md @@ -0,0 +1,10 @@ +{%- if c.meta.E and c.meta.C.value == 4 -%} +## ⚠️ New Host functions + +The runtimes in this release contain new **host function**. That means it critical that +you update your client before the chain switches to the new runtimes. + +{%- else %} + +{%- endif %} + diff --git a/scripts/changelog/templates/priority.md b/scripts/changelog/templates/priority.md new file mode 100644 index 00000000000..20bd610dd4e --- /dev/null +++ b/scripts/changelog/templates/priority.md @@ -0,0 +1,17 @@ + +{%- if c.meta.C and c.meta.C.value >= 7-%} +{%- set prio = "❗️HIGH" -%} +{%- set txt = "You must upgrade as as soon as possible" -%} +{%- elif c.meta.C and c.meta.C.value >= 5 -%} +{%- set prio = "📣 Medium" -%} +{%- set txt = "You should upgrade in a timely manner" -%} +{%- elif c.meta.C and c.meta.C.value >= 3 -%} +{%- set prio = "📌 Low" -%} +{%- set txt = "You may upgrade at your convenience" -%} +{%- endif -%} + +{%- if prio %} +{{ prio }} {{ txt }} +{%- else %} + +{%- endif %} diff --git a/scripts/changelog/templates/runtimes.md b/scripts/changelog/templates/runtimes.md index 5e36e48a801..3fc7f388f5d 100644 --- a/scripts/changelog/templates/runtimes.md +++ b/scripts/changelog/templates/runtimes.md @@ -1,5 +1,12 @@ ## Runtimes +{% set rtm = srtool[0] -%} + +The runtimes included in this release can be found below. +They have been generated using: +- `{{ rtm.data.gen }}` +- `{{ rtm.data.rustc }}` + {%- for runtime in srtool %} ### {{ runtime.name | capitalize }}: ``` diff --git a/scripts/changelog/templates/template.md b/scripts/changelog/templates/template.md index d9ebc13b4c0..7b8812a5c50 100644 --- a/scripts/changelog/templates/template.md +++ b/scripts/changelog/templates/template.md @@ -1,13 +1,9 @@ -{%- import "change.md" as m_c -%} - # {{cl.repository.name | capitalize }} - -Our changelog has {{ cl.changes | length }} commits. - -{% for pr in cl.changes -%} -- {{ m_c::change(c=pr) }} -{% endfor %} +{% include "priority.md" -%} +{% include "host_functions.md" -%} {%- include "runtimes.md" -%} {%- include "docker_image.md" -%} + +{% include "changes.md" -%} From e5c0156bf1cb34063710b70b2922e48b5e81659b Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Fri, 12 Nov 2021 12:41:42 +0100 Subject: [PATCH 03/46] WIP renaming and wip --- scripts/changelog/.env | 2 + scripts/changelog/README.md | 42 ++++--------------- scripts/changelog/changelog.sh | 2 +- .../templates/{change.md => change.md.tera} | 3 +- .../templates/{changes.md => changes.md.tera} | 6 ++- .../{docker_image.md => docker_image.md.tera} | 1 + .../{priority.md => global_priority.md.tera} | 0 ...st_functions.md => host_functions.md.tera} | 1 + .../changelog/templates/pre_release.md.tera | 5 +++ scripts/changelog/templates/runtime.md.tera | 11 +++++ scripts/changelog/templates/runtimes.md | 19 --------- scripts/changelog/templates/runtimes.md.tera | 18 ++++++++ scripts/changelog/templates/template.md | 9 ---- scripts/changelog/templates/template.md.tera | 10 +++++ 14 files changed, 62 insertions(+), 67 deletions(-) rename scripts/changelog/templates/{change.md => change.md.tera} (85%) rename scripts/changelog/templates/{changes.md => changes.md.tera} (66%) rename scripts/changelog/templates/{docker_image.md => docker_image.md.tera} (99%) rename scripts/changelog/templates/{priority.md => global_priority.md.tera} (100%) rename scripts/changelog/templates/{host_functions.md => host_functions.md.tera} (83%) create mode 100644 scripts/changelog/templates/pre_release.md.tera create mode 100644 scripts/changelog/templates/runtime.md.tera delete mode 100644 scripts/changelog/templates/runtimes.md create mode 100644 scripts/changelog/templates/runtimes.md.tera delete mode 100644 scripts/changelog/templates/template.md create mode 100644 scripts/changelog/templates/template.md.tera diff --git a/scripts/changelog/.env b/scripts/changelog/.env index 93d7cab9902..fc89673f930 100644 --- a/scripts/changelog/.env +++ b/scripts/changelog/.env @@ -5,3 +5,5 @@ REPO=polkadot REF1=v0.9.10 REF2=v0.9.11 PRE_RELEASE=true +HIDE_SRTOOL_ROCOCO=true +HIDE_SRTOOL_SHELL=true diff --git a/scripts/changelog/README.md b/scripts/changelog/README.md index 8a79827fdd8..e166a2ec02d 100644 --- a/scripts/changelog/README.md +++ b/scripts/changelog/README.md @@ -1,5 +1,7 @@ # Changelog +Currently, the changelog is built locally. It will be moved to CI once labels stabilize. + For now, a bit of preparation is required before you can run the script: - fetch the srtool digests - store them under the `digests` folder as `-srtool-digest.json` @@ -9,31 +11,16 @@ The content of the release notes is generated from the template files under the Run: ``` -./bin/changelog [=HEAD] +./changelog.sh [=HEAD] ``` For instance: ``` -./bin/changelog statemine-v5.0.0 +./changelog.sh statemine-v5.0.0 ``` -A file called `release-notes.md` will be generated and can be used for the release. - -## ENV +A file called `release-notes-cumulus.md` will be generated and can be used for the release. -You may use the following ENV for testing: - -``` -RUSTC_STABLE="rustc 1.56.1 (59eed8a2a 2021-11-01)" -RUSTC_NIGHTLY="rustc 1.57.0-nightly (51e514c0f 2021-09-12)" -PRE_RELEASE=true -HIDE_SRTOOL_ROCOCO=true -HIDE_SRTOOL_SHELL=true -REF1=statemine-v5.0.0 -REF2=HEAD -DEBUG=1 -NO_CACHE=1 -``` ## Considered labels The following list will likely evolve over time and it will be hard to keep it in sync. @@ -45,25 +32,10 @@ Currently, the considered labels are: - E4 => new host function - B0 => silent, not showing up - B1-releasenotes (misc unless other labels) -- B5-client (client changes) - B7-runtimenoteworthy (runtime changes) -- T6-XCM +- B5-client (client changes) +- B6-XCM Note that labels with the same letter are mutually exclusive. A PR should not have both `B0` and `B5`, or both `C1` and `C9`. In case of conflicts, the template will decide which label will be considered. - -## Dev and debuggin - -### Hot Reload - -The following command allows **Hot Reload**: -``` -fswatch templates -e ".*\.md$" | xargs -n1 -I{} ./bin/changelog statemine-v5.0.0 -``` -### Caching - -By default, if the changelog data from Github is already present, the calls to the Github API will be skipped -and the local version of the data will be used. This is much faster. -If you know that some labels have changed in Github, you probably want to refresh the data. -You can then either delete manually the `cumulus.json` file or `export NO_CACHE=1` to force refreshing the data. diff --git a/scripts/changelog/changelog.sh b/scripts/changelog/changelog.sh index fde7a5d9348..a899413665b 100755 --- a/scripts/changelog/changelog.sh +++ b/scripts/changelog/changelog.sh @@ -47,6 +47,6 @@ jq \ { name: "statemine", data: $srtool_statemine[0] } ] }' | tee context.json -tera --env --env-key env --include-path templates --template templates/template.md context.json | tee release-notes-cumulus.md +tera --env --env-key env --include-path templates --template templates/template.md.tera context.json | tee release-notes-cumulus.md popd diff --git a/scripts/changelog/templates/change.md b/scripts/changelog/templates/change.md.tera similarity index 85% rename from scripts/changelog/templates/change.md rename to scripts/changelog/templates/change.md.tera index 64b59ffdee9..1a4b305ceb7 100644 --- a/scripts/changelog/templates/change.md +++ b/scripts/changelog/templates/change.md.tera @@ -1,3 +1,4 @@ +{# This macro shows ONE change #} {%- macro change(c) -%} {%- if c.meta.C and c.meta.C.value >= 7-%} @@ -23,5 +24,5 @@ {%- endif -%} -{{ audit }} [`#{{c.number}}`]({{c.html_url}}) {{ prio }} - {{ c.title | capitalize }} +{{ audit }} [`#{{c.number}}`]({{c.html_url}}) {{- prio }} - {{ c.title | capitalize }} {%- endmacro change %} diff --git a/scripts/changelog/templates/changes.md b/scripts/changelog/templates/changes.md.tera similarity index 66% rename from scripts/changelog/templates/changes.md rename to scripts/changelog/templates/changes.md.tera index c3e384652ea..bc9dfe2d2c3 100644 --- a/scripts/changelog/templates/changes.md +++ b/scripts/changelog/templates/changes.md.tera @@ -1,8 +1,10 @@ -{%- import "change.md" as m_c -%} +{# This include generates the section showing the changes #} + +{%- import "change.md.tera" as m_c -%} ## Changes -You can find below the full list of the {{ cl.changes | length }} in this release. +You can find below the full list of the {{ cl.changes | length }} changes in this release. {% for pr in cl.changes | sort(attribute="merged_at") %} diff --git a/scripts/changelog/templates/docker_image.md b/scripts/changelog/templates/docker_image.md.tera similarity index 99% rename from scripts/changelog/templates/docker_image.md rename to scripts/changelog/templates/docker_image.md.tera index f28a6d54b0c..b7f7485cb60 100644 --- a/scripts/changelog/templates/docker_image.md +++ b/scripts/changelog/templates/docker_image.md.tera @@ -8,3 +8,4 @@ You may also pull it with: docker pull parity/polkadot-collator:latest ``` --> + diff --git a/scripts/changelog/templates/priority.md b/scripts/changelog/templates/global_priority.md.tera similarity index 100% rename from scripts/changelog/templates/priority.md rename to scripts/changelog/templates/global_priority.md.tera diff --git a/scripts/changelog/templates/host_functions.md b/scripts/changelog/templates/host_functions.md.tera similarity index 83% rename from scripts/changelog/templates/host_functions.md rename to scripts/changelog/templates/host_functions.md.tera index 7228fd4fb53..34d337d2d8f 100644 --- a/scripts/changelog/templates/host_functions.md +++ b/scripts/changelog/templates/host_functions.md.tera @@ -6,5 +6,6 @@ you update your client before the chain switches to the new runtimes. {%- else %} +ℹ️ This release does not contain any new host function. {%- endif %} diff --git a/scripts/changelog/templates/pre_release.md.tera b/scripts/changelog/templates/pre_release.md.tera new file mode 100644 index 00000000000..cebd696131b --- /dev/null +++ b/scripts/changelog/templates/pre_release.md.tera @@ -0,0 +1,5 @@ +{% if env.PRE_RELEASE == "true" %} +⚠️ Howdy! Beware, this is a **pre-release** +{% else %} + +{% endif %} \ No newline at end of file diff --git a/scripts/changelog/templates/runtime.md.tera b/scripts/changelog/templates/runtime.md.tera new file mode 100644 index 00000000000..7643fc6616f --- /dev/null +++ b/scripts/changelog/templates/runtime.md.tera @@ -0,0 +1,11 @@ +{# This macro shows one runtime #} +{%- macro runtime(runtime) -%} + +### {{ runtime.name | capitalize }}: +``` +🏋️ Runtime Size: {{ runtime.data.runtimes.compressed.subwasm.size | filesizeformat }} +🎁 Metadata version: V{{ runtime.data.runtimes.compressed.subwasm.metadata_version }} +🔥 Core Version: {{ runtime.data.runtimes.compressed.subwasm.core_version }} +🗳️ system.setCode hash: {{ runtime.data.runtimes.compressed.subwasm.proposal_hash }} +``` +{%- endmacro runtime %} diff --git a/scripts/changelog/templates/runtimes.md b/scripts/changelog/templates/runtimes.md deleted file mode 100644 index 3fc7f388f5d..00000000000 --- a/scripts/changelog/templates/runtimes.md +++ /dev/null @@ -1,19 +0,0 @@ -## Runtimes - -{% set rtm = srtool[0] -%} - -The runtimes included in this release can be found below. -They have been generated using: -- `{{ rtm.data.gen }}` -- `{{ rtm.data.rustc }}` - -{%- for runtime in srtool %} -### {{ runtime.name | capitalize }}: -``` -🏋️ Runtime Size: {{runtime.data.runtimes.compressed.subwasm.size | filesizeformat }} -🎁 Metadata version: V{{runtime.data.runtimes.compressed.subwasm.metadata_version }} -🔥 Core Version: {{runtime.data.runtimes.compressed.subwasm.core_version }} -🗳️ system.setCode hash: {{runtime.data.runtimes.compressed.subwasm.proposal_hash }} -``` - -{% endfor %} diff --git a/scripts/changelog/templates/runtimes.md.tera b/scripts/changelog/templates/runtimes.md.tera new file mode 100644 index 00000000000..116e581ab85 --- /dev/null +++ b/scripts/changelog/templates/runtimes.md.tera @@ -0,0 +1,18 @@ +{# This include shows the list and details of the runtimes #} +{%- import "runtime.md.tera" as m_r -%} + +## Runtimes + +{% set rtm = srtool[0] -%} + +The Details about the runtimes included in this release can be found below. +They have been generated using [srtool](https://github.com/paritytech/srtool): +- `{{ rtm.data.gen }}` +- `{{ rtm.data.rustc }}` + +{%- for runtime in srtool | sort(attribute="name") %} +{% set HIDE_VAR = "HIDE_SRTOOL_" ~ runtime.name | upper %} +{% if not env is containing(HIDE_VAR) %} +{{ m_r::runtime(runtime=runtime) }} +{% endif %} +{% endfor %} diff --git a/scripts/changelog/templates/template.md b/scripts/changelog/templates/template.md deleted file mode 100644 index 7b8812a5c50..00000000000 --- a/scripts/changelog/templates/template.md +++ /dev/null @@ -1,9 +0,0 @@ -# {{cl.repository.name | capitalize }} -{% include "priority.md" -%} -{% include "host_functions.md" -%} - -{%- include "runtimes.md" -%} - -{%- include "docker_image.md" -%} - -{% include "changes.md" -%} diff --git a/scripts/changelog/templates/template.md.tera b/scripts/changelog/templates/template.md.tera new file mode 100644 index 00000000000..700f5352876 --- /dev/null +++ b/scripts/changelog/templates/template.md.tera @@ -0,0 +1,10 @@ +# {{cl.repository.name | capitalize }} +{% include "pre_release.md.tera" -%} +{% include "global_priority.md.tera" -%} +{% include "host_functions.md.tera" -%} + +{% include "runtimes.md.tera" -%} + +{% include "docker_image.md.tera" -%} + +{% include "changes.md.tera" -%} From a85432f2ed8f9ff3f445c373b4768100346ccc21 Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Fri, 12 Nov 2021 13:07:58 +0100 Subject: [PATCH 04/46] Fix runtime template --- scripts/changelog/README.md | 2 +- scripts/changelog/templates/change.md.tera | 7 ++++++- scripts/changelog/templates/runtime.md.tera | 21 +++++++++++++++++---- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/scripts/changelog/README.md b/scripts/changelog/README.md index e166a2ec02d..14469fe00c3 100644 --- a/scripts/changelog/README.md +++ b/scripts/changelog/README.md @@ -34,7 +34,7 @@ Currently, the considered labels are: - B1-releasenotes (misc unless other labels) - B7-runtimenoteworthy (runtime changes) - B5-client (client changes) -- B6-XCM +- T6-XCM Note that labels with the same letter are mutually exclusive. A PR should not have both `B0` and `B5`, or both `C1` and `C9`. In case of conflicts, the template will diff --git a/scripts/changelog/templates/change.md.tera b/scripts/changelog/templates/change.md.tera index 1a4b305ceb7..e66fa0d04d2 100644 --- a/scripts/changelog/templates/change.md.tera +++ b/scripts/changelog/templates/change.md.tera @@ -23,6 +23,11 @@ {%- set audit = "" -%} {%- endif -%} +{%- if c.meta.T and c.meta.T.value == 6 -%} +{%- set xcm = "⛓ XCM" -%} +{%- else -%} +{%- set xcm = "" -%} +{%- endif -%} -{{ audit }} [`#{{c.number}}`]({{c.html_url}}) {{- prio }} - {{ c.title | capitalize }} +{{ audit }} {{- xcm }} [`#{{c.number}}`]({{c.html_url}}) {{- prio }} - {{ c.title | capitalize }} {%- endmacro change %} diff --git a/scripts/changelog/templates/runtime.md.tera b/scripts/changelog/templates/runtime.md.tera index 7643fc6616f..c333bdefc74 100644 --- a/scripts/changelog/templates/runtime.md.tera +++ b/scripts/changelog/templates/runtime.md.tera @@ -2,10 +2,23 @@ {%- macro runtime(runtime) -%} ### {{ runtime.name | capitalize }}: + +{%- if runtime.data.runtimes.compressed.subwasm.compression.compressed %} +{%- set compressed = "Yes" %} +{%- else %} +{%- set compressed = "No" %} +{%- endif %} + +{%- set comp_ratio = 100 - (runtime.data.runtimes.compressed.subwasm.compression.size_compressed / runtime.data.runtimes.compressed.subwasm.compression.size_decompressed *100) %} ``` -🏋️ Runtime Size: {{ runtime.data.runtimes.compressed.subwasm.size | filesizeformat }} -🎁 Metadata version: V{{ runtime.data.runtimes.compressed.subwasm.metadata_version }} -🔥 Core Version: {{ runtime.data.runtimes.compressed.subwasm.core_version }} -🗳️ system.setCode hash: {{ runtime.data.runtimes.compressed.subwasm.proposal_hash }} +🏋️ Runtime Size: {{ runtime.data.runtimes.compressed.subwasm.size | filesizeformat }} ({{ runtime.data.runtimes.compressed.subwasm.size }} bytes) +🔥 Core Version: statemine-600 (statemine-0.tx4.au1) +🗜 Compressed: {{ compressed }}, {{ comp_ratio | round(method="ceil", precision=2) }} % +🎁 Metadata version: V{{ runtime.data.runtimes.compressed.subwasm.metadata_version }} +🔥 Core Version: {{ runtime.data.runtimes.compressed.subwasm.core_version }} +🗳️ system.setCode hash: {{ runtime.data.runtimes.compressed.subwasm.proposal_hash }} +🗳️ authorizeUpgrade hash: {{ runtime.data.runtimes.compressed.subwasm.parachain_authorize_upgrade_hash }} +#️⃣ Blake2-256 hash: {{ runtime.data.runtimes.compressed.subwasm.blake2_256 }} +📦 IPFS: {{ runtime.data.runtimes.compressed.subwasm.ipfs_hash }} ``` {%- endmacro runtime %} From d42130b9eaf315f03e638c0e2167c89b37e4e15e Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Fri, 12 Nov 2021 16:13:08 +0100 Subject: [PATCH 05/46] Add doc, NO_CACHE and tweaking of the templates --- scripts/changelog/README.md | 15 +++++++++++++++ scripts/changelog/changelog.sh | 7 ++++++- scripts/changelog/templates/change.md.tera | 17 ++++++++--------- scripts/changelog/templates/changes.md.tera | 12 ++++++++---- scripts/changelog/templates/debug.md.tera | 5 +++++ scripts/changelog/templates/migrations.md.tera | 13 +++++++++++++ scripts/changelog/templates/runtime.md.tera | 6 ++---- scripts/changelog/templates/runtimes.md.tera | 9 +++++---- scripts/changelog/templates/template.md.tera | 11 +++++++++-- 9 files changed, 71 insertions(+), 24 deletions(-) create mode 100644 scripts/changelog/templates/debug.md.tera create mode 100644 scripts/changelog/templates/migrations.md.tera diff --git a/scripts/changelog/README.md b/scripts/changelog/README.md index 14469fe00c3..78ace096f51 100644 --- a/scripts/changelog/README.md +++ b/scripts/changelog/README.md @@ -39,3 +39,18 @@ Currently, the considered labels are: Note that labels with the same letter are mutually exclusive. A PR should not have both `B0` and `B5`, or both `C1` and `C9`. In case of conflicts, the template will decide which label will be considered. + +## Dev and debuggin + +### Hot Reload + +The following command allows **Hot Reload**: +``` +fswatch templates -e ".*\.md$" | xargs -n1 -I{} ./changelog.sh statemine-v5.0.0 +``` +### Caching + +By default, if the changelog data from Github is already present, the calls to the Github API will be skipped +and the local version of the data will be used. This is much faster. +If you know that some labels have changed in Github, you probably want to refresh the data. +You can then either delete manually the `cumulus.json` file or `export NO_CACHE=1` to force refreshing the data. diff --git a/scripts/changelog/changelog.sh b/scripts/changelog/changelog.sh index a899413665b..40e5c4990b5 100755 --- a/scripts/changelog/changelog.sh +++ b/scripts/changelog/changelog.sh @@ -10,6 +10,7 @@ source .env # call for instance as: # ./build-cl.sh statemine-v5.0.0 +# you may set the ENV NO_CACHE to force a reload OWNER=paritytech REPO=cumulus REF1=${1} @@ -22,8 +23,12 @@ echo Building changelog for $OWNER/$REPO between $REF1 and $REF2 export RUST_LOG=debug; +if [[ ${NO_CACHE} ]]; then + echo NO_CACHE set +fi + # This is acting as cache so we don't spend time querying while testing -if [ ! -f "$CL_FILE" ]; then +if [[ ${NO_CACHE} || ! -f "$CL_FILE" ]]; then echo Generating $CL_FILE changelogerator $OWNER/$REPO -f $REF1 -t $REF2 > $CL_FILE else diff --git a/scripts/changelog/templates/change.md.tera b/scripts/changelog/templates/change.md.tera index e66fa0d04d2..ee043c08dfd 100644 --- a/scripts/changelog/templates/change.md.tera +++ b/scripts/changelog/templates/change.md.tera @@ -1,7 +1,7 @@ {# This macro shows ONE change #} {%- macro change(c) -%} -{%- if c.meta.C and c.meta.C.value >= 7-%} +{%- if c.meta.C and c.meta.C.value >= 7 -%} {%- set prio = "❗️HIGH" -%} {%- elif c.meta.C and c.meta.C.value >= 5 -%} {%- set prio = "📣 Medium" -%} @@ -11,14 +11,14 @@ {%- set prio = "" -%} {%- endif -%} -{%- if c.meta.D and c.meta.D.value == 1-%} -{%- set audit = "✅ audtited" -%} +{%- if c.meta.D and c.meta.D.value == 1 -%} +{%- set audit = "✅ audtited " -%} {%- elif c.meta.D and c.meta.D.value == 2 -%} -{%- set audit = "✅ trivial" -%} +{%- set audit = "✅ trivial " -%} {%- elif c.meta.D and c.meta.D.value == 3 -%} -{%- set audit = "✅ trivial" -%} +{%- set audit = "✅ trivial " -%} {%- elif c.meta.D and c.meta.D.value == 5 -%} -{%- set audit = "⏳ pending non-critical audit" -%} +{%- set audit = "⏳ pending non-critical audit " -%} {%- else -%} {%- set audit = "" -%} {%- endif -%} @@ -28,6 +28,5 @@ {%- else -%} {%- set xcm = "" -%} {%- endif -%} - -{{ audit }} {{- xcm }} [`#{{c.number}}`]({{c.html_url}}) {{- prio }} - {{ c.title | capitalize }} -{%- endmacro change %} +{{- audit }}[`#{{c.number}}`]({{c.html_url}}) {{- prio }} - {{ c.title | capitalize | truncate(length=60, end="…") }} {{xcm }} +{%- endmacro change -%} diff --git a/scripts/changelog/templates/changes.md.tera b/scripts/changelog/templates/changes.md.tera index bc9dfe2d2c3..559b38c255d 100644 --- a/scripts/changelog/templates/changes.md.tera +++ b/scripts/changelog/templates/changes.md.tera @@ -4,10 +4,14 @@ ## Changes -You can find below the full list of the {{ cl.changes | length }} changes in this release. - -{% for pr in cl.changes | sort(attribute="merged_at") %} -- {{ m_c::change(c=pr) }} +{# The changes are sorted by merge date #} +{%- for pr in cl.changes | sort(attribute="merged_at") %} + +{%- if pr.meta.B and pr.meta.B.value == 0 %} +{#- We skip silent ones -#} +{%- else -%} +1. {{ m_c::change(c=pr) }} +{% endif -%} {% endfor %} diff --git a/scripts/changelog/templates/debug.md.tera b/scripts/changelog/templates/debug.md.tera new file mode 100644 index 00000000000..9595cab4949 --- /dev/null +++ b/scripts/changelog/templates/debug.md.tera @@ -0,0 +1,5 @@ +---- +## Debug + + +---- diff --git a/scripts/changelog/templates/migrations.md.tera b/scripts/changelog/templates/migrations.md.tera new file mode 100644 index 00000000000..c8644d2ab6a --- /dev/null +++ b/scripts/changelog/templates/migrations.md.tera @@ -0,0 +1,13 @@ +{%- import "change.md.tera" as m_c -%} +## Migrations + +{% for pr in cl.changes | sort(attribute="merged_at") -%} + +{%- if pr.meta.B and pr.meta.B.value == 0 %} +{#- We skip silent ones -#} +{%- else -%} +{%- if pr.meta.E and pr.meta.E.value == 1 -%} +- {{ m_c::change(c=pr) }} +{% endif -%} +{% endif -%} +{% endfor -%} diff --git a/scripts/changelog/templates/runtime.md.tera b/scripts/changelog/templates/runtime.md.tera index c333bdefc74..cdde8efcaae 100644 --- a/scripts/changelog/templates/runtime.md.tera +++ b/scripts/changelog/templates/runtime.md.tera @@ -1,7 +1,7 @@ {# This macro shows one runtime #} {%- macro runtime(runtime) -%} -### {{ runtime.name | capitalize }}: +### {{ runtime.name | capitalize }}: `{{ runtime.data.runtimes.compressed.subwasm.core_version }} -V{{ runtime.data.runtimes.compressed.subwasm.metadata_version }}` {%- if runtime.data.runtimes.compressed.subwasm.compression.compressed %} {%- set compressed = "Yes" %} @@ -13,9 +13,7 @@ ``` 🏋️ Runtime Size: {{ runtime.data.runtimes.compressed.subwasm.size | filesizeformat }} ({{ runtime.data.runtimes.compressed.subwasm.size }} bytes) 🔥 Core Version: statemine-600 (statemine-0.tx4.au1) -🗜 Compressed: {{ compressed }}, {{ comp_ratio | round(method="ceil", precision=2) }} % -🎁 Metadata version: V{{ runtime.data.runtimes.compressed.subwasm.metadata_version }} -🔥 Core Version: {{ runtime.data.runtimes.compressed.subwasm.core_version }} +🗜 Compressed: {{ compressed }}: {{ comp_ratio | round(method="ceil", precision=2) }}% 🗳️ system.setCode hash: {{ runtime.data.runtimes.compressed.subwasm.proposal_hash }} 🗳️ authorizeUpgrade hash: {{ runtime.data.runtimes.compressed.subwasm.parachain_authorize_upgrade_hash }} #️⃣ Blake2-256 hash: {{ runtime.data.runtimes.compressed.subwasm.blake2_256 }} diff --git a/scripts/changelog/templates/runtimes.md.tera b/scripts/changelog/templates/runtimes.md.tera index 116e581ab85..1e855d15287 100644 --- a/scripts/changelog/templates/runtimes.md.tera +++ b/scripts/changelog/templates/runtimes.md.tera @@ -11,8 +11,9 @@ They have been generated using [srtool](https://github.com/paritytech/srtool): - `{{ rtm.data.rustc }}` {%- for runtime in srtool | sort(attribute="name") %} -{% set HIDE_VAR = "HIDE_SRTOOL_" ~ runtime.name | upper %} -{% if not env is containing(HIDE_VAR) %} +{%- set HIDE_VAR = "HIDE_SRTOOL_" ~ runtime.name | upper %} +{%- if not env is containing(HIDE_VAR) %} + {{ m_r::runtime(runtime=runtime) }} -{% endif %} -{% endfor %} +{%- endif %} +{%- endfor %} diff --git a/scripts/changelog/templates/template.md.tera b/scripts/changelog/templates/template.md.tera index 700f5352876..9c62f83d526 100644 --- a/scripts/changelog/templates/template.md.tera +++ b/scripts/changelog/templates/template.md.tera @@ -1,10 +1,17 @@ +{# This is the entry point of the template -#} + # {{cl.repository.name | capitalize }} + +{# {%- include "debug.md.tera" -%} #} +{# header warning and important notices -#} {% include "pre_release.md.tera" -%} {% include "global_priority.md.tera" -%} {% include "host_functions.md.tera" -%} -{% include "runtimes.md.tera" -%} +{% include "migrations.md.tera" -%} -{% include "docker_image.md.tera" -%} +{% include "runtimes.md.tera" -%} {% include "changes.md.tera" -%} + +{% include "docker_image.md.tera" -%} From e8f3ef03f0f88e90720859ef675b829b426c0531 Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Fri, 12 Nov 2021 17:56:34 +0100 Subject: [PATCH 06/46] WIP --- scripts/changelog/README.md | 2 +- scripts/changelog/templates/change.md.tera | 7 +++-- scripts/changelog/templates/changes.md.tera | 17 +++--------- .../templates/changes_client.md.tera | 17 ++++++++++++ .../changelog/templates/changes_misc.md.tera | 27 +++++++++++++++++++ .../templates/changes_runtime.md.tera | 19 +++++++++++++ .../changelog/templates/docker_image.md.tera | 1 - .../templates/global_priority.md.tera | 17 ++++++------ .../templates/host_functions.md.tera | 27 ++++++++++++++----- .../changelog/templates/migrations.md.tera | 3 ++- .../changelog/templates/pre_release.md.tera | 10 ++++--- scripts/changelog/templates/runtime.md.tera | 2 +- scripts/changelog/templates/template.md.tera | 5 +++- 13 files changed, 116 insertions(+), 38 deletions(-) create mode 100644 scripts/changelog/templates/changes_client.md.tera create mode 100644 scripts/changelog/templates/changes_misc.md.tera create mode 100644 scripts/changelog/templates/changes_runtime.md.tera diff --git a/scripts/changelog/README.md b/scripts/changelog/README.md index 78ace096f51..b38ea02f3b3 100644 --- a/scripts/changelog/README.md +++ b/scripts/changelog/README.md @@ -32,8 +32,8 @@ Currently, the considered labels are: - E4 => new host function - B0 => silent, not showing up - B1-releasenotes (misc unless other labels) -- B7-runtimenoteworthy (runtime changes) - B5-client (client changes) +- B7-runtimenoteworthy (runtime changes) - T6-XCM Note that labels with the same letter are mutually exclusive. diff --git a/scripts/changelog/templates/change.md.tera b/scripts/changelog/templates/change.md.tera index ee043c08dfd..508a07352b5 100644 --- a/scripts/changelog/templates/change.md.tera +++ b/scripts/changelog/templates/change.md.tera @@ -11,6 +11,8 @@ {%- set prio = "" -%} {%- endif -%} +{%- set audit = "" -%} +{# {%- if c.meta.D and c.meta.D.value == 1 -%} {%- set audit = "✅ audtited " -%} {%- elif c.meta.D and c.meta.D.value == 2 -%} @@ -22,11 +24,12 @@ {%- else -%} {%- set audit = "" -%} {%- endif -%} +#} {%- if c.meta.T and c.meta.T.value == 6 -%} -{%- set xcm = "⛓ XCM" -%} +{%- set xcm = " [⛓ XCM]" -%} {%- else -%} {%- set xcm = "" -%} {%- endif -%} -{{- audit }}[`#{{c.number}}`]({{c.html_url}}) {{- prio }} - {{ c.title | capitalize | truncate(length=60, end="…") }} {{xcm }} +{{- audit }}[`#{{c.number}}`]({{c.html_url}}) {{- prio }} - {{ c.title | capitalize | truncate(length=60, end="…") }}{{xcm }} {%- endmacro change -%} diff --git a/scripts/changelog/templates/changes.md.tera b/scripts/changelog/templates/changes.md.tera index 559b38c255d..a1f574e47e8 100644 --- a/scripts/changelog/templates/changes.md.tera +++ b/scripts/changelog/templates/changes.md.tera @@ -1,17 +1,8 @@ {# This include generates the section showing the changes #} - -{%- import "change.md.tera" as m_c -%} - ## Changes - -{# The changes are sorted by merge date #} -{%- for pr in cl.changes | sort(attribute="merged_at") %} +{% include "changes_runtime.md.tera" %} + +{% include "changes_client.md.tera" %} -{%- if pr.meta.B and pr.meta.B.value == 0 %} -{#- We skip silent ones -#} -{%- else -%} -1. {{ m_c::change(c=pr) }} -{% endif -%} -{% endfor %} - +{% include "changes_misc.md.tera" %} diff --git a/scripts/changelog/templates/changes_client.md.tera b/scripts/changelog/templates/changes_client.md.tera new file mode 100644 index 00000000000..4c99659a3b1 --- /dev/null +++ b/scripts/changelog/templates/changes_client.md.tera @@ -0,0 +1,17 @@ +{% import "change.md.tera" as m_c -%} +### Client + +{#- The changes are sorted by merge date #} +{%- for pr in cl.changes | sort(attribute="merged_at") %} + +{%- if pr.meta.B %} +{%- if pr.meta.B.value == 0 %} +{#- We skip silent ones -#} +{%- else -%} + +{%- if pr.meta.B.value == 5 %} +- {{ m_c::change(c=pr) }} +{%- endif -%} +{% endif -%} +{% endif -%} +{% endfor %} diff --git a/scripts/changelog/templates/changes_misc.md.tera b/scripts/changelog/templates/changes_misc.md.tera new file mode 100644 index 00000000000..c431bbefa8e --- /dev/null +++ b/scripts/changelog/templates/changes_misc.md.tera @@ -0,0 +1,27 @@ +{%- import "change.md.tera" as m_c -%} +### Misc + +{#- The changes are sorted by merge date #} +{%- for pr in cl.changes | sort(attribute="merged_at") %} + {%- if pr.meta.B %} + {%- if pr.meta.B.value == 0 %} + {#- We skip silent ones -#} + {%- else -%} + + {%- if pr.meta.B.value == 1 %} +- {{ m_c::change(c=pr) }} + {%- endif -%} + {% endif -%} + {% endif -%} +{% endfor %} + +{%- for pr in cl.changes | sort(attribute="merged_at") %} + {%- if pr.meta.B and pr.meta.B.value == 0 %} + {#- We skip silent ones -#} + {%- else -%} + + {%- if pr.meta.B and pr.meta.B.value != 1 and pr.meta.B.value != 5 and pr.meta.B.value != 7 or pr.meta.C or not pr.meta.B %} +- {{ m_c::change(c=pr) }} + {%- endif -%} + {% endif -%} +{% endfor %} diff --git a/scripts/changelog/templates/changes_runtime.md.tera b/scripts/changelog/templates/changes_runtime.md.tera new file mode 100644 index 00000000000..f6f88d384ad --- /dev/null +++ b/scripts/changelog/templates/changes_runtime.md.tera @@ -0,0 +1,19 @@ +{%- import "change.md.tera" as m_c -%} + +### Runtime + +{#- The changes are sorted by merge date -#} +{% for pr in cl.changes | sort(attribute="merged_at") -%} + +{%- if pr.meta.B -%} +{%- if pr.meta.B.value == 0 -%} +{#- We skip silent ones -#} +{%- else -%} + +{%- if pr.meta.B.value == 7 %} +- {{ m_c::change(c=pr) }} +{%- endif -%} +{%- endif -%} + +{%- endif -%} +{%- endfor %} diff --git a/scripts/changelog/templates/docker_image.md.tera b/scripts/changelog/templates/docker_image.md.tera index b7f7485cb60..f28a6d54b0c 100644 --- a/scripts/changelog/templates/docker_image.md.tera +++ b/scripts/changelog/templates/docker_image.md.tera @@ -8,4 +8,3 @@ You may also pull it with: docker pull parity/polkadot-collator:latest ``` --> - diff --git a/scripts/changelog/templates/global_priority.md.tera b/scripts/changelog/templates/global_priority.md.tera index 20bd610dd4e..dd190d081ca 100644 --- a/scripts/changelog/templates/global_priority.md.tera +++ b/scripts/changelog/templates/global_priority.md.tera @@ -1,17 +1,18 @@ +## Global Priority -{%- if c.meta.C and c.meta.C.value >= 7-%} +{%- if cl.meta.C and cl.meta.C.max >= 7-%} {%- set prio = "❗️HIGH" -%} {%- set txt = "You must upgrade as as soon as possible" -%} -{%- elif c.meta.C and c.meta.C.value >= 5 -%} +{%- elif cl.meta.C and cl.meta.C.max >= 5 -%} {%- set prio = "📣 Medium" -%} {%- set txt = "You should upgrade in a timely manner" -%} -{%- elif c.meta.C and c.meta.C.value >= 3 -%} +{%- elif cl.meta.C and cl.meta.C.max >= 3 -%} {%- set prio = "📌 Low" -%} {%- set txt = "You may upgrade at your convenience" -%} -{%- endif -%} +{%- endif %} -{%- if prio %} -{{ prio }} {{ txt }} -{%- else %} +{% if prio %} +{{ prio }}: {{ txt }} +{%- else -%} -{%- endif %} +{% endif %} diff --git a/scripts/changelog/templates/host_functions.md.tera b/scripts/changelog/templates/host_functions.md.tera index 34d337d2d8f..b855b045a06 100644 --- a/scripts/changelog/templates/host_functions.md.tera +++ b/scripts/changelog/templates/host_functions.md.tera @@ -1,11 +1,24 @@ -{%- if c.meta.E and c.meta.C.value == 4 -%} -## ⚠️ New Host functions +{%- import "change.md.tera" as m_c -%} +{%- set count = 0 -%} -The runtimes in this release contain new **host function**. That means it critical that -you update your client before the chain switches to the new runtimes. +## Host functions + +{% for pr in cl.changes | sort(attribute="merged_at") -%} + +{%- if pr.meta.B and pr.meta.B.value == 0 -%} +{#- We skip silent ones -#} +{%- else -%} +{%- if pr.meta.E and pr.meta.E.value == 4 -%} +{%- set count = count + 1 -%} +- {{ m_c::change(c=pr) }} +{% endif -%} +{% endif -%} +{%- endfor -%} -{%- else %} - + +{% if count > 0 -%} +⚠️ The runtimes in this release contain new **host function**. It critical that +you update your client before the chain switches to the new runtimes. +{%- else -%} ℹ️ This release does not contain any new host function. {%- endif %} - diff --git a/scripts/changelog/templates/migrations.md.tera b/scripts/changelog/templates/migrations.md.tera index c8644d2ab6a..4818193808e 100644 --- a/scripts/changelog/templates/migrations.md.tera +++ b/scripts/changelog/templates/migrations.md.tera @@ -1,4 +1,5 @@ -{%- import "change.md.tera" as m_c -%} +{%- import "change.md.tera" as m_c %} + ## Migrations {% for pr in cl.changes | sort(attribute="merged_at") -%} diff --git a/scripts/changelog/templates/pre_release.md.tera b/scripts/changelog/templates/pre_release.md.tera index cebd696131b..2fd87defec8 100644 --- a/scripts/changelog/templates/pre_release.md.tera +++ b/scripts/changelog/templates/pre_release.md.tera @@ -1,5 +1,9 @@ -{% if env.PRE_RELEASE == "true" %} +{%- if env.PRE_RELEASE == "true" -%} +----- ⚠️ Howdy! Beware, this is a **pre-release** -{% else %} + +----- + +{%- else -%} -{% endif %} \ No newline at end of file +{%- endif %} diff --git a/scripts/changelog/templates/runtime.md.tera b/scripts/changelog/templates/runtime.md.tera index cdde8efcaae..dc9ecdea6cc 100644 --- a/scripts/changelog/templates/runtime.md.tera +++ b/scripts/changelog/templates/runtime.md.tera @@ -1,7 +1,7 @@ {# This macro shows one runtime #} {%- macro runtime(runtime) -%} -### {{ runtime.name | capitalize }}: `{{ runtime.data.runtimes.compressed.subwasm.core_version }} -V{{ runtime.data.runtimes.compressed.subwasm.metadata_version }}` +### {{ runtime.name | capitalize }}: `{{ runtime.data.runtimes.compressed.subwasm.core_version }} Metadata V{{ runtime.data.runtimes.compressed.subwasm.metadata_version }}` {%- if runtime.data.runtimes.compressed.subwasm.compression.compressed %} {%- set compressed = "Yes" %} diff --git a/scripts/changelog/templates/template.md.tera b/scripts/changelog/templates/template.md.tera index 9c62f83d526..98c1fea694e 100644 --- a/scripts/changelog/templates/template.md.tera +++ b/scripts/changelog/templates/template.md.tera @@ -1,6 +1,9 @@ {# This is the entry point of the template -#} -# {{cl.repository.name | capitalize }} +# {{ cl.repository.name | capitalize }} + +IMPORTANT: The following release notes currently only concern the changes introduced +in the cumulus repo. Please refer as well to the changes in the matching Polkadot release. {# {%- include "debug.md.tera" -%} #} {# header warning and important notices -#} From df18ca93276f84f95769701008cbe618338aa58a Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Fri, 12 Nov 2021 18:04:19 +0100 Subject: [PATCH 07/46] Renaming cl into cumulus to make room for the polkadot and substrate --- scripts/changelog/changelog.sh | 6 +++--- scripts/changelog/templates/changes.md.tera | 4 +++- scripts/changelog/templates/changes_client.md.tera | 2 +- scripts/changelog/templates/changes_misc.md.tera | 4 ++-- scripts/changelog/templates/changes_runtime.md.tera | 2 +- scripts/changelog/templates/global_priority.md.tera | 6 +++--- scripts/changelog/templates/host_functions.md.tera | 2 +- scripts/changelog/templates/migrations.md.tera | 2 +- scripts/changelog/templates/template.md.tera | 2 +- 9 files changed, 16 insertions(+), 14 deletions(-) diff --git a/scripts/changelog/changelog.sh b/scripts/changelog/changelog.sh index 40e5c4990b5..7e6c865b5b0 100755 --- a/scripts/changelog/changelog.sh +++ b/scripts/changelog/changelog.sh @@ -5,7 +5,7 @@ set -e DIR=`dirname "$BASH_SOURCE"` pushd $DIR -# The following is fake and comes from CI +# The following is fake and shoud come from CI source .env # call for instance as: @@ -43,8 +43,8 @@ jq \ --slurpfile srtool_westmint digests/westmint-srtool-digest.json \ --slurpfile srtool_statemint digests/statemint-srtool-digest.json \ --slurpfile srtool_statemine digests/statemine-srtool-digest.json \ - --slurpfile cl $CL_FILE \ - -n '{ cl: $cl[0], srtool: [ + --slurpfile cumulus $CL_FILE \ + -n '{ cumulus: $cumulus[0], srtool: [ { name: "rococo", data: $srtool_rococo[0] }, { name: "shell", data: $srtool_shell[0] }, { name: "westmint", data: $srtool_westmint[0] }, diff --git a/scripts/changelog/templates/changes.md.tera b/scripts/changelog/templates/changes.md.tera index a1f574e47e8..bcabaf0d153 100644 --- a/scripts/changelog/templates/changes.md.tera +++ b/scripts/changelog/templates/changes.md.tera @@ -1,8 +1,10 @@ {# This include generates the section showing the changes #} ## Changes -{% include "changes_runtime.md.tera" %} +IMPORTANT: The following changes are only for the Cumulus repo. {% include "changes_client.md.tera" %} +{% include "changes_runtime.md.tera" %} + {% include "changes_misc.md.tera" %} diff --git a/scripts/changelog/templates/changes_client.md.tera b/scripts/changelog/templates/changes_client.md.tera index 4c99659a3b1..d02e6d1b480 100644 --- a/scripts/changelog/templates/changes_client.md.tera +++ b/scripts/changelog/templates/changes_client.md.tera @@ -2,7 +2,7 @@ ### Client {#- The changes are sorted by merge date #} -{%- for pr in cl.changes | sort(attribute="merged_at") %} +{%- for pr in cumulus.changes | sort(attribute="merged_at") %} {%- if pr.meta.B %} {%- if pr.meta.B.value == 0 %} diff --git a/scripts/changelog/templates/changes_misc.md.tera b/scripts/changelog/templates/changes_misc.md.tera index c431bbefa8e..3c6f12d4dc5 100644 --- a/scripts/changelog/templates/changes_misc.md.tera +++ b/scripts/changelog/templates/changes_misc.md.tera @@ -2,7 +2,7 @@ ### Misc {#- The changes are sorted by merge date #} -{%- for pr in cl.changes | sort(attribute="merged_at") %} +{%- for pr in cumulus.changes | sort(attribute="merged_at") %} {%- if pr.meta.B %} {%- if pr.meta.B.value == 0 %} {#- We skip silent ones -#} @@ -15,7 +15,7 @@ {% endif -%} {% endfor %} -{%- for pr in cl.changes | sort(attribute="merged_at") %} +{%- for pr in cumulus.changes | sort(attribute="merged_at") %} {%- if pr.meta.B and pr.meta.B.value == 0 %} {#- We skip silent ones -#} {%- else -%} diff --git a/scripts/changelog/templates/changes_runtime.md.tera b/scripts/changelog/templates/changes_runtime.md.tera index f6f88d384ad..4ffa8a5871b 100644 --- a/scripts/changelog/templates/changes_runtime.md.tera +++ b/scripts/changelog/templates/changes_runtime.md.tera @@ -3,7 +3,7 @@ ### Runtime {#- The changes are sorted by merge date -#} -{% for pr in cl.changes | sort(attribute="merged_at") -%} +{% for pr in cumulus.changes | sort(attribute="merged_at") -%} {%- if pr.meta.B -%} {%- if pr.meta.B.value == 0 -%} diff --git a/scripts/changelog/templates/global_priority.md.tera b/scripts/changelog/templates/global_priority.md.tera index dd190d081ca..c060bd6051a 100644 --- a/scripts/changelog/templates/global_priority.md.tera +++ b/scripts/changelog/templates/global_priority.md.tera @@ -1,12 +1,12 @@ ## Global Priority -{%- if cl.meta.C and cl.meta.C.max >= 7-%} +{%- if cumulus.meta.C and cumulus.meta.C.max >= 7-%} {%- set prio = "❗️HIGH" -%} {%- set txt = "You must upgrade as as soon as possible" -%} -{%- elif cl.meta.C and cl.meta.C.max >= 5 -%} +{%- elif cumulus.meta.C and cumulus.meta.C.max >= 5 -%} {%- set prio = "📣 Medium" -%} {%- set txt = "You should upgrade in a timely manner" -%} -{%- elif cl.meta.C and cl.meta.C.max >= 3 -%} +{%- elif cumulus.meta.C and cumulus.meta.C.max >= 3 -%} {%- set prio = "📌 Low" -%} {%- set txt = "You may upgrade at your convenience" -%} {%- endif %} diff --git a/scripts/changelog/templates/host_functions.md.tera b/scripts/changelog/templates/host_functions.md.tera index b855b045a06..074e0736d0f 100644 --- a/scripts/changelog/templates/host_functions.md.tera +++ b/scripts/changelog/templates/host_functions.md.tera @@ -3,7 +3,7 @@ ## Host functions -{% for pr in cl.changes | sort(attribute="merged_at") -%} +{% for pr in cumulus.changes | sort(attribute="merged_at") -%} {%- if pr.meta.B and pr.meta.B.value == 0 -%} {#- We skip silent ones -#} diff --git a/scripts/changelog/templates/migrations.md.tera b/scripts/changelog/templates/migrations.md.tera index 4818193808e..80375948c20 100644 --- a/scripts/changelog/templates/migrations.md.tera +++ b/scripts/changelog/templates/migrations.md.tera @@ -2,7 +2,7 @@ ## Migrations -{% for pr in cl.changes | sort(attribute="merged_at") -%} +{% for pr in cumulus.changes | sort(attribute="merged_at") -%} {%- if pr.meta.B and pr.meta.B.value == 0 %} {#- We skip silent ones -#} diff --git a/scripts/changelog/templates/template.md.tera b/scripts/changelog/templates/template.md.tera index 98c1fea694e..c961c29feba 100644 --- a/scripts/changelog/templates/template.md.tera +++ b/scripts/changelog/templates/template.md.tera @@ -1,6 +1,6 @@ {# This is the entry point of the template -#} -# {{ cl.repository.name | capitalize }} +# {{ cumulus.repository.name | capitalize }} IMPORTANT: The following release notes currently only concern the changes introduced in the cumulus repo. Please refer as well to the changes in the matching Polkadot release. From 8766d51e6c4d0256a66806b1ca91538c369e3ae8 Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Mon, 15 Nov 2021 12:34:00 +0100 Subject: [PATCH 08/46] Fetch data from Substrate and Polkadot --- scripts/changelog/.gitignore | 3 +- scripts/changelog/changelog.sh | 61 +++++++++++++++---- .../templates/changes_runtime.md.tera | 2 +- scripts/changelog/templates/compiler.md.tera | 6 ++ scripts/changelog/templates/debug.md.tera | 7 ++- .../templates/global_priority.md.tera | 2 + scripts/changelog/templates/template.md.tera | 14 ++++- 7 files changed, 78 insertions(+), 17 deletions(-) create mode 100644 scripts/changelog/templates/compiler.md.tera diff --git a/scripts/changelog/.gitignore b/scripts/changelog/.gitignore index 0bc0f0b1ed7..895ea7c4112 100644 --- a/scripts/changelog/.gitignore +++ b/scripts/changelog/.gitignore @@ -1,4 +1,3 @@ changelog.md -context.json -cumulus.json +*.json release-notes*.md diff --git a/scripts/changelog/changelog.sh b/scripts/changelog/changelog.sh index 7e6c865b5b0..934ae5fba27 100755 --- a/scripts/changelog/changelog.sh +++ b/scripts/changelog/changelog.sh @@ -9,16 +9,33 @@ pushd $DIR source .env # call for instance as: -# ./build-cl.sh statemine-v5.0.0 -# you may set the ENV NO_CACHE to force a reload +# ./changelog.sh 0.9.11 0.9.12 statemine-v5.0.0 OWNER=paritytech REPO=cumulus -REF1=${1} -REF2=${2:-HEAD} -CL_FILE=$REPO.json +# Refs used to build the refs for the substrate and polkadot repos +# For instance: 0.9.11 and 0.9.12 +V1=${1} +V2=${2} -echo Using CL_FILE: $CL_FILE +# Ref for the start of the changelog in the cumulus repo +REF1=${3} +REF2=${4:-HEAD} + +# you may set the ENV NO_CACHE to force fetching from Github +# NO_CACHE=1 + +CUMULUS=$REPO.json + +SUBSTRATE=substrate.json +REF1_SUBSTRATE=polkadot-v$V1 +REF2_SUBSTRATE=polkadot-v$V2 + +POLKADOT=polkadot.json +REF1_POKADOT=v$V1 +REF2_POKADOT=v$V2 + +echo Using CUMULUS: $CUMULUS echo Building changelog for $OWNER/$REPO between $REF1 and $REF2 export RUST_LOG=debug; @@ -28,23 +45,43 @@ if [[ ${NO_CACHE} ]]; then fi # This is acting as cache so we don't spend time querying while testing -if [[ ${NO_CACHE} || ! -f "$CL_FILE" ]]; then - echo Generating $CL_FILE - changelogerator $OWNER/$REPO -f $REF1 -t $REF2 > $CL_FILE +if [[ ${NO_CACHE} || ! -f "$CUMULUS" ]]; then + echo Fetching data for Cumulus into $CUMULUS + changelogerator $OWNER/$REPO -f $REF1 -t $REF2 > $CUMULUS +else + echo Re-using $CUMULUS +fi + +if [[ ${NO_CACHE} || ! -f "$POLKADOT" ]]; then + echo Fetching data for Polkadot into $POLKADOT + changelogerator $OWNER/polkadot -f v$V1 -t v$V2 > $POLKADOT +else + echo Re-using $POLKADOT +fi + +if [[ ${NO_CACHE} || ! -f "$SUBSTRATE" ]]; then + echo Fetching data for Substrate into $SUBSTRATE + changelogerator $OWNER/substrate -f polkadot-v$V1 -t polkadot-v$V2 > $SUBSTRATE else - echo Re-using $CL_FILE + echo Re-using $SUBSTRATE fi # Here we compose all the pieces together into one # single big json file. jq \ + --slurpfile cumulus $CUMULUS \ + --slurpfile substrate $SUBSTRATE \ + --slurpfile polkadot $POLKADOT \ --slurpfile srtool_rococo digests/rococo-srtool-digest.json \ --slurpfile srtool_shell digests/shell-srtool-digest.json \ --slurpfile srtool_westmint digests/westmint-srtool-digest.json \ --slurpfile srtool_statemint digests/statemint-srtool-digest.json \ --slurpfile srtool_statemine digests/statemine-srtool-digest.json \ - --slurpfile cumulus $CL_FILE \ - -n '{ cumulus: $cumulus[0], srtool: [ + -n '{ + cumulus: $cumulus[0], + substrate: $substrate[0], + polkadot: $polkadot[0], + srtool: [ { name: "rococo", data: $srtool_rococo[0] }, { name: "shell", data: $srtool_shell[0] }, { name: "westmint", data: $srtool_westmint[0] }, diff --git a/scripts/changelog/templates/changes_runtime.md.tera b/scripts/changelog/templates/changes_runtime.md.tera index 4ffa8a5871b..9d000d9ae61 100644 --- a/scripts/changelog/templates/changes_runtime.md.tera +++ b/scripts/changelog/templates/changes_runtime.md.tera @@ -5,7 +5,7 @@ {#- The changes are sorted by merge date -#} {% for pr in cumulus.changes | sort(attribute="merged_at") -%} -{%- if pr.meta.B -%} +{%- if pr.meta.B -%} {%- if pr.meta.B.value == 0 -%} {#- We skip silent ones -#} {%- else -%} diff --git a/scripts/changelog/templates/compiler.md.tera b/scripts/changelog/templates/compiler.md.tera new file mode 100644 index 00000000000..c6699bfa2e1 --- /dev/null +++ b/scripts/changelog/templates/compiler.md.tera @@ -0,0 +1,6 @@ +## Rust compiler versions + +This release was tested against the following versions of `rustc`. Other versions may work. + +- Rust Stable: `{{ env.RUST_STABLE }}` +- Rust Nightly: `{{ env.RUST_NIGHTLY }}` diff --git a/scripts/changelog/templates/debug.md.tera b/scripts/changelog/templates/debug.md.tera index 9595cab4949..5270ffa1411 100644 --- a/scripts/changelog/templates/debug.md.tera +++ b/scripts/changelog/templates/debug.md.tera @@ -1,5 +1,10 @@ +{%- set to_ignore = changes | filter(attribute="meta.B.value", value=0) %} + ---- ## Debug - +changes: + - total: {{ changes | length }} + - silent: {{ to_ignore | length }} + - remaining: {{ changes | length - to_ignore | length }} ---- diff --git a/scripts/changelog/templates/global_priority.md.tera b/scripts/changelog/templates/global_priority.md.tera index c060bd6051a..6174b1d01aa 100644 --- a/scripts/changelog/templates/global_priority.md.tera +++ b/scripts/changelog/templates/global_priority.md.tera @@ -16,3 +16,5 @@ {%- else -%} {% endif %} + +{# to do: show high prio list here #} diff --git a/scripts/changelog/templates/template.md.tera b/scripts/changelog/templates/template.md.tera index c961c29feba..f9e24a5e299 100644 --- a/scripts/changelog/templates/template.md.tera +++ b/scripts/changelog/templates/template.md.tera @@ -2,15 +2,27 @@ # {{ cumulus.repository.name | capitalize }} +This release contains the changes between `{{ env.REF1 }}` and `{{ env.REF2 }}`. + IMPORTANT: The following release notes currently only concern the changes introduced in the cumulus repo. Please refer as well to the changes in the matching Polkadot release. -{# {%- include "debug.md.tera" -%} #} +{%- set changes = cumulus.changes | concat(with=substrate.changes) -%} +{%- set changes = changes | concat(with=polkadot.changes) -%} + +{% if env.DEBUG %} +{%- include "debug.md.tera" -%} +{% endif %} + {# header warning and important notices -#} {% include "pre_release.md.tera" -%} + {% include "global_priority.md.tera" -%} + {% include "host_functions.md.tera" -%} +{% include "compiler.md.tera" -%} + {% include "migrations.md.tera" -%} {% include "runtimes.md.tera" -%} From 9ed574ef1ba55c4877788f92b547eee4047d8003 Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Mon, 15 Nov 2021 17:32:51 +0100 Subject: [PATCH 09/46] WIP convert bash script to ruby --- scripts/changelog/Gemfile | 19 ++++++ scripts/changelog/Gemfile.lock | 75 ++++++++++++++++++++++ scripts/changelog/bin/changelog | 96 ++++++++++++++++++++++++++++ scripts/changelog/lib/changelog.rb | 31 +++++++++ scripts/changelog/test/test_basic.rb | 33 ++++++++++ 5 files changed, 254 insertions(+) create mode 100644 scripts/changelog/Gemfile create mode 100644 scripts/changelog/Gemfile.lock create mode 100755 scripts/changelog/bin/changelog create mode 100644 scripts/changelog/lib/changelog.rb create mode 100755 scripts/changelog/test/test_basic.rb diff --git a/scripts/changelog/Gemfile b/scripts/changelog/Gemfile new file mode 100644 index 00000000000..26e64d056a4 --- /dev/null +++ b/scripts/changelog/Gemfile @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +source 'https://rubygems.org' + +git_source(:github) { |repo_name| "https://github.com/#{repo_name}" } + +gem 'octokit', '~> 4' + +gem 'git_diff_parser', '~> 3' + +gem 'rake', group: :dev + +gem 'test-unit', group: :dev + +gem 'optparse', '~> 0.1.1' + +gem 'logger', '~> 1.4' + +gem 'rubocop', group: :dev, require: false diff --git a/scripts/changelog/Gemfile.lock b/scripts/changelog/Gemfile.lock new file mode 100644 index 00000000000..8bacdfa4d52 --- /dev/null +++ b/scripts/changelog/Gemfile.lock @@ -0,0 +1,75 @@ +GEM + remote: https://rubygems.org/ + specs: + addressable (2.8.0) + public_suffix (>= 2.0.2, < 5.0) + ast (2.4.2) + faraday (1.8.0) + faraday-em_http (~> 1.0) + faraday-em_synchrony (~> 1.0) + faraday-excon (~> 1.1) + faraday-httpclient (~> 1.0.1) + faraday-net_http (~> 1.0) + faraday-net_http_persistent (~> 1.1) + faraday-patron (~> 1.0) + faraday-rack (~> 1.0) + multipart-post (>= 1.2, < 3) + ruby2_keywords (>= 0.0.4) + faraday-em_http (1.0.0) + faraday-em_synchrony (1.0.0) + faraday-excon (1.1.0) + faraday-httpclient (1.0.1) + faraday-net_http (1.0.1) + faraday-net_http_persistent (1.2.0) + faraday-patron (1.0.0) + faraday-rack (1.0.0) + git_diff_parser (3.2.0) + logger (1.4.4) + multipart-post (2.1.1) + octokit (4.21.0) + faraday (>= 0.9) + sawyer (~> 0.8.0, >= 0.5.3) + optparse (0.1.1) + parallel (1.21.0) + parser (3.0.2.0) + ast (~> 2.4.1) + power_assert (2.0.1) + public_suffix (4.0.6) + rainbow (3.0.0) + rake (13.0.6) + regexp_parser (2.1.1) + rexml (3.2.5) + rubocop (1.23.0) + parallel (~> 1.10) + parser (>= 3.0.0.0) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml + rubocop-ast (>= 1.12.0, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 1.4.0, < 3.0) + rubocop-ast (1.13.0) + parser (>= 3.0.1.1) + ruby-progressbar (1.11.0) + ruby2_keywords (0.0.5) + sawyer (0.8.2) + addressable (>= 2.3.5) + faraday (> 0.8, < 2.0) + test-unit (3.5.1) + power_assert + unicode-display_width (2.1.0) + +PLATFORMS + x86_64-darwin-20 + +DEPENDENCIES + git_diff_parser (~> 3) + logger (~> 1.4) + octokit (~> 4) + optparse (~> 0.1.1) + rake + rubocop + test-unit + +BUNDLED WITH + 2.2.22 diff --git a/scripts/changelog/bin/changelog b/scripts/changelog/bin/changelog new file mode 100755 index 00000000000..51600d348c2 --- /dev/null +++ b/scripts/changelog/bin/changelog @@ -0,0 +1,96 @@ +# !/usr/bin/env ruby + +# frozen_string_literal: true + +require_relative '../lib/changelog' +require 'logger' + +logger = Logger.new($stdout) +logger.level = Logger::DEBUG +logger.debug('Starting') + +# call for instance as: +# ruby ./bin/changelog statemine-v5.0.0 +owner = 'paritytech' +repo = 'cumulus' + +REF1 = 'statemine-v5.0.0' +REF2 = 'HEAD' + +gh_cumulus = SubRef.new(format('%s/%s', owner, repo)) + +POLKADOT_REF1 = gh_cumulus.get_dependency_reference(REF1, 'polkadot-client') +POLKADOT_REF2 = gh_cumulus.get_dependency_reference(REF2, 'polkadot-client') + +SUBSTRATE_REF1 = gh_cumulus.get_dependency_reference(REF1, 'sp-io') +SUBSTRATE_REF2 = gh_cumulus.get_dependency_reference(REF2, 'sp-io') + +logger.debug('Polkadot from: ' + POLKADOT_REF1) +logger.debug('Polkadot to: ' + POLKADOT_REF2) + +logger.debug('Substrate from: ' + SUBSTRATE_REF1) +logger.debug('Substrate to: ' + SUBSTRATE_REF2) + +# you may set the ENV NO_CACHE to force fetching from Github +# NO_CACHE=1 + +cumulus_data = 'cumulus.json' +substrate_data = 'substrate.json' +polkadot_data = 'polkadot.json' + +logger.debug('Using CUMULUS: ' + cumulus_data) +logger.debug('Using SUBSTRATE: ' + substrate_data) +logger.debug('Using POLKADOT: ' + polkadot_data) + +# p Building changelog for $owner/$repo between $REF1 and $REF2 + +logger.warn('NO_CACHE set') if ENV['NO_CACHE'] + +# This is acting as cache so we don't spend time querying while testing +# if [[ ${NO_CACHE} || ! -f "$cumulus_data" ]]; then +# echo Fetching data for Cumulus into $cumulus_data +# changelogerator $owner/$repo -f $REF1 -t $REF2 > $cumulus_data +# else +# echo Re-using $cumulus_data +# fi + +# if [[ ${NO_CACHE} || ! -f "$polkadot_data" ]]; then +# echo Fetching data for Polkadot into $polkadot_data +# changelogerator $owner/polkadot -f v$V1 -t v$V2 > $polkadot_data +# else +# echo Re-using $polkadot_data +# fi + +# if [[ ${NO_CACHE} || ! -f "$substrate_data" ]]; then +# echo Fetching data for Substrate into $substrate_data +# changelogerator $owner/substrate -f polkadot-v$V1 -t polkadot-v$V2 > $substrate_data +# else +# echo Re-using $substrate_data +# fi + +# Here we compose all the pieces together into one +# single big json file. +# jq \ +# --slurpfile cumulus $cumulus_data \ +# --slurpfile substrate $substrate_data \ +# --slurpfile polkadot $polkadot_data \ +# --slurpfile srtool_rococo digests/rococo-srtool-digest.json \ +# --slurpfile srtool_shell digests/shell-srtool-digest.json \ +# --slurpfile srtool_westmint digests/westmint-srtool-digest.json \ +# --slurpfile srtool_statemint digests/statemint-srtool-digest.json \ +# --slurpfile srtool_statemine digests/statemine-srtool-digest.json \ +# -n '{ +# cumulus: $cumulus[0], +# substrate: $substrate[0], +# polkadot: $polkadot[0], +# srtool: [ +# { name: "rococo", data: $srtool_rococo[0] }, +# { name: "shell", data: $srtool_shell[0] }, +# { name: "westmint", data: $srtool_westmint[0] }, +# { name: "statemint", data: $srtool_statemint[0] }, +# { name: "statemine", data: $srtool_statemine[0] } +# ] }' | tee context.json + +# tera --env --env-key env --include-path templates --template templates/template.md.tera context.json | tee release-notes-cumulus.md + +p 'END' diff --git a/scripts/changelog/lib/changelog.rb b/scripts/changelog/lib/changelog.rb new file mode 100644 index 00000000000..0e1dc90837f --- /dev/null +++ b/scripts/changelog/lib/changelog.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +class SubRef + require 'octokit' + require 'toml' + + attr_reader :client, :repository + + def initialize(github_repo) + @client = Octokit::Client.new( + access_token: ENV['GITHUB_TOKEN'] + ) + @repository = @client.repository(github_repo) + end + + # This function checks the Cargo.lock of a given + # Rust project, for a given package, and fetches + # the dependency git ref. + def get_dependency_reference(ref, package) + cargo = TOML::Parser.new( + Base64.decode64( + @client.contents( + @repository.full_name, + path: 'Cargo.lock', + query: { ref: ref.to_s } + ).content + ) + ).parsed + cargo['package'].find { |p| p['name'] == package }['source'].split('#').last + end +end diff --git a/scripts/changelog/test/test_basic.rb b/scripts/changelog/test/test_basic.rb new file mode 100755 index 00000000000..60c3231976e --- /dev/null +++ b/scripts/changelog/test/test_basic.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +# require 'json' +require_relative '../lib/changelog' +require 'test/unit' + +class TestChangelog < Test::Unit::TestCase + def test_get_dep_ref_polkadot + c = SubRef.new('paritytech/polkadot') + ref = '13c2695' + package = 'sc-cli' + result = c.get_dependency_reference(ref, package) + assert_equal('7db0768a85dc36a3f2a44d042b32f3715c00a90d', result) + end + + def test_get_dep_ref_invalid_ref + c = SubRef.new('paritytech/polkadot') + ref = '9999999' + package = 'sc-cli' + assert_raise do + c.get_dependency_reference(ref, package) + end + end + + def test_get_dep_ref_invalid_package + c = SubRef.new('paritytech/polkadot') + ref = '13c2695' + package = 'foobar' + assert_raise do + c.get_dependency_reference(ref, package) + end + end +end From 61be28c5e39c46acaf31c781cc831bed1e04d523 Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Mon, 15 Nov 2021 18:29:26 +0100 Subject: [PATCH 10/46] Convert to Ruby --- scripts/changelog/bin/changelog | 126 ++++++++++++++++---------------- 1 file changed, 65 insertions(+), 61 deletions(-) diff --git a/scripts/changelog/bin/changelog b/scripts/changelog/bin/changelog index 51600d348c2..ced5fa9d24e 100755 --- a/scripts/changelog/bin/changelog +++ b/scripts/changelog/bin/changelog @@ -2,6 +2,12 @@ # frozen_string_literal: true +# call for instance as: +# ruby ./bin/changelog statemine-v5.0.0 +# +# You may set the ENV NO_CACHE to force fetching from Github +# You should also ensure you set the ENV: GITHUB_TOKEN + require_relative '../lib/changelog' require 'logger' @@ -9,30 +15,25 @@ logger = Logger.new($stdout) logger.level = Logger::DEBUG logger.debug('Starting') -# call for instance as: -# ruby ./bin/changelog statemine-v5.0.0 owner = 'paritytech' repo = 'cumulus' -REF1 = 'statemine-v5.0.0' -REF2 = 'HEAD' +ref1 = 'statemine-v5.0.0' +ref2 = 'HEAD' gh_cumulus = SubRef.new(format('%s/%s', owner, repo)) -POLKADOT_REF1 = gh_cumulus.get_dependency_reference(REF1, 'polkadot-client') -POLKADOT_REF2 = gh_cumulus.get_dependency_reference(REF2, 'polkadot-client') - -SUBSTRATE_REF1 = gh_cumulus.get_dependency_reference(REF1, 'sp-io') -SUBSTRATE_REF2 = gh_cumulus.get_dependency_reference(REF2, 'sp-io') +polkadot_ref1 = gh_cumulus.get_dependency_reference(ref1, 'polkadot-client') +polkadot_ref2 = gh_cumulus.get_dependency_reference(ref2, 'polkadot-client') -logger.debug('Polkadot from: ' + POLKADOT_REF1) -logger.debug('Polkadot to: ' + POLKADOT_REF2) +substrate_ref1 = gh_cumulus.get_dependency_reference(ref1, 'sp-io') +substrate_ref2 = gh_cumulus.get_dependency_reference(ref2, 'sp-io') -logger.debug('Substrate from: ' + SUBSTRATE_REF1) -logger.debug('Substrate to: ' + SUBSTRATE_REF2) +logger.debug('Polkadot from: ' + polkadot_ref1) +logger.debug('Polkadot to: ' + polkadot_ref2) -# you may set the ENV NO_CACHE to force fetching from Github -# NO_CACHE=1 +logger.debug('Substrate from: ' + substrate_ref1) +logger.debug('Substrate to: ' + substrate_ref2) cumulus_data = 'cumulus.json' substrate_data = 'substrate.json' @@ -42,55 +43,58 @@ logger.debug('Using CUMULUS: ' + cumulus_data) logger.debug('Using SUBSTRATE: ' + substrate_data) logger.debug('Using POLKADOT: ' + polkadot_data) -# p Building changelog for $owner/$repo between $REF1 and $REF2 - logger.warn('NO_CACHE set') if ENV['NO_CACHE'] # This is acting as cache so we don't spend time querying while testing -# if [[ ${NO_CACHE} || ! -f "$cumulus_data" ]]; then -# echo Fetching data for Cumulus into $cumulus_data -# changelogerator $owner/$repo -f $REF1 -t $REF2 > $cumulus_data -# else -# echo Re-using $cumulus_data -# fi - -# if [[ ${NO_CACHE} || ! -f "$polkadot_data" ]]; then -# echo Fetching data for Polkadot into $polkadot_data -# changelogerator $owner/polkadot -f v$V1 -t v$V2 > $polkadot_data -# else -# echo Re-using $polkadot_data -# fi - -# if [[ ${NO_CACHE} || ! -f "$substrate_data" ]]; then -# echo Fetching data for Substrate into $substrate_data -# changelogerator $owner/substrate -f polkadot-v$V1 -t polkadot-v$V2 > $substrate_data -# else -# echo Re-using $substrate_data -# fi +if ENV['NO_CACHE'] || !File.file?(cumulus_data) + logger.debug(format('Fetching data for Cumulus into %s', cumulus_data)) + cmd = format('changelogerator %s/%s -f %s -t %s > %s', owner, repo, ref1, ref2, cumulus_data) + system(cmd) +else + logger.debug('Re-using:' + cumulus_data) +end + +if ENV['NO_CACHE'] || !File.file?(polkadot_data) + logger.debug(format('Fetching data for Polkadot into %s', polkadot_data)) + cmd = format('changelogerator %s/%s -f %s -t %s > %s', owner, 'polkadot', polkadot_ref1, polkadot_ref2, + polkadot_data) + system(cmd) +else + logger.debug('Re-using:' + polkadot_data) +end + +if ENV['NO_CACHE'] || !File.file?(substrate_data) + logger.debug(format('Fetching data for Substrate into %s', substrate_data)) + cmd = format('changelogerator %s/%s -f %s -t %s > %s', owner, 'substrate', substrate_ref1, substrate_ref2, + substrate_data) + system(cmd) +else + logger.debug('Re-using:' + substrate_data) +end # Here we compose all the pieces together into one # single big json file. -# jq \ -# --slurpfile cumulus $cumulus_data \ -# --slurpfile substrate $substrate_data \ -# --slurpfile polkadot $polkadot_data \ -# --slurpfile srtool_rococo digests/rococo-srtool-digest.json \ -# --slurpfile srtool_shell digests/shell-srtool-digest.json \ -# --slurpfile srtool_westmint digests/westmint-srtool-digest.json \ -# --slurpfile srtool_statemint digests/statemint-srtool-digest.json \ -# --slurpfile srtool_statemine digests/statemine-srtool-digest.json \ -# -n '{ -# cumulus: $cumulus[0], -# substrate: $substrate[0], -# polkadot: $polkadot[0], -# srtool: [ -# { name: "rococo", data: $srtool_rococo[0] }, -# { name: "shell", data: $srtool_shell[0] }, -# { name: "westmint", data: $srtool_westmint[0] }, -# { name: "statemint", data: $srtool_statemint[0] }, -# { name: "statemine", data: $srtool_statemine[0] } -# ] }' | tee context.json - -# tera --env --env-key env --include-path templates --template templates/template.md.tera context.json | tee release-notes-cumulus.md - -p 'END' +cmd = format('jq \ + --slurpfile cumulus %s \ + --slurpfile substrate %s \ + --slurpfile polkadot %s \ + --slurpfile srtool_rococo digests/rococo-srtool-digest.json \ + --slurpfile srtool_shell digests/shell-srtool-digest.json \ + --slurpfile srtool_westmint digests/westmint-srtool-digest.json \ + --slurpfile srtool_statemint digests/statemint-srtool-digest.json \ + --slurpfile srtool_statemine digests/statemine-srtool-digest.json \ + -n \'{ + cumulus: $cumulus[0], + substrate: $substrate[0], + polkadot: $polkadot[0], + srtool: [ + { name: "rococo", data: $srtool_rococo[0] }, + { name: "shell", data: $srtool_shell[0] }, + { name: "westmint", data: $srtool_westmint[0] }, + { name: "statemint", data: $srtool_statemint[0] }, + { name: "statemine", data: $srtool_statemine[0] } + ] }\' | tee context.json', cumulus_data, substrate_data, polkadot_data) +system(cmd) + +cmd = 'tera --env --env-key env --include-path templates --template templates/template.md.tera context.json | tee release-notes-cumulus.md' +system(cmd) From e1b2a130ff83a611d58563c108397d2b4c76af5d Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Tue, 16 Nov 2021 14:36:01 +0100 Subject: [PATCH 11/46] Cleanup --- scripts/changelog/bin/changelog | 4 ++-- scripts/changelog/test/test_basic.rb | 10 ---------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/scripts/changelog/bin/changelog b/scripts/changelog/bin/changelog index ced5fa9d24e..11e0f2f6eaf 100755 --- a/scripts/changelog/bin/changelog +++ b/scripts/changelog/bin/changelog @@ -18,8 +18,8 @@ logger.debug('Starting') owner = 'paritytech' repo = 'cumulus' -ref1 = 'statemine-v5.0.0' -ref2 = 'HEAD' +ref1 = ARGV[0] +ref2 = ARGV[1] || 'HEAD' gh_cumulus = SubRef.new(format('%s/%s', owner, repo)) diff --git a/scripts/changelog/test/test_basic.rb b/scripts/changelog/test/test_basic.rb index 60c3231976e..d099fadca43 100755 --- a/scripts/changelog/test/test_basic.rb +++ b/scripts/changelog/test/test_basic.rb @@ -1,6 +1,5 @@ # frozen_string_literal: true -# require 'json' require_relative '../lib/changelog' require 'test/unit' @@ -21,13 +20,4 @@ def test_get_dep_ref_invalid_ref c.get_dependency_reference(ref, package) end end - - def test_get_dep_ref_invalid_package - c = SubRef.new('paritytech/polkadot') - ref = '13c2695' - package = 'foobar' - assert_raise do - c.get_dependency_reference(ref, package) - end - end end From 38981c927be5477b9a10bbd4de717d0a4e705dcd Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Tue, 16 Nov 2021 14:41:50 +0100 Subject: [PATCH 12/46] Fix typo --- scripts/changelog/bin/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/changelog/bin/changelog b/scripts/changelog/bin/changelog index 11e0f2f6eaf..d1619346880 100755 --- a/scripts/changelog/bin/changelog +++ b/scripts/changelog/bin/changelog @@ -1,4 +1,4 @@ -# !/usr/bin/env ruby +#!/usr/bin/env ruby # frozen_string_literal: true From 9f9d3552f383e7fd4845bcc27e0d6ad145523da1 Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Tue, 16 Nov 2021 15:26:09 +0100 Subject: [PATCH 13/46] Cleanup --- scripts/changelog/.env | 4 - scripts/changelog/README.md | 12 ++- scripts/changelog/bin/changelog | 5 +- scripts/changelog/changelog.sh | 94 ------------------- scripts/changelog/templates/change.md.tera | 18 +++- scripts/changelog/templates/changes.md.tera | 8 +- .../templates/changes_client.md.tera | 20 ++-- .../changelog/templates/changes_misc.md.tera | 4 +- .../templates/changes_runtime.md.tera | 2 +- .../templates/host_functions.md.tera | 2 +- .../changelog/templates/migrations.md.tera | 2 +- scripts/changelog/templates/template.md.tera | 3 - 12 files changed, 48 insertions(+), 126 deletions(-) delete mode 100755 scripts/changelog/changelog.sh diff --git a/scripts/changelog/.env b/scripts/changelog/.env index fc89673f930..0472f95c958 100644 --- a/scripts/changelog/.env +++ b/scripts/changelog/.env @@ -1,9 +1,5 @@ RUST_STABLE="1.55.0 (c8dfcfe04 2021-09-06)" RUST_NIGHTLY="1.57.0-nightly (51e514c0f 2021-09-12)" -OWNER=paritytech -REPO=polkadot -REF1=v0.9.10 -REF2=v0.9.11 PRE_RELEASE=true HIDE_SRTOOL_ROCOCO=true HIDE_SRTOOL_SHELL=true diff --git a/scripts/changelog/README.md b/scripts/changelog/README.md index b38ea02f3b3..10e6d9fc4d3 100644 --- a/scripts/changelog/README.md +++ b/scripts/changelog/README.md @@ -11,16 +11,22 @@ The content of the release notes is generated from the template files under the Run: ``` -./changelog.sh [=HEAD] +./bin/changelog [=HEAD] ``` For instance: ``` -./changelog.sh statemine-v5.0.0 +./bin/changelog statemine-v5.0.0 ``` A file called `release-notes-cumulus.md` will be generated and can be used for the release. +## ENV + +You may use the following ENV: +- DEBUG +- NO_CACHE + ## Considered labels The following list will likely evolve over time and it will be hard to keep it in sync. @@ -46,7 +52,7 @@ decide which label will be considered. The following command allows **Hot Reload**: ``` -fswatch templates -e ".*\.md$" | xargs -n1 -I{} ./changelog.sh statemine-v5.0.0 +fswatch templates -e ".*\.md$" | xargs -n1 -I{} ./bin/changelog statemine-v5.0.0 ``` ### Caching diff --git a/scripts/changelog/bin/changelog b/scripts/changelog/bin/changelog index d1619346880..b22ff529958 100755 --- a/scripts/changelog/bin/changelog +++ b/scripts/changelog/bin/changelog @@ -3,7 +3,7 @@ # frozen_string_literal: true # call for instance as: -# ruby ./bin/changelog statemine-v5.0.0 +# ./bin/changelog statemine-v5.0.0 # # You may set the ENV NO_CACHE to force fetching from Github # You should also ensure you set the ENV: GITHUB_TOKEN @@ -21,6 +21,9 @@ repo = 'cumulus' ref1 = ARGV[0] ref2 = ARGV[1] || 'HEAD' +ENV['REF1'] = ref1 +ENV['REF2'] = ref2 + gh_cumulus = SubRef.new(format('%s/%s', owner, repo)) polkadot_ref1 = gh_cumulus.get_dependency_reference(ref1, 'polkadot-client') diff --git a/scripts/changelog/changelog.sh b/scripts/changelog/changelog.sh deleted file mode 100755 index 934ae5fba27..00000000000 --- a/scripts/changelog/changelog.sh +++ /dev/null @@ -1,94 +0,0 @@ -#!/usr/bin/env bash - -set -e - -DIR=`dirname "$BASH_SOURCE"` -pushd $DIR - -# The following is fake and shoud come from CI -source .env - -# call for instance as: -# ./changelog.sh 0.9.11 0.9.12 statemine-v5.0.0 -OWNER=paritytech -REPO=cumulus - -# Refs used to build the refs for the substrate and polkadot repos -# For instance: 0.9.11 and 0.9.12 -V1=${1} -V2=${2} - -# Ref for the start of the changelog in the cumulus repo -REF1=${3} -REF2=${4:-HEAD} - -# you may set the ENV NO_CACHE to force fetching from Github -# NO_CACHE=1 - -CUMULUS=$REPO.json - -SUBSTRATE=substrate.json -REF1_SUBSTRATE=polkadot-v$V1 -REF2_SUBSTRATE=polkadot-v$V2 - -POLKADOT=polkadot.json -REF1_POKADOT=v$V1 -REF2_POKADOT=v$V2 - -echo Using CUMULUS: $CUMULUS -echo Building changelog for $OWNER/$REPO between $REF1 and $REF2 - -export RUST_LOG=debug; - -if [[ ${NO_CACHE} ]]; then - echo NO_CACHE set -fi - -# This is acting as cache so we don't spend time querying while testing -if [[ ${NO_CACHE} || ! -f "$CUMULUS" ]]; then - echo Fetching data for Cumulus into $CUMULUS - changelogerator $OWNER/$REPO -f $REF1 -t $REF2 > $CUMULUS -else - echo Re-using $CUMULUS -fi - -if [[ ${NO_CACHE} || ! -f "$POLKADOT" ]]; then - echo Fetching data for Polkadot into $POLKADOT - changelogerator $OWNER/polkadot -f v$V1 -t v$V2 > $POLKADOT -else - echo Re-using $POLKADOT -fi - -if [[ ${NO_CACHE} || ! -f "$SUBSTRATE" ]]; then - echo Fetching data for Substrate into $SUBSTRATE - changelogerator $OWNER/substrate -f polkadot-v$V1 -t polkadot-v$V2 > $SUBSTRATE -else - echo Re-using $SUBSTRATE -fi - -# Here we compose all the pieces together into one -# single big json file. -jq \ - --slurpfile cumulus $CUMULUS \ - --slurpfile substrate $SUBSTRATE \ - --slurpfile polkadot $POLKADOT \ - --slurpfile srtool_rococo digests/rococo-srtool-digest.json \ - --slurpfile srtool_shell digests/shell-srtool-digest.json \ - --slurpfile srtool_westmint digests/westmint-srtool-digest.json \ - --slurpfile srtool_statemint digests/statemint-srtool-digest.json \ - --slurpfile srtool_statemine digests/statemine-srtool-digest.json \ - -n '{ - cumulus: $cumulus[0], - substrate: $substrate[0], - polkadot: $polkadot[0], - srtool: [ - { name: "rococo", data: $srtool_rococo[0] }, - { name: "shell", data: $srtool_shell[0] }, - { name: "westmint", data: $srtool_westmint[0] }, - { name: "statemint", data: $srtool_statemint[0] }, - { name: "statemine", data: $srtool_statemine[0] } - ] }' | tee context.json - -tera --env --env-key env --include-path templates --template templates/template.md.tera context.json | tee release-notes-cumulus.md - -popd diff --git a/scripts/changelog/templates/change.md.tera b/scripts/changelog/templates/change.md.tera index 508a07352b5..34c31b76dbe 100644 --- a/scripts/changelog/templates/change.md.tera +++ b/scripts/changelog/templates/change.md.tera @@ -2,11 +2,11 @@ {%- macro change(c) -%} {%- if c.meta.C and c.meta.C.value >= 7 -%} -{%- set prio = "❗️HIGH" -%} +{%- set prio = " ❗️HIGH" -%} {%- elif c.meta.C and c.meta.C.value >= 5 -%} -{%- set prio = "📣 Medium" -%} +{%- set prio = " 📣 Medium" -%} {%- elif c.meta.C and c.meta.C.value >= 3 -%} -{%- set prio = "📌 Low" -%} +{%- set prio = " 📌 Low" -%} {%- else -%} {%- set prio = "" -%} {%- endif -%} @@ -26,10 +26,20 @@ {%- endif -%} #} +{%- if c.html_url is containing("polkadot") -%} +{%- set repo = "[P]" -%} +{%- elif c.html_url is containing("cumulus") -%} +{%- set repo = "[C]" -%} +{%- elif c.html_url is containing("substrate") -%} +{%- set repo = "[S]" -%} +{%- else -%} +{%- set repo = " " -%} +{%- endif -%} + {%- if c.meta.T and c.meta.T.value == 6 -%} {%- set xcm = " [⛓ XCM]" -%} {%- else -%} {%- set xcm = "" -%} {%- endif -%} -{{- audit }}[`#{{c.number}}`]({{c.html_url}}) {{- prio }} - {{ c.title | capitalize | truncate(length=60, end="…") }}{{xcm }} +{{repo}} {{ audit }}[`#{{c.number}}`]({{c.html_url}}) {{- prio }} - {{ c.title | capitalize | truncate(length=60, end="…") }}{{xcm }} {%- endmacro change -%} diff --git a/scripts/changelog/templates/changes.md.tera b/scripts/changelog/templates/changes.md.tera index bcabaf0d153..5ccf5179beb 100644 --- a/scripts/changelog/templates/changes.md.tera +++ b/scripts/changelog/templates/changes.md.tera @@ -1,10 +1,14 @@ {# This include generates the section showing the changes #} ## Changes -IMPORTANT: The following changes are only for the Cumulus repo. - {% include "changes_client.md.tera" %} {% include "changes_runtime.md.tera" %} {% include "changes_misc.md.tera" %} + +**Legend:** + +- \[C\]: Cumulus +- \[P\]: Polkadot +- \[S\]: Substrate diff --git a/scripts/changelog/templates/changes_client.md.tera b/scripts/changelog/templates/changes_client.md.tera index d02e6d1b480..fb2a4f357b8 100644 --- a/scripts/changelog/templates/changes_client.md.tera +++ b/scripts/changelog/templates/changes_client.md.tera @@ -2,16 +2,16 @@ ### Client {#- The changes are sorted by merge date #} -{%- for pr in cumulus.changes | sort(attribute="merged_at") %} +{%- 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.B %} + {%- if pr.meta.B.value == 0 %} + {#- We skip silent ones -#} + {%- else -%} -{%- if pr.meta.B.value == 5 %} -- {{ m_c::change(c=pr) }} -{%- endif -%} -{% endif -%} -{% endif -%} + {%- if pr.meta.B.value == 5 %} +- {{ m_c::change(c=pr) }} {{ pr.meta.B | json_encode }} + {%- endif -%} + {% endif -%} + {% endif -%} {% endfor %} diff --git a/scripts/changelog/templates/changes_misc.md.tera b/scripts/changelog/templates/changes_misc.md.tera index 3c6f12d4dc5..c8c9d854364 100644 --- a/scripts/changelog/templates/changes_misc.md.tera +++ b/scripts/changelog/templates/changes_misc.md.tera @@ -2,7 +2,7 @@ ### Misc {#- The changes are sorted by merge date #} -{%- for pr in cumulus.changes | sort(attribute="merged_at") %} +{%- for pr in changes | sort(attribute="merged_at") %} {%- if pr.meta.B %} {%- if pr.meta.B.value == 0 %} {#- We skip silent ones -#} @@ -15,7 +15,7 @@ {% endif -%} {% endfor %} -{%- for pr in cumulus.changes | sort(attribute="merged_at") %} +{%- for pr in changes | sort(attribute="merged_at") %} {%- if pr.meta.B and pr.meta.B.value == 0 %} {#- We skip silent ones -#} {%- else -%} diff --git a/scripts/changelog/templates/changes_runtime.md.tera b/scripts/changelog/templates/changes_runtime.md.tera index 9d000d9ae61..86bd988f77e 100644 --- a/scripts/changelog/templates/changes_runtime.md.tera +++ b/scripts/changelog/templates/changes_runtime.md.tera @@ -3,7 +3,7 @@ ### Runtime {#- The changes are sorted by merge date -#} -{% for pr in cumulus.changes | sort(attribute="merged_at") -%} +{% for pr in changes | sort(attribute="merged_at") -%} {%- if pr.meta.B -%} {%- if pr.meta.B.value == 0 -%} diff --git a/scripts/changelog/templates/host_functions.md.tera b/scripts/changelog/templates/host_functions.md.tera index 074e0736d0f..35cec215e1d 100644 --- a/scripts/changelog/templates/host_functions.md.tera +++ b/scripts/changelog/templates/host_functions.md.tera @@ -3,7 +3,7 @@ ## Host functions -{% for pr in cumulus.changes | sort(attribute="merged_at") -%} +{% for pr in changes | sort(attribute="merged_at") -%} {%- if pr.meta.B and pr.meta.B.value == 0 -%} {#- We skip silent ones -#} diff --git a/scripts/changelog/templates/migrations.md.tera b/scripts/changelog/templates/migrations.md.tera index 80375948c20..af04821a2e1 100644 --- a/scripts/changelog/templates/migrations.md.tera +++ b/scripts/changelog/templates/migrations.md.tera @@ -2,7 +2,7 @@ ## Migrations -{% for pr in cumulus.changes | sort(attribute="merged_at") -%} +{% for pr in changes | sort(attribute="merged_at") -%} {%- if pr.meta.B and pr.meta.B.value == 0 %} {#- We skip silent ones -#} diff --git a/scripts/changelog/templates/template.md.tera b/scripts/changelog/templates/template.md.tera index f9e24a5e299..2ff87d36598 100644 --- a/scripts/changelog/templates/template.md.tera +++ b/scripts/changelog/templates/template.md.tera @@ -4,9 +4,6 @@ This release contains the changes between `{{ env.REF1 }}` and `{{ env.REF2 }}`. -IMPORTANT: The following release notes currently only concern the changes introduced -in the cumulus repo. Please refer as well to the changes in the matching Polkadot release. - {%- set changes = cumulus.changes | concat(with=substrate.changes) -%} {%- set changes = changes | concat(with=polkadot.changes) -%} From 1ac54a2f585d7b3431592400958692b09e9130d3 Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Tue, 16 Nov 2021 15:54:03 +0100 Subject: [PATCH 14/46] Fix host function delection --- .../templates/host_functions.md.tera | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/scripts/changelog/templates/host_functions.md.tera b/scripts/changelog/templates/host_functions.md.tera index 35cec215e1d..98e6c9868cd 100644 --- a/scripts/changelog/templates/host_functions.md.tera +++ b/scripts/changelog/templates/host_functions.md.tera @@ -1,5 +1,5 @@ {%- import "change.md.tera" as m_c -%} -{%- set count = 0 -%} +{%- set_global host_fn_count = 0 -%} ## Host functions @@ -8,17 +8,19 @@ {%- if pr.meta.B and pr.meta.B.value == 0 -%} {#- We skip silent ones -#} {%- else -%} -{%- if pr.meta.E and pr.meta.E.value == 4 -%} -{%- set count = count + 1 -%} -- {{ m_c::change(c=pr) }} -{% endif -%} -{% endif -%} + {%- if pr.meta.E and pr.meta.E.value == 4 -%} + {%- set_global host_fn_count = host_fn_count + 1 -%} + - {{ m_c::change(c=pr) }} + {% endif -%} + {% endif -%} {%- endfor -%} - -{% if count > 0 -%} -⚠️ The runtimes in this release contain new **host function**. It critical that -you update your client before the chain switches to the new runtimes. + + +{% if host_fn_count > 0 -%} +⚠️ The runtimes in this release contain {{ host_fn_count }} new **host function{{ host_fn_count | pluralize }}**. + +⚠️ It critical that you update your client before the chain switches to the new runtimes. {%- else -%} ℹ️ This release does not contain any new host function. {%- endif %} From b3397a55f8cf36fd1b0f41ea7ec414e235a4c18e Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Tue, 16 Nov 2021 16:36:23 +0100 Subject: [PATCH 15/46] Extract priority to a macro --- .../templates/global_priority.md.tera | 49 +++++++++++++------ scripts/changelog/templates/priority.md.tera | 21 ++++++++ 2 files changed, 54 insertions(+), 16 deletions(-) create mode 100644 scripts/changelog/templates/priority.md.tera diff --git a/scripts/changelog/templates/global_priority.md.tera b/scripts/changelog/templates/global_priority.md.tera index 6174b1d01aa..e0731122ad1 100644 --- a/scripts/changelog/templates/global_priority.md.tera +++ b/scripts/changelog/templates/global_priority.md.tera @@ -1,20 +1,37 @@ +{% import "priority.md.tera" as m_p -%} ## Global Priority -{%- if cumulus.meta.C and cumulus.meta.C.max >= 7-%} -{%- set prio = "❗️HIGH" -%} -{%- set txt = "You must upgrade as as soon as possible" -%} -{%- elif cumulus.meta.C and cumulus.meta.C.max >= 5 -%} -{%- set prio = "📣 Medium" -%} -{%- set txt = "You should upgrade in a timely manner" -%} -{%- elif cumulus.meta.C and cumulus.meta.C.max >= 3 -%} -{%- set prio = "📌 Low" -%} -{%- set txt = "You may upgrade at your convenience" -%} -{%- endif %} +{%- set cumulus_prio = 0 -%} +{%- set polkadot_prio = 0 -%} +{%- set substrate_prio = 0 -%} -{% if prio %} -{{ prio }}: {{ txt }} -{%- else -%} - -{% endif %} +{# We fetch the various priorities #} +{%- if cumulus.meta.C -%} + {%- set cumulus_prio = cumulus.meta.C.max -%} +{%- endif -%} +{%- if polkadot.meta.C -%} + {%- set polkadot_prio = polkadot.meta.C.max -%} +{%- endif -%} +{%- if substrate.meta.C -%} + {%- set substrate_prio = substrate.meta.C.max -%} +{%- endif -%} -{# to do: show high prio list here #} +{# We compute the global priority #} +{%- set global_prio = cumulus_prio -%} +{%- if polkadot_prio > global_prio -%} + {% set global_prio = polkadot_prio -%} +{%- endif -%} +{%- if substrate_prio > global_prio -%} + {%- set global_prio = substrate_prio -%} +{%- endif -%} + +{# We show the result #} +{{ m_p::priority(p=global_prio) }} + + + +{# todo: show high prio list here #} diff --git a/scripts/changelog/templates/priority.md.tera b/scripts/changelog/templates/priority.md.tera new file mode 100644 index 00000000000..08c8abef7d8 --- /dev/null +++ b/scripts/changelog/templates/priority.md.tera @@ -0,0 +1,21 @@ +{# This macro convert a priority level into readable output #} +{%- macro priority(p) -%} + +{%- if p >= 7 -%} + {%- set prio = "❗️HIGH" -%} + {%- set text = "This is a **high priority** release and you must upgrade as as soon as possible" -%} +{%- elif p >= 5 -%} + {%- set prio = "📣 Medium" -%} + {%- set text = "This is a medium priority release and you should upgrade in a timely manner" -%} +{%- elif p >= 3 -%} + {%- set prio = "📌 Low" -%} + {%- set text = "This is a low priority release and you may upgrade at your convenience" -%} +{%- endif %} + +{%- if prio %} +{{prio}}: {{text}} +{%- else -%} + +{% endif %} + +{%- endmacro priority -%} From 54b24b54698965bae357656df37ae9c0b973d0dd Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Tue, 16 Nov 2021 16:36:45 +0100 Subject: [PATCH 16/46] Cleanup --- scripts/changelog/templates/debug.md.tera | 4 ++-- scripts/changelog/templates/template.md.tera | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/changelog/templates/debug.md.tera b/scripts/changelog/templates/debug.md.tera index 5270ffa1411..29ac673a394 100644 --- a/scripts/changelog/templates/debug.md.tera +++ b/scripts/changelog/templates/debug.md.tera @@ -1,10 +1,10 @@ {%- set to_ignore = changes | filter(attribute="meta.B.value", value=0) %} ----- + diff --git a/scripts/changelog/templates/template.md.tera b/scripts/changelog/templates/template.md.tera index 2ff87d36598..75bede81ba4 100644 --- a/scripts/changelog/templates/template.md.tera +++ b/scripts/changelog/templates/template.md.tera @@ -1,5 +1,4 @@ {# This is the entry point of the template -#} - # {{ cumulus.repository.name | capitalize }} This release contains the changes between `{{ env.REF1 }}` and `{{ env.REF2 }}`. From 9f70235f3b787df59c37ed58d883ac39ab8dbc5f Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Tue, 16 Nov 2021 17:07:27 +0100 Subject: [PATCH 17/46] Fix misc changes --- scripts/changelog/templates/changes.md.tera | 12 +++---- .../templates/changes_client.md.tera | 2 +- .../changelog/templates/changes_misc.md.tera | 36 ++++++++++++------- 3 files changed, 31 insertions(+), 19 deletions(-) diff --git a/scripts/changelog/templates/changes.md.tera b/scripts/changelog/templates/changes.md.tera index 5ccf5179beb..6cc775cecc1 100644 --- a/scripts/changelog/templates/changes.md.tera +++ b/scripts/changelog/templates/changes.md.tera @@ -1,14 +1,14 @@ {# This include generates the section showing the changes #} ## Changes -{% include "changes_client.md.tera" %} - -{% include "changes_runtime.md.tera" %} - -{% include "changes_misc.md.tera" %} - **Legend:** - \[C\]: Cumulus - \[P\]: Polkadot - \[S\]: Substrate + +{% include "changes_client.md.tera" %} + +{% include "changes_runtime.md.tera" %} + +{% include "changes_misc.md.tera" %} diff --git a/scripts/changelog/templates/changes_client.md.tera b/scripts/changelog/templates/changes_client.md.tera index fb2a4f357b8..7eee69b2530 100644 --- a/scripts/changelog/templates/changes_client.md.tera +++ b/scripts/changelog/templates/changes_client.md.tera @@ -10,7 +10,7 @@ {%- else -%} {%- if pr.meta.B.value == 5 %} -- {{ m_c::change(c=pr) }} {{ pr.meta.B | json_encode }} +- {{ m_c::change(c=pr) }} {%- endif -%} {% endif -%} {% endif -%} diff --git a/scripts/changelog/templates/changes_misc.md.tera b/scripts/changelog/templates/changes_misc.md.tera index c8c9d854364..2baa2921ea1 100644 --- a/scripts/changelog/templates/changes_misc.md.tera +++ b/scripts/changelog/templates/changes_misc.md.tera @@ -1,27 +1,39 @@ {%- import "change.md.tera" as m_c -%} + +{%- set_global misc_count = 0 -%} +{#- First pass to count #} +{%- for pr in changes -%} + {%- if pr.meta.B %} + {%- if pr.meta.B.value == 0 -%} + {#- We skip silent ones -#} + {%- else -%} + {%- if pr.meta.B and pr.meta.B.value != 5 and pr.meta.B.value != 7 or pr.meta.C or not pr.meta.B %} +{%- set_global misc_count = misc_count + 1 -%} + {%- endif -%} + {% endif -%} + {% endif -%} +{% endfor %} + ### Misc +{% if misc_count > 10 %} +There are {{ misc_count }} misc. changes. You can expand the list below to view them all. +
{{ misc_count }} misc. changes +{% endif -%} + {#- 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.B.value == 1 %} + {%- if pr.meta.B and pr.meta.B.value != 5 and pr.meta.B.value != 7 or pr.meta.C or not pr.meta.B %} - {{ m_c::change(c=pr) }} {%- endif -%} {% endif -%} {% endif -%} {% endfor %} -{%- for pr in changes | sort(attribute="merged_at") %} - {%- if pr.meta.B and pr.meta.B.value == 0 %} - {#- We skip silent ones -#} - {%- else -%} - - {%- if pr.meta.B and pr.meta.B.value != 1 and pr.meta.B.value != 5 and pr.meta.B.value != 7 or pr.meta.C or not pr.meta.B %} -- {{ m_c::change(c=pr) }} - {%- endif -%} - {% endif -%} -{% endfor %} +{% if misc_count > 10 %} +
+{% endif -%} From 1a77940f6382912d70e78ea84f3e04d081cc7d33 Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Tue, 16 Nov 2021 17:56:30 +0100 Subject: [PATCH 18/46] Draft release workflow --- .github/workflows/draft_release.yml | 187 ++++++++++++++++++++++++++++ scripts/changelog/bin/changelog | 16 ++- 2 files changed, 198 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/draft_release.yml diff --git a/.github/workflows/draft_release.yml b/.github/workflows/draft_release.yml new file mode 100644 index 00000000000..3cd0e5347a3 --- /dev/null +++ b/.github/workflows/draft_release.yml @@ -0,0 +1,187 @@ +name: Publish draft release + +on: + # push: + # tags: + # # Catches v1.2.3 and v1.2.3-rc1 + # - v[0-9]+.[0-9]+.[0-9]+* + workflow_dispatch: + inputs: + previous_tag: + description: The previous tag to use for the diff + default: statemine-v5.0.0 + required: true + +jobs: + get-rust-versions: + runs-on: ubuntu-latest + container: + image: paritytech/ci-linux:production + outputs: + rustc-stable: ${{ steps.get-rust-versions.outputs.stable }} + rustc-nightly: ${{ steps.get-rust-versions.outputs.nightly }} + steps: + - id: get-rust-versions + run: | + echo "::set-output name=stable::$(rustc +stable --version)" + echo "::set-output name=nightly::$(rustc +nightly --version)" + + build-runtimes: + runs-on: ubuntu-latest + strategy: + matrix: + runtime: ["shell", "statemine", "statemint", "westmint", "rococo"] + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Cache target dir + uses: actions/cache@v2 + with: + path: "${{ github.workspace }}/runtime/${{ matrix.runtime }}/target" + key: srtool-target-${{ matrix.runtime }}-${{ github.sha }} + restore-keys: | + srtool-target-${{ matrix.runtime }}- + srtool-target- + + - name: Build ${{ matrix.runtime }} runtime + id: srtool_build + uses: chevdor/srtool-actions@v0.3.0 + with: + image: paritytech/srtool + chain: ${{ matrix.runtime }} + + - name: Store srtool digest to disk + run: | + echo '${{ steps.srtool_build.outputs.json }}' | \ + jq > ${{ matrix.runtime }}_srtool_output.json + + - name: Upload ${{ matrix.runtime }} srtool json + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.runtime }}-srtool-json + path: ${{ matrix.runtime }}_srtool_output.json + + - name: Upload ${{ matrix.runtime }} runtime + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.runtime }}-runtime + path: | + ${{ steps.srtool_build.outputs.wasm_compressed }} + + publish-draft-release: + runs-on: ubuntu-latest + needs: ["get-rust-versions", "build-runtimes"] + outputs: + release_url: ${{ steps.create-release.outputs.html_url }} + asset_upload_url: ${{ steps.create-release.outputs.upload_url }} + steps: + - name: Checkout sources + uses: actions/checkout@v2 + with: + fetch-depth: 0 + path: cumulus + + - name: Set up Ruby + uses: actions/setup-ruby@v1 + with: + ruby-version: 3.0 + + - name: Download srtool json output + uses: actions/download-artifact@v2 + + - name: Generate release notes + env: + RUSTC_STABLE: ${{ needs.get-rust-versions.outputs.rustc-stable }} + RUSTC_NIGHTLY: ${{ needs.get-rust-versions.outputs.rustc-nightly }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NO_CACHE: 1 + DEBUG: 1 + SHELL_DIGEST: ${{env.GITHUB_WORKSPACE}}/shell-srtool-json/shell_srtool_output.json + WESTMINT_DIGEST: ${{env.GITHUB_WORKSPACE}}/westmint-srtool-json/westmint_srtool_output.json + STATEMINE_DIGEST: ${{env.GITHUB_WORKSPACE}}/statemine-srtool-json/statemine_srtool_output.json + STATEMINT_DIGEST: ${{env.GITHUB_WORKSPACE}}/statemint-srtool-json/statemint_srtool_output.json + ROCOCO_DIGEST: ${{env.GITHUB_WORKSPACE}}/rococo-srtool-json/rococo_srtool_output.json + REF1: ${{ github.event.inputs.srtool_tag }} + REF2: HEAD + run: | + find ${{env.GITHUB_WORKSPACE}} -type f -name "*_srtool_output.json" + ls -al $SHELL_DIGEST + ls -al $WESTMINT_DIGEST + ls -al $STATEMINE_DIGEST + ls -al $STATEMINT_DIGEST + ls -al $ROCOCO_DIGEST + + echo "The diff will be computed from $REF1 to $REF2" + + pushd scripts/changelog &> /dev/null + gem install changelogerator + bundle install + ./bin/changelog $REF1 $REF2 | tee release_text.md + + ls -al release_text.md + cat release_text.md + + popd &> /dev/null + + - name: Create draft release + id: create-release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Parachains ${{ github.ref }} + body_path: ./release_text.md + draft: true + + publish-runtimes: + runs-on: ubuntu-latest + needs: ["publish-draft-release"] + strategy: + matrix: + runtime: ["shell", "statemine", "statemint", "westmint", "rococo"] + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Download artifacts + uses: actions/download-artifact@v2 + + - name: Set up Ruby 2.7 + uses: actions/setup-ruby@v1 + with: + ruby-version: 2.7 + + - name: Get runtime version + id: get-runtime-ver + run: | + ls + ls "${{ matrix.runtime }}-runtime" + runtime_ver="$(ruby -e 'require "./scripts/github/lib.rb"; puts get_runtime("${{ matrix.runtime }}")')" + echo "::set-output name=runtime_ver::$runtime_ver" + + - name: Upload compressed ${{ matrix.runtime }} wasm + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.publish-draft-release.outputs.asset_upload_url }} + asset_path: "${{ matrix.runtime }}-runtime/${{ matrix.runtime }}_runtime.compact.compressed.wasm" + asset_name: ${{ matrix.runtime }}_runtime-v${{ steps.get-runtime-ver.outputs.runtime_ver }}.compact.compressed.wasm + asset_content_type: application/wasm + + post_to_matrix: + runs-on: ubuntu-latest + needs: publish-draft-release + steps: + - name: Internal polkadot channel + uses: s3krit/matrix-message-action@v0.0.3 + with: + room_id: ${{ secrets.INTERNAL_POLKADOT_MATRIX_ROOM_ID }} + access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }} + message: | + **A new version of Cumulus was tagged**: + ${{ github.ref }}
+ Draft release created: ${{ needs.publish-draft-release.outputs.release_url }} + server: "matrix.parity.io" diff --git a/scripts/changelog/bin/changelog b/scripts/changelog/bin/changelog index b22ff529958..20d2719ddca 100755 --- a/scripts/changelog/bin/changelog +++ b/scripts/changelog/bin/changelog @@ -75,17 +75,23 @@ else logger.debug('Re-using:' + substrate_data) end +SHELL_DIGEST=${SHELL_DIGEST:-digests/shell-srtool-digest.json} +WESTMINT_DIGEST=${WESTMINT_DIGEST:-digests/westmint-srtool-digest.json} +STATEMINE_DIGEST=${STATEMINE_DIGEST:-digests/statemine-srtool-digest.json} +STATEMINT_DIGEST=${STATEMINT_DIGEST:-digests/rococo-srtool-digest.json} +ROCOCO_DIGEST=${ROCOCO_DIGEST:-digests/rococo-srtool-digest.json} + # Here we compose all the pieces together into one # single big json file. cmd = format('jq \ --slurpfile cumulus %s \ --slurpfile substrate %s \ --slurpfile polkadot %s \ - --slurpfile srtool_rococo digests/rococo-srtool-digest.json \ - --slurpfile srtool_shell digests/shell-srtool-digest.json \ - --slurpfile srtool_westmint digests/westmint-srtool-digest.json \ - --slurpfile srtool_statemint digests/statemint-srtool-digest.json \ - --slurpfile srtool_statemine digests/statemine-srtool-digest.json \ + --slurpfile srtool_shell $SHELL_DIGEST \ + --slurpfile srtool_westmint $WESTMINT_DIGEST \ + --slurpfile srtool_statemine $STATEMINE_DIGEST \ + --slurpfile srtool_statemint $STATEMINT_DIGEST \ + --slurpfile srtool_rococo $ROCOCO_DIGEST \ -n \'{ cumulus: $cumulus[0], substrate: $substrate[0], From 814a184fd5808395648ff9f54023f322bf9ce769 Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Tue, 16 Nov 2021 18:14:27 +0100 Subject: [PATCH 19/46] Fix runtime dir --- .github/workflows/draft_release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/draft_release.yml b/.github/workflows/draft_release.yml index 3cd0e5347a3..256e3541e35 100644 --- a/.github/workflows/draft_release.yml +++ b/.github/workflows/draft_release.yml @@ -50,6 +50,7 @@ jobs: with: image: paritytech/srtool chain: ${{ matrix.runtime }} + runtime_dir: polkadot-parachains/${{ matrix.runtime }} - name: Store srtool digest to disk run: | From adbfc8808f8844b8f0a5e1f3fbc1c0a9f649ccb4 Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Tue, 16 Nov 2021 18:32:43 +0100 Subject: [PATCH 20/46] Add ENV to ignore runtimes --- .github/workflows/draft_release.yml | 14 ++++++++------ scripts/changelog/bin/changelog | 27 ++++++++++++++++----------- 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/.github/workflows/draft_release.yml b/.github/workflows/draft_release.yml index 256e3541e35..ba76081aa7e 100644 --- a/.github/workflows/draft_release.yml +++ b/.github/workflows/draft_release.yml @@ -98,13 +98,15 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NO_CACHE: 1 DEBUG: 1 - SHELL_DIGEST: ${{env.GITHUB_WORKSPACE}}/shell-srtool-json/shell_srtool_output.json - WESTMINT_DIGEST: ${{env.GITHUB_WORKSPACE}}/westmint-srtool-json/westmint_srtool_output.json - STATEMINE_DIGEST: ${{env.GITHUB_WORKSPACE}}/statemine-srtool-json/statemine_srtool_output.json - STATEMINT_DIGEST: ${{env.GITHUB_WORKSPACE}}/statemint-srtool-json/statemint_srtool_output.json - ROCOCO_DIGEST: ${{env.GITHUB_WORKSPACE}}/rococo-srtool-json/rococo_srtool_output.json - REF1: ${{ github.event.inputs.srtool_tag }} + SHELL_DIGEST: ./shell-srtool-json/shell_srtool_output.json + WESTMINT_DIGEST: ./westmint-srtool-json/westmint_srtool_output.json + STATEMINE_DIGEST: ./statemine-srtool-json/statemine_srtool_output.json + STATEMINT_DIGEST: ./statemint-srtool-json/statemint_srtool_output.json + ROCOCO_DIGEST: ./rococo-srtool-json/rococo_srtool_output.json + REF1: ${{ github.event.inputs.previous_tag }} REF2: HEAD + HIDE_SRTOOL_ROCOCO: false + HIDE_SRTOOL_SHELL: false run: | find ${{env.GITHUB_WORKSPACE}} -type f -name "*_srtool_output.json" ls -al $SHELL_DIGEST diff --git a/scripts/changelog/bin/changelog b/scripts/changelog/bin/changelog index 20d2719ddca..3b8d3b1f18d 100755 --- a/scripts/changelog/bin/changelog +++ b/scripts/changelog/bin/changelog @@ -75,11 +75,11 @@ else logger.debug('Re-using:' + substrate_data) end -SHELL_DIGEST=${SHELL_DIGEST:-digests/shell-srtool-digest.json} -WESTMINT_DIGEST=${WESTMINT_DIGEST:-digests/westmint-srtool-digest.json} -STATEMINE_DIGEST=${STATEMINE_DIGEST:-digests/statemine-srtool-digest.json} -STATEMINT_DIGEST=${STATEMINT_DIGEST:-digests/rococo-srtool-digest.json} -ROCOCO_DIGEST=${ROCOCO_DIGEST:-digests/rococo-srtool-digest.json} +SHELL_DIGEST = ENV['SHELL_DIGEST'] || 'digests/shell-srtool-digest.json' +WESTMINT_DIGEST = ENV['WESTMINT_DIGEST'] || 'digests/westmint-srtool-digest.json' +STATEMINE_DIGEST = ENV['STATEMINE_DIGEST'] || 'digests/statemine-srtool-digest.json' +STATEMINT_DIGEST = ENV['STATEMINT_DIGEST'] || 'digests/rococo-srtool-digest.json' +ROCOCO_DIGEST = ENV['ROCOCO_DIGEST'] || 'digests/rococo-srtool-digest.json' # Here we compose all the pieces together into one # single big json file. @@ -87,11 +87,11 @@ cmd = format('jq \ --slurpfile cumulus %s \ --slurpfile substrate %s \ --slurpfile polkadot %s \ - --slurpfile srtool_shell $SHELL_DIGEST \ - --slurpfile srtool_westmint $WESTMINT_DIGEST \ - --slurpfile srtool_statemine $STATEMINE_DIGEST \ - --slurpfile srtool_statemint $STATEMINT_DIGEST \ - --slurpfile srtool_rococo $ROCOCO_DIGEST \ + --slurpfile srtool_shell %s \ + --slurpfile srtool_westmint %s \ + --slurpfile srtool_statemine %s \ + --slurpfile srtool_statemint %s \ + --slurpfile srtool_rococo %s \ -n \'{ cumulus: $cumulus[0], substrate: $substrate[0], @@ -102,7 +102,12 @@ cmd = format('jq \ { name: "westmint", data: $srtool_westmint[0] }, { name: "statemint", data: $srtool_statemint[0] }, { name: "statemine", data: $srtool_statemine[0] } - ] }\' | tee context.json', cumulus_data, substrate_data, polkadot_data) + ] }\' | tee context.json', cumulus_data, substrate_data, polkadot_data, + SHELL_DIGEST, + WESTMINT_DIGEST, + STATEMINE_DIGEST, + STATEMINT_DIGEST, + ROCOCO_DIGEST) system(cmd) cmd = 'tera --env --env-key env --include-path templates --template templates/template.md.tera context.json | tee release-notes-cumulus.md' From 2362201633e24d104a73192dbb0650ecbe4c230d Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Wed, 17 Nov 2021 11:30:36 +0100 Subject: [PATCH 21/46] Install tooling separately --- .github/workflows/draft_release.yml | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/.github/workflows/draft_release.yml b/.github/workflows/draft_release.yml index ba76081aa7e..99e440a5d8b 100644 --- a/.github/workflows/draft_release.yml +++ b/.github/workflows/draft_release.yml @@ -7,10 +7,14 @@ on: # - v[0-9]+.[0-9]+.[0-9]+* workflow_dispatch: inputs: - previous_tag: - description: The previous tag to use for the diff + ref1: + description: The 'from' tag to use for the diff default: statemine-v5.0.0 required: true + ref2: + description: The 'to' tag to use for the diff + default: HEAD + required: true jobs: get-rust-versions: @@ -91,6 +95,14 @@ jobs: - name: Download srtool json output uses: actions/download-artifact@v2 + - name: Prepare tooling + run: | + pushd scripts/changelog &> /dev/null + gem install changelogerator + bundle install + changelogerator --help + popd &> /dev/null + - name: Generate release notes env: RUSTC_STABLE: ${{ needs.get-rust-versions.outputs.rustc-stable }} @@ -103,8 +115,8 @@ jobs: STATEMINE_DIGEST: ./statemine-srtool-json/statemine_srtool_output.json STATEMINT_DIGEST: ./statemint-srtool-json/statemint_srtool_output.json ROCOCO_DIGEST: ./rococo-srtool-json/rococo_srtool_output.json - REF1: ${{ github.event.inputs.previous_tag }} - REF2: HEAD + REF1: ${{ github.event.inputs.ref1 }} + REF2: ${{ github.event.inputs.ref2 }} HIDE_SRTOOL_ROCOCO: false HIDE_SRTOOL_SHELL: false run: | @@ -116,15 +128,12 @@ jobs: ls -al $ROCOCO_DIGEST echo "The diff will be computed from $REF1 to $REF2" - pushd scripts/changelog &> /dev/null - gem install changelogerator - bundle install + ./bin/changelog $REF1 $REF2 | tee release_text.md ls -al release_text.md cat release_text.md - popd &> /dev/null - name: Create draft release From 66ae85d2d537277891791b2665ee7c837d7b8451 Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Wed, 17 Nov 2021 12:02:15 +0100 Subject: [PATCH 22/46] WIP troubleshooting - remove sudo --- .github/workflows/draft_release.yml | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/.github/workflows/draft_release.yml b/.github/workflows/draft_release.yml index 99e440a5d8b..72fba44604b 100644 --- a/.github/workflows/draft_release.yml +++ b/.github/workflows/draft_release.yml @@ -30,6 +30,24 @@ jobs: echo "::set-output name=stable::$(rustc +stable --version)" echo "::set-output name=nightly::$(rustc +nightly --version)" + # test: + # runs-on: ubuntu-latest + # steps: + # - name: Checkout sources + # uses: actions/checkout@v2 + # with: + # fetch-depth: 0 + # path: cumulus + # - uses: ruby/setup-ruby@v1 + # with: + # ruby-version: 3.0.0 + # - name: Prepare tooling + # run: | + # cd cumulus/scripts/changelog + # sudo gem install bundler changelogerator + # bundle install + # changelogerator --help + build-runtimes: runs-on: ubuntu-latest strategy: @@ -87,21 +105,19 @@ jobs: fetch-depth: 0 path: cumulus - - name: Set up Ruby - uses: actions/setup-ruby@v1 + - uses: ruby/setup-ruby@v1 with: - ruby-version: 3.0 + ruby-version: 3.0.0 - name: Download srtool json output uses: actions/download-artifact@v2 - name: Prepare tooling run: | - pushd scripts/changelog &> /dev/null - gem install changelogerator + cd cumulus/scripts/changelog + gem install bundler changelogerator bundle install changelogerator --help - popd &> /dev/null - name: Generate release notes env: From a26cf4a1e9c8c363aab7801145906dd2d5bdf84b Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Wed, 17 Nov 2021 14:41:06 +0100 Subject: [PATCH 23/46] Minor formatting fixes --- scripts/changelog/.env | 2 ++ scripts/changelog/.gitignore | 2 +- scripts/changelog/templates/change.md.tera | 10 +++++----- scripts/changelog/templates/changes.md.tera | 8 ++++---- scripts/changelog/templates/template.md.tera | 7 ++++--- 5 files changed, 16 insertions(+), 13 deletions(-) diff --git a/scripts/changelog/.env b/scripts/changelog/.env index 0472f95c958..0ec358f68e3 100644 --- a/scripts/changelog/.env +++ b/scripts/changelog/.env @@ -3,3 +3,5 @@ RUST_NIGHTLY="1.57.0-nightly (51e514c0f 2021-09-12)" PRE_RELEASE=true HIDE_SRTOOL_ROCOCO=true HIDE_SRTOOL_SHELL=true +REF1=statemine-v5.0.0 +REF2=HEAD diff --git a/scripts/changelog/.gitignore b/scripts/changelog/.gitignore index 895ea7c4112..20869bda8df 100644 --- a/scripts/changelog/.gitignore +++ b/scripts/changelog/.gitignore @@ -1,3 +1,3 @@ changelog.md *.json -release-notes*.md +release*.md diff --git a/scripts/changelog/templates/change.md.tera b/scripts/changelog/templates/change.md.tera index 34c31b76dbe..2f8223437f2 100644 --- a/scripts/changelog/templates/change.md.tera +++ b/scripts/changelog/templates/change.md.tera @@ -1,5 +1,5 @@ {# This macro shows ONE change #} -{%- macro change(c) -%} +{%- macro change(c, cml="☁️", dot="🔗", sub="🔬") -%} {%- if c.meta.C and c.meta.C.value >= 7 -%} {%- set prio = " ❗️HIGH" -%} @@ -27,11 +27,11 @@ #} {%- if c.html_url is containing("polkadot") -%} -{%- set repo = "[P]" -%} +{%- set repo = dot -%} {%- elif c.html_url is containing("cumulus") -%} -{%- set repo = "[C]" -%} +{%- set repo = cml -%} {%- elif c.html_url is containing("substrate") -%} -{%- set repo = "[S]" -%} +{%- set repo = sub -%} {%- else -%} {%- set repo = " " -%} {%- endif -%} @@ -41,5 +41,5 @@ {%- else -%} {%- set xcm = "" -%} {%- endif -%} -{{repo}} {{ audit }}[`#{{c.number}}`]({{c.html_url}}) {{- prio }} - {{ c.title | capitalize | truncate(length=60, end="…") }}{{xcm }} +{{- repo }} {{ audit }}[`#{{c.number}}`]({{c.html_url}}) {{- prio }} - {{ c.title | capitalize | truncate(length=60, end="…") }}{{xcm }} {%- endmacro change -%} diff --git a/scripts/changelog/templates/changes.md.tera b/scripts/changelog/templates/changes.md.tera index 6cc775cecc1..4a846088197 100644 --- a/scripts/changelog/templates/changes.md.tera +++ b/scripts/changelog/templates/changes.md.tera @@ -1,11 +1,11 @@ {# This include generates the section showing the changes #} ## Changes -**Legend:** +### Legend -- \[C\]: Cumulus -- \[P\]: Polkadot -- \[S\]: Substrate +- {{ CML }} Cumulus +- {{ DOT }} Polkadot +- {{ SUB }} Substrate {% include "changes_client.md.tera" %} diff --git a/scripts/changelog/templates/template.md.tera b/scripts/changelog/templates/template.md.tera index 75bede81ba4..effc863f4db 100644 --- a/scripts/changelog/templates/template.md.tera +++ b/scripts/changelog/templates/template.md.tera @@ -5,10 +5,11 @@ This release contains the changes between `{{ env.REF1 }}` and `{{ env.REF2 }}`. {%- set changes = cumulus.changes | concat(with=substrate.changes) -%} {%- set changes = changes | concat(with=polkadot.changes) -%} - -{% if env.DEBUG %} {%- include "debug.md.tera" -%} -{% endif %} + +{%- set CML = "☁️" -%} +{%- set DOT = "🔗" -%} +{%- set SUB = "🔬" -%} {# header warning and important notices -#} {% include "pre_release.md.tera" -%} From e1e066a6f76d9de34ab315a3c1d817aa7fce5d9d Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Wed, 17 Nov 2021 14:42:19 +0100 Subject: [PATCH 24/46] Fix workflow --- .github/workflows/draft_release.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/draft_release.yml b/.github/workflows/draft_release.yml index 72fba44604b..ae7de725260 100644 --- a/.github/workflows/draft_release.yml +++ b/.github/workflows/draft_release.yml @@ -144,13 +144,10 @@ jobs: ls -al $ROCOCO_DIGEST echo "The diff will be computed from $REF1 to $REF2" - pushd scripts/changelog &> /dev/null - + cd cumulus/scripts/changelog ./bin/changelog $REF1 $REF2 | tee release_text.md - ls -al release_text.md cat release_text.md - popd &> /dev/null - name: Create draft release id: create-release From c00a34c10e87f169cbef09d3aebe2ef26eeea8c9 Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Wed, 17 Nov 2021 15:25:05 +0100 Subject: [PATCH 25/46] Add missing dep --- scripts/changelog/Gemfile | 6 ++++-- scripts/changelog/Gemfile.lock | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/changelog/Gemfile b/scripts/changelog/Gemfile index 26e64d056a4..f2d7c3bd716 100644 --- a/scripts/changelog/Gemfile +++ b/scripts/changelog/Gemfile @@ -8,12 +8,14 @@ gem 'octokit', '~> 4' gem 'git_diff_parser', '~> 3' -gem 'rake', group: :dev +gem 'toml', '~> 0.3.0' -gem 'test-unit', group: :dev +gem 'rake', group: :dev gem 'optparse', '~> 0.1.1' gem 'logger', '~> 1.4' +gem 'test-unit', group: :dev + gem 'rubocop', group: :dev, require: false diff --git a/scripts/changelog/Gemfile.lock b/scripts/changelog/Gemfile.lock index 8bacdfa4d52..855d7f91a54 100644 --- a/scripts/changelog/Gemfile.lock +++ b/scripts/changelog/Gemfile.lock @@ -33,6 +33,7 @@ GEM parallel (1.21.0) parser (3.0.2.0) ast (~> 2.4.1) + parslet (2.0.0) power_assert (2.0.1) public_suffix (4.0.6) rainbow (3.0.0) @@ -57,6 +58,8 @@ GEM faraday (> 0.8, < 2.0) test-unit (3.5.1) power_assert + toml (0.3.0) + parslet (>= 1.8.0, < 3.0.0) unicode-display_width (2.1.0) PLATFORMS @@ -70,6 +73,7 @@ DEPENDENCIES rake rubocop test-unit + toml (~> 0.3.0) BUNDLED WITH 2.2.22 From 31594ea3005e62c9bf7be2a4a7e6d17337a066d9 Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Wed, 17 Nov 2021 15:25:19 +0100 Subject: [PATCH 26/46] Linting --- scripts/changelog/bin/changelog | 37 ++++++++++++++++-------------- scripts/changelog/lib/changelog.rb | 1 + 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/scripts/changelog/bin/changelog b/scripts/changelog/bin/changelog index 3b8d3b1f18d..01b6f13bf72 100755 --- a/scripts/changelog/bin/changelog +++ b/scripts/changelog/bin/changelog @@ -24,7 +24,7 @@ ref2 = ARGV[1] || 'HEAD' ENV['REF1'] = ref1 ENV['REF2'] = ref2 -gh_cumulus = SubRef.new(format('%s/%s', owner, repo)) +gh_cumulus = SubRef.new(format('%s/%s', [owner, repo])) polkadot_ref1 = gh_cumulus.get_dependency_reference(ref1, 'polkadot-client') polkadot_ref2 = gh_cumulus.get_dependency_reference(ref2, 'polkadot-client') @@ -32,47 +32,48 @@ polkadot_ref2 = gh_cumulus.get_dependency_reference(ref2, 'polkadot-client') substrate_ref1 = gh_cumulus.get_dependency_reference(ref1, 'sp-io') substrate_ref2 = gh_cumulus.get_dependency_reference(ref2, 'sp-io') -logger.debug('Polkadot from: ' + polkadot_ref1) -logger.debug('Polkadot to: ' + polkadot_ref2) +logger.debug("Polkadot from: #{polkadot_ref1}") +logger.debug("Polkadot to: #{polkadot_ref2}") -logger.debug('Substrate from: ' + substrate_ref1) -logger.debug('Substrate to: ' + substrate_ref2) +logger.debug("Substrate from: #{substrate_ref1}") +logger.debug("Substrate to: #{substrate_ref2}") cumulus_data = 'cumulus.json' substrate_data = 'substrate.json' polkadot_data = 'polkadot.json' -logger.debug('Using CUMULUS: ' + cumulus_data) -logger.debug('Using SUBSTRATE: ' + substrate_data) -logger.debug('Using POLKADOT: ' + polkadot_data) +logger.debug("Using CUMULUS: #{cumulus_data}") +logger.debug("Using SUBSTRATE: #{substrate_data}") +logger.debug("Using POLKADOT: #{polkadot_data}") logger.warn('NO_CACHE set') if ENV['NO_CACHE'] # This is acting as cache so we don't spend time querying while testing if ENV['NO_CACHE'] || !File.file?(cumulus_data) logger.debug(format('Fetching data for Cumulus into %s', cumulus_data)) - cmd = format('changelogerator %s/%s -f %s -t %s > %s', owner, repo, ref1, ref2, cumulus_data) + cmd = format('changelogerator %s/%s -f %s -t %s > %s', + [owner, repo, ref1, ref2, cumulus_data]) system(cmd) else - logger.debug('Re-using:' + cumulus_data) + logger.debug("Re-using:#{cumulus_data}") end if ENV['NO_CACHE'] || !File.file?(polkadot_data) logger.debug(format('Fetching data for Polkadot into %s', polkadot_data)) - cmd = format('changelogerator %s/%s -f %s -t %s > %s', owner, 'polkadot', polkadot_ref1, polkadot_ref2, - polkadot_data) + cmd = format('changelogerator %s/%s -f %s -t %s > %s', + [owner, 'polkadot', polkadot_ref1, polkadot_ref2, polkadot_data]) system(cmd) else - logger.debug('Re-using:' + polkadot_data) + logger.debug("Re-using:#{polkadot_data}") end if ENV['NO_CACHE'] || !File.file?(substrate_data) logger.debug(format('Fetching data for Substrate into %s', substrate_data)) - cmd = format('changelogerator %s/%s -f %s -t %s > %s', owner, 'substrate', substrate_ref1, substrate_ref2, - substrate_data) + cmd = format('changelogerator %s/%s -f %s -t %s > %s', + [owner, 'substrate', substrate_ref1, substrate_ref2, substrate_data]) system(cmd) else - logger.debug('Re-using:' + substrate_data) + logger.debug("Re-using:#{substrate_data}") end SHELL_DIGEST = ENV['SHELL_DIGEST'] || 'digests/shell-srtool-digest.json' @@ -110,5 +111,7 @@ cmd = format('jq \ ROCOCO_DIGEST) system(cmd) -cmd = 'tera --env --env-key env --include-path templates --template templates/template.md.tera context.json | tee release-notes-cumulus.md' +cmd = 'tera --env --env-key env --include-path templates + --template templates/template.md.tera context.json | + tee release-notes-cumulus.md' system(cmd) diff --git a/scripts/changelog/lib/changelog.rb b/scripts/changelog/lib/changelog.rb index 0e1dc90837f..2d9ee29a8c8 100644 --- a/scripts/changelog/lib/changelog.rb +++ b/scripts/changelog/lib/changelog.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true +# A Class to find Substrate references class SubRef require 'octokit' require 'toml' From 3fc97115a549d7b7df48860ba35717b1d9087960 Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Wed, 17 Nov 2021 16:21:39 +0100 Subject: [PATCH 27/46] Fix changelog script --- scripts/changelog/bin/changelog | 12 ++++++------ scripts/changelog/templates/template.md.tera | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/changelog/bin/changelog b/scripts/changelog/bin/changelog index 01b6f13bf72..8e66b2c571d 100755 --- a/scripts/changelog/bin/changelog +++ b/scripts/changelog/bin/changelog @@ -24,7 +24,7 @@ ref2 = ARGV[1] || 'HEAD' ENV['REF1'] = ref1 ENV['REF2'] = ref2 -gh_cumulus = SubRef.new(format('%s/%s', [owner, repo])) +gh_cumulus = SubRef.new(format('%s/%s', { owner: owner, repo: repo })) polkadot_ref1 = gh_cumulus.get_dependency_reference(ref1, 'polkadot-client') polkadot_ref2 = gh_cumulus.get_dependency_reference(ref2, 'polkadot-client') @@ -52,7 +52,7 @@ logger.warn('NO_CACHE set') if ENV['NO_CACHE'] if ENV['NO_CACHE'] || !File.file?(cumulus_data) logger.debug(format('Fetching data for Cumulus into %s', cumulus_data)) cmd = format('changelogerator %s/%s -f %s -t %s > %s', - [owner, repo, ref1, ref2, cumulus_data]) + { owner: owner, repo: repo, from: ref1, to: ref2, output: cumulus_data }) system(cmd) else logger.debug("Re-using:#{cumulus_data}") @@ -61,7 +61,7 @@ end if ENV['NO_CACHE'] || !File.file?(polkadot_data) logger.debug(format('Fetching data for Polkadot into %s', polkadot_data)) cmd = format('changelogerator %s/%s -f %s -t %s > %s', - [owner, 'polkadot', polkadot_ref1, polkadot_ref2, polkadot_data]) + { owner: owner, repo: 'polkadot', from: polkadot_ref1, to: polkadot_ref2, output: polkadot_data }) system(cmd) else logger.debug("Re-using:#{polkadot_data}") @@ -70,7 +70,7 @@ end if ENV['NO_CACHE'] || !File.file?(substrate_data) logger.debug(format('Fetching data for Substrate into %s', substrate_data)) cmd = format('changelogerator %s/%s -f %s -t %s > %s', - [owner, 'substrate', substrate_ref1, substrate_ref2, substrate_data]) + { owner: owner, repo: 'substrate', from: substrate_ref1, to: substrate_ref2, output: substrate_data }) system(cmd) else logger.debug("Re-using:#{substrate_data}") @@ -111,7 +111,7 @@ cmd = format('jq \ ROCOCO_DIGEST) system(cmd) -cmd = 'tera --env --env-key env --include-path templates - --template templates/template.md.tera context.json | +cmd = 'tera --env --env-key env --include-path templates \ + --template templates/template.md.tera context.json | \ tee release-notes-cumulus.md' system(cmd) diff --git a/scripts/changelog/templates/template.md.tera b/scripts/changelog/templates/template.md.tera index effc863f4db..b4edf44ef02 100644 --- a/scripts/changelog/templates/template.md.tera +++ b/scripts/changelog/templates/template.md.tera @@ -1,7 +1,7 @@ {# This is the entry point of the template -#} # {{ cumulus.repository.name | capitalize }} -This release contains the changes between `{{ env.REF1 }}` and `{{ env.REF2 }}`. +This release contains the changes from `{{ env.REF1 }}` to `{{ env.REF2 }}`. {%- set changes = cumulus.changes | concat(with=substrate.changes) -%} {%- set changes = changes | concat(with=polkadot.changes) -%} From eeaa8c87f118edc2d56564e61db3a6d24f87f066 Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Wed, 17 Nov 2021 17:02:01 +0100 Subject: [PATCH 28/46] Add missing tera install --- .github/workflows/draft_release.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/draft_release.yml b/.github/workflows/draft_release.yml index ae7de725260..d94d77bd930 100644 --- a/.github/workflows/draft_release.yml +++ b/.github/workflows/draft_release.yml @@ -119,6 +119,11 @@ jobs: bundle install changelogerator --help + URL=https://github.com/chevdor/tera-cli/releases/download/v0.2.1/tera-cli_linux_amd64.deb + wget $URL -O tera.deb + sudo dpkg -i tera.deb + tera --version + - name: Generate release notes env: RUSTC_STABLE: ${{ needs.get-rust-versions.outputs.rustc-stable }} From 1b373e501536837f9fa47e765b38e55d39284e11 Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Wed, 17 Nov 2021 17:44:24 +0100 Subject: [PATCH 29/46] Use absolute paths --- .github/workflows/draft_release.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/draft_release.yml b/.github/workflows/draft_release.yml index d94d77bd930..02d5595b05f 100644 --- a/.github/workflows/draft_release.yml +++ b/.github/workflows/draft_release.yml @@ -131,11 +131,11 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NO_CACHE: 1 DEBUG: 1 - SHELL_DIGEST: ./shell-srtool-json/shell_srtool_output.json - WESTMINT_DIGEST: ./westmint-srtool-json/westmint_srtool_output.json - STATEMINE_DIGEST: ./statemine-srtool-json/statemine_srtool_output.json - STATEMINT_DIGEST: ./statemint-srtool-json/statemint_srtool_output.json - ROCOCO_DIGEST: ./rococo-srtool-json/rococo_srtool_output.json + SHELL_DIGEST: ${{ github.workspace}}/shell-srtool-json/shell_srtool_output.json + WESTMINT_DIGEST: ${{ github.workspace}}/westmint-srtool-json/westmint_srtool_output.json + STATEMINE_DIGEST: ${{ github.workspace}}/statemine-srtool-json/statemine_srtool_output.json + STATEMINT_DIGEST: ${{ github.workspace}}/statemint-srtool-json/statemint_srtool_output.json + ROCOCO_DIGEST: ${{ github.workspace}}/rococo-srtool-json/rococo_srtool_output.json REF1: ${{ github.event.inputs.ref1 }} REF2: ${{ github.event.inputs.ref2 }} HIDE_SRTOOL_ROCOCO: false @@ -149,7 +149,7 @@ jobs: ls -al $ROCOCO_DIGEST echo "The diff will be computed from $REF1 to $REF2" - cd cumulus/scripts/changelog + cd scripts/changelog ./bin/changelog $REF1 $REF2 | tee release_text.md ls -al release_text.md cat release_text.md From 3dc122d76e5d5c9cebefd65543ad7f5a66c26a89 Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Wed, 17 Nov 2021 18:16:52 +0100 Subject: [PATCH 30/46] Fix path + cleanup --- .github/workflows/draft_release.yml | 20 +------------------- scripts/changelog/.env | 4 ++-- scripts/changelog/templates/runtime.md.tera | 6 ++++++ 3 files changed, 9 insertions(+), 21 deletions(-) diff --git a/.github/workflows/draft_release.yml b/.github/workflows/draft_release.yml index 02d5595b05f..04d9c5073d6 100644 --- a/.github/workflows/draft_release.yml +++ b/.github/workflows/draft_release.yml @@ -30,24 +30,6 @@ jobs: echo "::set-output name=stable::$(rustc +stable --version)" echo "::set-output name=nightly::$(rustc +nightly --version)" - # test: - # runs-on: ubuntu-latest - # steps: - # - name: Checkout sources - # uses: actions/checkout@v2 - # with: - # fetch-depth: 0 - # path: cumulus - # - uses: ruby/setup-ruby@v1 - # with: - # ruby-version: 3.0.0 - # - name: Prepare tooling - # run: | - # cd cumulus/scripts/changelog - # sudo gem install bundler changelogerator - # bundle install - # changelogerator --help - build-runtimes: runs-on: ubuntu-latest strategy: @@ -149,7 +131,7 @@ jobs: ls -al $ROCOCO_DIGEST echo "The diff will be computed from $REF1 to $REF2" - cd scripts/changelog + cd cumulus/scripts/changelog ./bin/changelog $REF1 $REF2 | tee release_text.md ls -al release_text.md cat release_text.md diff --git a/scripts/changelog/.env b/scripts/changelog/.env index 0ec358f68e3..715f4a07ea6 100644 --- a/scripts/changelog/.env +++ b/scripts/changelog/.env @@ -1,5 +1,5 @@ -RUST_STABLE="1.55.0 (c8dfcfe04 2021-09-06)" -RUST_NIGHTLY="1.57.0-nightly (51e514c0f 2021-09-12)" +RUST_STABLE="rustc 1.56.1 (59eed8a2a 2021-11-01)" +RUST_NIGHTLY="rustc 1.57.0-nightly (51e514c0f 2021-09-12)" PRE_RELEASE=true HIDE_SRTOOL_ROCOCO=true HIDE_SRTOOL_SHELL=true diff --git a/scripts/changelog/templates/runtime.md.tera b/scripts/changelog/templates/runtime.md.tera index dc9ecdea6cc..c7209a4cecf 100644 --- a/scripts/changelog/templates/runtime.md.tera +++ b/scripts/changelog/templates/runtime.md.tera @@ -10,6 +10,12 @@ {%- endif %} {%- set comp_ratio = 100 - (runtime.data.runtimes.compressed.subwasm.compression.size_compressed / runtime.data.runtimes.compressed.subwasm.compression.size_decompressed *100) %} + + + + + + ``` 🏋️ Runtime Size: {{ runtime.data.runtimes.compressed.subwasm.size | filesizeformat }} ({{ runtime.data.runtimes.compressed.subwasm.size }} bytes) 🔥 Core Version: statemine-600 (statemine-0.tx4.au1) From 043d4e158b98039c836adf19c44e2d5684a1a6b1 Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Thu, 18 Nov 2021 09:47:16 +0100 Subject: [PATCH 31/46] Fix changelog generation --- .github/workflows/draft_release.yml | 6 ++---- scripts/changelog/bin/changelog | 5 ++--- scripts/changelog/templates/runtime.md.tera | 2 -- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/draft_release.yml b/.github/workflows/draft_release.yml index 04d9c5073d6..1d23583dc8a 100644 --- a/.github/workflows/draft_release.yml +++ b/.github/workflows/draft_release.yml @@ -134,7 +134,6 @@ jobs: cd cumulus/scripts/changelog ./bin/changelog $REF1 $REF2 | tee release_text.md ls -al release_text.md - cat release_text.md - name: Create draft release id: create-release @@ -142,7 +141,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: ${{ github.ref }} + tag_name: parachains-${{ github.ref }} release_name: Parachains ${{ github.ref }} body_path: ./release_text.md draft: true @@ -160,8 +159,7 @@ jobs: - name: Download artifacts uses: actions/download-artifact@v2 - - name: Set up Ruby 2.7 - uses: actions/setup-ruby@v1 + - uses: ruby/setup-ruby@v1 with: ruby-version: 2.7 diff --git a/scripts/changelog/bin/changelog b/scripts/changelog/bin/changelog index 8e66b2c571d..d442055d6f6 100755 --- a/scripts/changelog/bin/changelog +++ b/scripts/changelog/bin/changelog @@ -103,7 +103,7 @@ cmd = format('jq \ { name: "westmint", data: $srtool_westmint[0] }, { name: "statemint", data: $srtool_statemint[0] }, { name: "statemine", data: $srtool_statemine[0] } - ] }\' | tee context.json', cumulus_data, substrate_data, polkadot_data, + ] }\' > context.json', cumulus_data, substrate_data, polkadot_data, SHELL_DIGEST, WESTMINT_DIGEST, STATEMINE_DIGEST, @@ -112,6 +112,5 @@ cmd = format('jq \ system(cmd) cmd = 'tera --env --env-key env --include-path templates \ - --template templates/template.md.tera context.json | \ - tee release-notes-cumulus.md' + --template templates/template.md.tera context.json' system(cmd) diff --git a/scripts/changelog/templates/runtime.md.tera b/scripts/changelog/templates/runtime.md.tera index c7209a4cecf..6e444a93ef2 100644 --- a/scripts/changelog/templates/runtime.md.tera +++ b/scripts/changelog/templates/runtime.md.tera @@ -10,11 +10,9 @@ {%- endif %} {%- set comp_ratio = 100 - (runtime.data.runtimes.compressed.subwasm.compression.size_compressed / runtime.data.runtimes.compressed.subwasm.compression.size_decompressed *100) %} - - ``` 🏋️ Runtime Size: {{ runtime.data.runtimes.compressed.subwasm.size | filesizeformat }} ({{ runtime.data.runtimes.compressed.subwasm.size }} bytes) From 87e18fa64bc03ebc901376b3b01cc1ad9a13ce80 Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Thu, 18 Nov 2021 10:23:05 +0100 Subject: [PATCH 32/46] Add missing pre-release ENV --- .github/workflows/draft_release.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/draft_release.yml b/.github/workflows/draft_release.yml index 1d23583dc8a..5263ef661b1 100644 --- a/.github/workflows/draft_release.yml +++ b/.github/workflows/draft_release.yml @@ -15,6 +15,10 @@ on: description: The 'to' tag to use for the diff default: HEAD required: true + pre_release: + description: For pre-releases + default: "true" + required: true jobs: get-rust-versions: @@ -120,6 +124,7 @@ jobs: ROCOCO_DIGEST: ${{ github.workspace}}/rococo-srtool-json/rococo_srtool_output.json REF1: ${{ github.event.inputs.ref1 }} REF2: ${{ github.event.inputs.ref2 }} + PRE_RELEASE: ${{ github.event.inputs.pre_release }} HIDE_SRTOOL_ROCOCO: false HIDE_SRTOOL_SHELL: false run: | From 6b75d6189a68651651f24afd2faeb74473f13a64 Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Thu, 18 Nov 2021 11:08:40 +0100 Subject: [PATCH 33/46] Fix rust version ENV --- scripts/changelog/.env | 4 ++-- scripts/changelog/templates/compiler.md.tera | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/changelog/.env b/scripts/changelog/.env index 715f4a07ea6..570760eb862 100644 --- a/scripts/changelog/.env +++ b/scripts/changelog/.env @@ -1,5 +1,5 @@ -RUST_STABLE="rustc 1.56.1 (59eed8a2a 2021-11-01)" -RUST_NIGHTLY="rustc 1.57.0-nightly (51e514c0f 2021-09-12)" +RUSTC_STABLE="rustc 1.56.1 (59eed8a2a 2021-11-01)" +RUSTC_NIGHTLY="rustc 1.57.0-nightly (51e514c0f 2021-09-12)" PRE_RELEASE=true HIDE_SRTOOL_ROCOCO=true HIDE_SRTOOL_SHELL=true diff --git a/scripts/changelog/templates/compiler.md.tera b/scripts/changelog/templates/compiler.md.tera index c6699bfa2e1..0420a88c396 100644 --- a/scripts/changelog/templates/compiler.md.tera +++ b/scripts/changelog/templates/compiler.md.tera @@ -2,5 +2,5 @@ This release was tested against the following versions of `rustc`. Other versions may work. -- Rust Stable: `{{ env.RUST_STABLE }}` -- Rust Nightly: `{{ env.RUST_NIGHTLY }}` +- Rust Stable: `{{ env.RUSTC_STABLE }}` +- Rust Nightly: `{{ env.RUSTC_NIGHTLY }}` From 3caa80713b664977c73ae28ef2d00b02a004f072 Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Thu, 18 Nov 2021 12:09:46 +0100 Subject: [PATCH 34/46] Fix release notes path --- .github/workflows/draft_release.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/draft_release.yml b/.github/workflows/draft_release.yml index 5263ef661b1..befeec6ff5d 100644 --- a/.github/workflows/draft_release.yml +++ b/.github/workflows/draft_release.yml @@ -148,7 +148,7 @@ jobs: with: tag_name: parachains-${{ github.ref }} release_name: Parachains ${{ github.ref }} - body_path: ./release_text.md + body_path: ./cumulus/scripts/changelog/release_text.md draft: true publish-runtimes: @@ -168,13 +168,13 @@ jobs: with: ruby-version: 2.7 - - name: Get runtime version - id: get-runtime-ver - run: | - ls - ls "${{ matrix.runtime }}-runtime" - runtime_ver="$(ruby -e 'require "./scripts/github/lib.rb"; puts get_runtime("${{ matrix.runtime }}")')" - echo "::set-output name=runtime_ver::$runtime_ver" + # - name: Get runtime version + # id: get-runtime-ver + # run: | + # ls + # ls "${{ matrix.runtime }}-runtime" + # runtime_ver="$(ruby -e 'require "./scripts/github/lib.rb"; puts get_runtime("${{ matrix.runtime }}")')" + # echo "::set-output name=runtime_ver::$runtime_ver" - name: Upload compressed ${{ matrix.runtime }} wasm uses: actions/upload-release-asset@v1 @@ -183,7 +183,8 @@ jobs: with: upload_url: ${{ needs.publish-draft-release.outputs.asset_upload_url }} asset_path: "${{ matrix.runtime }}-runtime/${{ matrix.runtime }}_runtime.compact.compressed.wasm" - asset_name: ${{ matrix.runtime }}_runtime-v${{ steps.get-runtime-ver.outputs.runtime_ver }}.compact.compressed.wasm + # asset_name: ${{ matrix.runtime }}_runtime-v${{ steps.get-runtime-ver.outputs.runtime_ver }}.compact.compressed.wasm + asset_name: ${{ matrix.runtime }}_runtime.compact.compressed.wasm asset_content_type: application/wasm post_to_matrix: From 403bc220e15edfcdc184ac6ef507f50dbd5ee036 Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Thu, 18 Nov 2021 14:30:44 +0100 Subject: [PATCH 35/46] Fix output --- .github/workflows/draft_release.yml | 32 ++++++++++--------- scripts/changelog/bin/changelog | 5 +-- .../changelog/templates/changes_misc.md.tera | 2 +- scripts/changelog/templates/runtime.md.tera | 10 +++--- scripts/github/runtime-version.rb | 10 ++++++ 5 files changed, 36 insertions(+), 23 deletions(-) create mode 100644 scripts/github/runtime-version.rb diff --git a/.github/workflows/draft_release.yml b/.github/workflows/draft_release.yml index befeec6ff5d..6c195ee3d8a 100644 --- a/.github/workflows/draft_release.yml +++ b/.github/workflows/draft_release.yml @@ -137,8 +137,8 @@ jobs: echo "The diff will be computed from $REF1 to $REF2" cd cumulus/scripts/changelog - ./bin/changelog $REF1 $REF2 | tee release_text.md - ls -al release_text.md + ./bin/changelog $REF1 $REF2 release-notes.md + ls -al release-notes.md - name: Create draft release id: create-release @@ -148,7 +148,7 @@ jobs: with: tag_name: parachains-${{ github.ref }} release_name: Parachains ${{ github.ref }} - body_path: ./cumulus/scripts/changelog/release_text.md + body_path: ./cumulus/scripts/changelog/release-notes.md draft: true publish-runtimes: @@ -166,15 +166,15 @@ jobs: - uses: ruby/setup-ruby@v1 with: - ruby-version: 2.7 + ruby-version: 3.0.0 - # - name: Get runtime version - # id: get-runtime-ver - # run: | - # ls - # ls "${{ matrix.runtime }}-runtime" - # runtime_ver="$(ruby -e 'require "./scripts/github/lib.rb"; puts get_runtime("${{ matrix.runtime }}")')" - # echo "::set-output name=runtime_ver::$runtime_ver" + - name: Get runtime version + id: get-runtime-ver + run: | + ls + ls "${{ matrix.runtime }}-runtime" + runtime_ver="$(ruby -e 'require "./scripts/github/runtime-version.rb"; puts get_runtime("${{ matrix.runtime }}")')" + echo "::set-output name=runtime_ver::$runtime_ver" - name: Upload compressed ${{ matrix.runtime }} wasm uses: actions/upload-release-asset@v1 @@ -183,8 +183,7 @@ jobs: with: upload_url: ${{ needs.publish-draft-release.outputs.asset_upload_url }} asset_path: "${{ matrix.runtime }}-runtime/${{ matrix.runtime }}_runtime.compact.compressed.wasm" - # asset_name: ${{ matrix.runtime }}_runtime-v${{ steps.get-runtime-ver.outputs.runtime_ver }}.compact.compressed.wasm - asset_name: ${{ matrix.runtime }}_runtime.compact.compressed.wasm + asset_name: ${{ matrix.runtime }}_runtime-v${{ steps.get-runtime-ver.outputs.runtime_ver }}.compact.compressed.wasm asset_content_type: application/wasm post_to_matrix: @@ -197,7 +196,10 @@ jobs: room_id: ${{ secrets.INTERNAL_POLKADOT_MATRIX_ROOM_ID }} access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }} message: | - **A new version of Cumulus was tagged**: + ## New draft for **${GITHUB_REPOSITORY}** + ${{ github.ref }}
- Draft release created: ${{ needs.publish-draft-release.outputs.release_url }} + Draft release created: [Link to draft](${{ needs.publish-draft-release.outputs.release_url }}) + The link above will no longer be valid if the draft is edited. You can then use the following link: + [${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/releases](${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/releases) server: "matrix.parity.io" diff --git a/scripts/changelog/bin/changelog b/scripts/changelog/bin/changelog index d442055d6f6..b52d6c6e8f8 100755 --- a/scripts/changelog/bin/changelog +++ b/scripts/changelog/bin/changelog @@ -20,6 +20,7 @@ repo = 'cumulus' ref1 = ARGV[0] ref2 = ARGV[1] || 'HEAD' +output = ARGV[2] || 'release-notes.md' ENV['REF1'] = ref1 ENV['REF2'] = ref2 @@ -111,6 +112,6 @@ cmd = format('jq \ ROCOCO_DIGEST) system(cmd) -cmd = 'tera --env --env-key env --include-path templates \ - --template templates/template.md.tera context.json' +cmd = format('tera --env --env-key env --include-path templates \ + --template templates/template.md.tera context.json > %s', output) system(cmd) diff --git a/scripts/changelog/templates/changes_misc.md.tera b/scripts/changelog/templates/changes_misc.md.tera index 2baa2921ea1..64f8c40ef59 100644 --- a/scripts/changelog/templates/changes_misc.md.tera +++ b/scripts/changelog/templates/changes_misc.md.tera @@ -17,7 +17,7 @@ ### Misc {% if misc_count > 10 %} -There are {{ misc_count }} misc. changes. You can expand the list below to view them all. +There are {{ misc_count }} other misc. changes. You can expand the list below to view them all.
{{ misc_count }} misc. changes {% endif -%} diff --git a/scripts/changelog/templates/runtime.md.tera b/scripts/changelog/templates/runtime.md.tera index 6e444a93ef2..50dffb1625e 100644 --- a/scripts/changelog/templates/runtime.md.tera +++ b/scripts/changelog/templates/runtime.md.tera @@ -15,12 +15,12 @@ ``` -🏋️ Runtime Size: {{ runtime.data.runtimes.compressed.subwasm.size | filesizeformat }} ({{ runtime.data.runtimes.compressed.subwasm.size }} bytes) -🔥 Core Version: statemine-600 (statemine-0.tx4.au1) -🗜 Compressed: {{ compressed }}: {{ comp_ratio | round(method="ceil", precision=2) }}% +🏋️ Runtime Size: {{ runtime.data.runtimes.compressed.subwasm.size | filesizeformat }} ({{ runtime.data.runtimes.compressed.subwasm.size }} bytes) +🔥 Core Version: statemine-600 (statemine-0.tx4.au1) +🗜 Compressed: {{ compressed }}: {{ comp_ratio | round(method="ceil", precision=2) }}% 🗳️ system.setCode hash: {{ runtime.data.runtimes.compressed.subwasm.proposal_hash }} 🗳️ authorizeUpgrade hash: {{ runtime.data.runtimes.compressed.subwasm.parachain_authorize_upgrade_hash }} -#️⃣ Blake2-256 hash: {{ runtime.data.runtimes.compressed.subwasm.blake2_256 }} -📦 IPFS: {{ runtime.data.runtimes.compressed.subwasm.ipfs_hash }} +#️⃣ Blake2-256 hash: {{ runtime.data.runtimes.compressed.subwasm.blake2_256 }} +📦 IPFS: {{ runtime.data.runtimes.compressed.subwasm.ipfs_hash }} ``` {%- endmacro runtime %} diff --git a/scripts/github/runtime-version.rb b/scripts/github/runtime-version.rb new file mode 100644 index 00000000000..4d1f873863d --- /dev/null +++ b/scripts/github/runtime-version.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +# Gets the runtime version for a given runtime from the filesystem. +# Optionally accepts a path that is the root of the project which defaults to +# the current working directory +def get_runtime(runtime, path = '.') + File.open(path + "/runtime/#{runtime}/src/lib.rs") do |f| + f.find { |l| l =~ /spec_version/ }.match(/[0-9]+/)[0] + end +end From 68fecf08f1d4a463529b4a91ceb6de67c2a479f5 Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Thu, 18 Nov 2021 15:26:13 +0100 Subject: [PATCH 36/46] Fix runtime_dir for cumulus --- .github/workflows/draft_release.yml | 5 ++++- scripts/changelog/bin/changelog | 1 - scripts/github/runtime-version.rb | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/draft_release.yml b/.github/workflows/draft_release.yml index 6c195ee3d8a..f5b957099b8 100644 --- a/.github/workflows/draft_release.yml +++ b/.github/workflows/draft_release.yml @@ -154,6 +154,8 @@ jobs: publish-runtimes: runs-on: ubuntu-latest needs: ["publish-draft-release"] + env: + RUNTIME_DIR: polkadot-parachains strategy: matrix: runtime: ["shell", "statemine", "statemint", "westmint", "rococo"] @@ -173,7 +175,8 @@ jobs: run: | ls ls "${{ matrix.runtime }}-runtime" - runtime_ver="$(ruby -e 'require "./scripts/github/runtime-version.rb"; puts get_runtime("${{ matrix.runtime }}")')" + runtime_ver="$(ruby -e 'require "./scripts/github/runtime-version.rb"; \ + puts get_runtime(runtime: "${{ matrix.runtime }}", runtime_dir: "${RUNTIME_DIR}" )')" echo "::set-output name=runtime_ver::$runtime_ver" - name: Upload compressed ${{ matrix.runtime }} wasm diff --git a/scripts/changelog/bin/changelog b/scripts/changelog/bin/changelog index b52d6c6e8f8..2a94892c2d1 100755 --- a/scripts/changelog/bin/changelog +++ b/scripts/changelog/bin/changelog @@ -17,7 +17,6 @@ logger.debug('Starting') owner = 'paritytech' repo = 'cumulus' - ref1 = ARGV[0] ref2 = ARGV[1] || 'HEAD' output = ARGV[2] || 'release-notes.md' diff --git a/scripts/github/runtime-version.rb b/scripts/github/runtime-version.rb index 4d1f873863d..8df7dc15319 100644 --- a/scripts/github/runtime-version.rb +++ b/scripts/github/runtime-version.rb @@ -3,8 +3,8 @@ # Gets the runtime version for a given runtime from the filesystem. # Optionally accepts a path that is the root of the project which defaults to # the current working directory -def get_runtime(runtime, path = '.') - File.open(path + "/runtime/#{runtime}/src/lib.rs") do |f| +def get_runtime(runtime, path: '.', runtime_dir: 'runtime') + File.open(path + "/#{runtime_dir}/#{runtime}/src/lib.rs") do |f| f.find { |l| l =~ /spec_version/ }.match(/[0-9]+/)[0] end end From 363c5376d6413cb997398972165bcf9c7b98d9be Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Thu, 18 Nov 2021 17:30:55 +0100 Subject: [PATCH 37/46] Fix --- scripts/github/runtime-version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/github/runtime-version.rb b/scripts/github/runtime-version.rb index 8df7dc15319..14663acaf31 100644 --- a/scripts/github/runtime-version.rb +++ b/scripts/github/runtime-version.rb @@ -3,7 +3,7 @@ # Gets the runtime version for a given runtime from the filesystem. # Optionally accepts a path that is the root of the project which defaults to # the current working directory -def get_runtime(runtime, path: '.', runtime_dir: 'runtime') +def get_runtime(runtime: nil, path: '.', runtime_dir: 'runtime') File.open(path + "/#{runtime_dir}/#{runtime}/src/lib.rs") do |f| f.find { |l| l =~ /spec_version/ }.match(/[0-9]+/)[0] end From d4a50735becf49b2d527f189c782a257e9c5bbdf Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Fri, 19 Nov 2021 10:26:59 +0100 Subject: [PATCH 38/46] Fix ENV substitutions --- .github/workflows/draft_release.yml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/draft_release.yml b/.github/workflows/draft_release.yml index f5b957099b8..4b78beec90e 100644 --- a/.github/workflows/draft_release.yml +++ b/.github/workflows/draft_release.yml @@ -173,10 +173,13 @@ jobs: - name: Get runtime version id: get-runtime-ver run: | - ls - ls "${{ matrix.runtime }}-runtime" - runtime_ver="$(ruby -e 'require "./scripts/github/runtime-version.rb"; \ - puts get_runtime(runtime: "${{ matrix.runtime }}", runtime_dir: "${RUNTIME_DIR}" )')" + ls "$RUNTIME_DIR" + ls "$RUNTIME_DIR/${{ matrix.runtime }}" + + # This first line is to apply the substitution of the ENV + cmd="ruby -e 'require \"./scripts/github/runtime-version.rb\"; puts get_runtime(runtime: \"${{ matrix.runtime }}\", runtime_dir: \"$RUNTIME_DIR\")'" + runtime_ver=$(bash -c ${cmd}) + echo "::set-output name=runtime_ver::$runtime_ver" - name: Upload compressed ${{ matrix.runtime }} wasm @@ -199,10 +202,10 @@ jobs: room_id: ${{ secrets.INTERNAL_POLKADOT_MATRIX_ROOM_ID }} access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }} message: | - ## New draft for **${GITHUB_REPOSITORY}** + **New draft for ${{ github.repository }}**: ${{ github.ref }}
+ + Draft release created: [draft](${{ needs.publish-draft-release.outputs.release_url }}) - ${{ github.ref }}
- Draft release created: [Link to draft](${{ needs.publish-draft-release.outputs.release_url }}) - The link above will no longer be valid if the draft is edited. You can then use the following link: - [${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/releases](${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/releases) + NOTE: The link above will no longer be valid if the draft is edited. You can then use the following link: + [${{ github.server_url }}/${{ github.repository }}/releases](${{ github.server_url }}/${{ github.repository }}/releases) server: "matrix.parity.io" From 2ae9c75d9a96f0ce8deba5ebd80f50500280e64c Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Fri, 19 Nov 2021 12:05:48 +0100 Subject: [PATCH 39/46] Fix styling --- scripts/changelog/templates/change.md.tera | 8 ++++---- scripts/changelog/templates/priority.md.tera | 6 +++--- scripts/changelog/templates/runtime.md.tera | 5 +++-- scripts/changelog/templates/runtimes.md.tera | 4 +--- scripts/changelog/templates/template.md.tera | 6 +++--- 5 files changed, 14 insertions(+), 15 deletions(-) diff --git a/scripts/changelog/templates/change.md.tera b/scripts/changelog/templates/change.md.tera index 2f8223437f2..f92d79583b4 100644 --- a/scripts/changelog/templates/change.md.tera +++ b/scripts/changelog/templates/change.md.tera @@ -1,12 +1,12 @@ {# This macro shows ONE change #} -{%- macro change(c, cml="☁️", dot="🔗", sub="🔬") -%} +{%- macro change(c, cml="[C]", dot="[P]", sub="[S]") -%} {%- if c.meta.C and c.meta.C.value >= 7 -%} -{%- set prio = " ❗️HIGH" -%} +{%- set prio = " ‼️ HIGH" -%} {%- elif c.meta.C and c.meta.C.value >= 5 -%} -{%- set prio = " 📣 Medium" -%} +{%- set prio = " ❗️ Medium" -%} {%- elif c.meta.C and c.meta.C.value >= 3 -%} -{%- set prio = " 📌 Low" -%} +{%- set prio = " Low" -%} {%- else -%} {%- set prio = "" -%} {%- endif -%} diff --git a/scripts/changelog/templates/priority.md.tera b/scripts/changelog/templates/priority.md.tera index 08c8abef7d8..0391bd6c298 100644 --- a/scripts/changelog/templates/priority.md.tera +++ b/scripts/changelog/templates/priority.md.tera @@ -2,13 +2,13 @@ {%- macro priority(p) -%} {%- if p >= 7 -%} - {%- set prio = "❗️HIGH" -%} + {%- set prio = "‼️ HIGH" -%} {%- set text = "This is a **high priority** release and you must upgrade as as soon as possible" -%} {%- elif p >= 5 -%} - {%- set prio = "📣 Medium" -%} + {%- set prio = "❗️ Medium" -%} {%- set text = "This is a medium priority release and you should upgrade in a timely manner" -%} {%- elif p >= 3 -%} - {%- set prio = "📌 Low" -%} + {%- set prio = "Low" -%} {%- set text = "This is a low priority release and you may upgrade at your convenience" -%} {%- endif %} diff --git a/scripts/changelog/templates/runtime.md.tera b/scripts/changelog/templates/runtime.md.tera index 50dffb1625e..755008cd649 100644 --- a/scripts/changelog/templates/runtime.md.tera +++ b/scripts/changelog/templates/runtime.md.tera @@ -1,7 +1,7 @@ {# This macro shows one runtime #} {%- macro runtime(runtime) -%} -### {{ runtime.name | capitalize }}: `{{ runtime.data.runtimes.compressed.subwasm.core_version }} Metadata V{{ runtime.data.runtimes.compressed.subwasm.metadata_version }}` +### {{ runtime.name | capitalize }} {%- if runtime.data.runtimes.compressed.subwasm.compression.compressed %} {%- set compressed = "Yes" %} @@ -16,8 +16,9 @@ ``` 🏋️ Runtime Size: {{ runtime.data.runtimes.compressed.subwasm.size | filesizeformat }} ({{ runtime.data.runtimes.compressed.subwasm.size }} bytes) -🔥 Core Version: statemine-600 (statemine-0.tx4.au1) +🔥 Core Version: {{ runtime.data.runtimes.compressed.subwasm.core_version }} 🗜 Compressed: {{ compressed }}: {{ comp_ratio | round(method="ceil", precision=2) }}% +🎁 Metadata version: {{ runtime.data.runtimes.compressed.subwasm.metadata_version }} 🗳️ system.setCode hash: {{ runtime.data.runtimes.compressed.subwasm.proposal_hash }} 🗳️ authorizeUpgrade hash: {{ runtime.data.runtimes.compressed.subwasm.parachain_authorize_upgrade_hash }} #️⃣ Blake2-256 hash: {{ runtime.data.runtimes.compressed.subwasm.blake2_256 }} diff --git a/scripts/changelog/templates/runtimes.md.tera b/scripts/changelog/templates/runtimes.md.tera index 1e855d15287..52f2a116415 100644 --- a/scripts/changelog/templates/runtimes.md.tera +++ b/scripts/changelog/templates/runtimes.md.tera @@ -6,9 +6,7 @@ {% set rtm = srtool[0] -%} The Details about the runtimes included in this release can be found below. -They have been generated using [srtool](https://github.com/paritytech/srtool): -- `{{ rtm.data.gen }}` -- `{{ rtm.data.rustc }}` +They have been generated using [{{ rtm.data.gen }}](https://github.com/paritytech/srtool) and `{{ rtm.data.rustc }}`. {%- for runtime in srtool | sort(attribute="name") %} {%- set HIDE_VAR = "HIDE_SRTOOL_" ~ runtime.name | upper %} diff --git a/scripts/changelog/templates/template.md.tera b/scripts/changelog/templates/template.md.tera index b4edf44ef02..f758efbaa70 100644 --- a/scripts/changelog/templates/template.md.tera +++ b/scripts/changelog/templates/template.md.tera @@ -7,9 +7,9 @@ This release contains the changes from `{{ env.REF1 }}` to `{{ env.REF2 }}`. {%- set changes = changes | concat(with=polkadot.changes) -%} {%- include "debug.md.tera" -%} -{%- set CML = "☁️" -%} -{%- set DOT = "🔗" -%} -{%- set SUB = "🔬" -%} +{%- set CML = "[C]" -%} +{%- set DOT = "[P]" -%} +{%- set SUB = "[S]" -%} {# header warning and important notices -#} {% include "pre_release.md.tera" -%} From 8b2f22b268e47b9080e91937a0359a2d57985b58 Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Fri, 19 Nov 2021 12:27:54 +0100 Subject: [PATCH 40/46] Debugging --- .github/workflows/draft_release.yml | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/.github/workflows/draft_release.yml b/.github/workflows/draft_release.yml index 4b78beec90e..5590f72be40 100644 --- a/.github/workflows/draft_release.yml +++ b/.github/workflows/draft_release.yml @@ -21,6 +21,31 @@ on: required: true jobs: + runtime-versions: + runs-on: ubuntu-latest + env: + RUNTIME_DIR: polkadot-parachains + strategy: + matrix: + runtime: ["shell", "statemine", "statemint", "westmint", "rococo"] + steps: + - name: Checkout sources + uses: actions/checkout@v2 + - name: Get runtime version for ${{ matrix.runtime }} + id: get-runtime-ver + run: | + ls "$RUNTIME_DIR/${{ matrix.runtime }}" + + # This first line is to apply the substitution of the ENV + cmd="ruby -e 'require \"./scripts/github/runtime-version.rb\"; puts get_runtime(runtime: \"${{ matrix.runtime }}\", runtime_dir: \"$RUNTIME_DIR\")'" + runtime_ver=$(bash -c ${cmd}) + + echo "::set-output name=runtime_ver::$runtime_ver" + + - name: Show version for ${{ matrix.runtime }} + run: | + echo ${{ matrix.runtime }}_runtime-v${{ steps.get-runtime-ver.outputs.runtime_ver }}.compact.compressed.wasm + get-rust-versions: runs-on: ubuntu-latest container: @@ -173,13 +198,12 @@ jobs: - name: Get runtime version id: get-runtime-ver run: | - ls "$RUNTIME_DIR" ls "$RUNTIME_DIR/${{ matrix.runtime }}" # This first line is to apply the substitution of the ENV cmd="ruby -e 'require \"./scripts/github/runtime-version.rb\"; puts get_runtime(runtime: \"${{ matrix.runtime }}\", runtime_dir: \"$RUNTIME_DIR\")'" runtime_ver=$(bash -c ${cmd}) - + echo "Found version:$runtime_ver" echo "::set-output name=runtime_ver::$runtime_ver" - name: Upload compressed ${{ matrix.runtime }} wasm From 3da8fd8d2bef334f62b079890f1c40e26f11e018 Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Fri, 19 Nov 2021 15:07:29 +0100 Subject: [PATCH 41/46] Styling --- scripts/changelog/templates/changes_client.md.tera | 2 +- scripts/changelog/templates/changes_misc.md.tera | 2 +- scripts/changelog/templates/changes_runtime.md.tera | 2 +- scripts/changelog/templates/host_functions.md.tera | 12 ++++++++---- scripts/changelog/templates/runtimes.md.tera | 4 ++-- scripts/changelog/templates/template.md.tera | 3 +-- 6 files changed, 14 insertions(+), 11 deletions(-) diff --git a/scripts/changelog/templates/changes_client.md.tera b/scripts/changelog/templates/changes_client.md.tera index 7eee69b2530..36fb6b9de68 100644 --- a/scripts/changelog/templates/changes_client.md.tera +++ b/scripts/changelog/templates/changes_client.md.tera @@ -9,7 +9,7 @@ {#- We skip silent ones -#} {%- else -%} - {%- if pr.meta.B.value == 5 %} + {%- if pr.meta.B.value == 5 and not pr.title is containing("ompanion") %} - {{ m_c::change(c=pr) }} {%- endif -%} {% endif -%} diff --git a/scripts/changelog/templates/changes_misc.md.tera b/scripts/changelog/templates/changes_misc.md.tera index 64f8c40ef59..f956e0f7b1c 100644 --- a/scripts/changelog/templates/changes_misc.md.tera +++ b/scripts/changelog/templates/changes_misc.md.tera @@ -23,7 +23,7 @@ There are {{ misc_count }} other misc. changes. You can expand the list below to {#- The changes are sorted by merge date #} {%- for pr in changes | sort(attribute="merged_at") %} - {%- if pr.meta.B %} + {%- if pr.meta.B and not pr.title is containing("ompanion") %} {%- if pr.meta.B.value == 0 %} {#- We skip silent ones -#} {%- else -%} diff --git a/scripts/changelog/templates/changes_runtime.md.tera b/scripts/changelog/templates/changes_runtime.md.tera index 86bd988f77e..67da1ebbc39 100644 --- a/scripts/changelog/templates/changes_runtime.md.tera +++ b/scripts/changelog/templates/changes_runtime.md.tera @@ -10,7 +10,7 @@ {#- We skip silent ones -#} {%- else -%} -{%- if pr.meta.B.value == 7 %} +{%- if pr.meta.B.value == 7 and not pr.title is containing("ompanion") %} - {{ m_c::change(c=pr) }} {%- endif -%} {%- endif -%} diff --git a/scripts/changelog/templates/host_functions.md.tera b/scripts/changelog/templates/host_functions.md.tera index 98e6c9868cd..161d451ff1d 100644 --- a/scripts/changelog/templates/host_functions.md.tera +++ b/scripts/changelog/templates/host_functions.md.tera @@ -17,10 +17,14 @@ -{% if host_fn_count > 0 -%} -⚠️ The runtimes in this release contain {{ host_fn_count }} new **host function{{ host_fn_count | pluralize }}**. +{% if host_fn_count == 0 -%} +ℹ️ This release does not contain any new host functions. +{% elif host_fn_count == 1 -%} +⚠️ The runtimes in this release contain one new **host function**. -⚠️ It critical that you update your client before the chain switches to the new runtimes. +⚠️ It is critical that you update your client before the chain switches to the new runtimes. {%- else -%} -ℹ️ This release does not contain any new host function. +⚠️ The runtimes in this release contain {{ host_fn_count }} new **host function{{ host_fn_count | pluralize }}**. + +⚠️ It is critical that you update your client before the chain switches to the new runtimes. {%- endif %} diff --git a/scripts/changelog/templates/runtimes.md.tera b/scripts/changelog/templates/runtimes.md.tera index 52f2a116415..600c5f17dc9 100644 --- a/scripts/changelog/templates/runtimes.md.tera +++ b/scripts/changelog/templates/runtimes.md.tera @@ -5,8 +5,8 @@ {% set rtm = srtool[0] -%} -The Details about the runtimes included in this release can be found below. -They have been generated using [{{ rtm.data.gen }}](https://github.com/paritytech/srtool) and `{{ rtm.data.rustc }}`. +The information about the runtimes included in this release can be found below. +The runtimes have been built using [{{ rtm.data.gen }}](https://github.com/paritytech/srtool) and `{{ rtm.data.rustc }}`. {%- for runtime in srtool | sort(attribute="name") %} {%- set HIDE_VAR = "HIDE_SRTOOL_" ~ runtime.name | upper %} diff --git a/scripts/changelog/templates/template.md.tera b/scripts/changelog/templates/template.md.tera index f758efbaa70..105579e13cf 100644 --- a/scripts/changelog/templates/template.md.tera +++ b/scripts/changelog/templates/template.md.tera @@ -1,6 +1,5 @@ {# This is the entry point of the template -#} -# {{ cumulus.repository.name | capitalize }} - + This release contains the changes from `{{ env.REF1 }}` to `{{ env.REF2 }}`. {%- set changes = cumulus.changes | concat(with=substrate.changes) -%} From 9a9453fb1edf9e3fcaeea7573bdd04006e158823 Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Fri, 19 Nov 2021 15:07:47 +0100 Subject: [PATCH 42/46] Fix call to fetch the runtime version --- .github/workflows/draft_release.yml | 38 ++++++----------------------- 1 file changed, 7 insertions(+), 31 deletions(-) diff --git a/.github/workflows/draft_release.yml b/.github/workflows/draft_release.yml index 5590f72be40..16c49fb8cf3 100644 --- a/.github/workflows/draft_release.yml +++ b/.github/workflows/draft_release.yml @@ -21,31 +21,6 @@ on: required: true jobs: - runtime-versions: - runs-on: ubuntu-latest - env: - RUNTIME_DIR: polkadot-parachains - strategy: - matrix: - runtime: ["shell", "statemine", "statemint", "westmint", "rococo"] - steps: - - name: Checkout sources - uses: actions/checkout@v2 - - name: Get runtime version for ${{ matrix.runtime }} - id: get-runtime-ver - run: | - ls "$RUNTIME_DIR/${{ matrix.runtime }}" - - # This first line is to apply the substitution of the ENV - cmd="ruby -e 'require \"./scripts/github/runtime-version.rb\"; puts get_runtime(runtime: \"${{ matrix.runtime }}\", runtime_dir: \"$RUNTIME_DIR\")'" - runtime_ver=$(bash -c ${cmd}) - - echo "::set-output name=runtime_ver::$runtime_ver" - - - name: Show version for ${{ matrix.runtime }} - run: | - echo ${{ matrix.runtime }}_runtime-v${{ steps.get-runtime-ver.outputs.runtime_ver }}.compact.compressed.wasm - get-rust-versions: runs-on: ubuntu-latest container: @@ -195,15 +170,16 @@ jobs: with: ruby-version: 3.0.0 - - name: Get runtime version + - name: Get runtime version for ${{ matrix.runtime }} id: get-runtime-ver run: | - ls "$RUNTIME_DIR/${{ matrix.runtime }}" + echo "require './scripts/github/runtime-version.rb'" > script.rb + echo "puts get_runtime(runtime: \"${{ matrix.runtime }}\", runtime_dir: \"$RUNTIME_DIR\")" >> script.rb - # This first line is to apply the substitution of the ENV - cmd="ruby -e 'require \"./scripts/github/runtime-version.rb\"; puts get_runtime(runtime: \"${{ matrix.runtime }}\", runtime_dir: \"$RUNTIME_DIR\")'" - runtime_ver=$(bash -c ${cmd}) - echo "Found version:$runtime_ver" + echo "Current folder: $PWD" + ls "$RUNTIME_DIR/${{ matrix.runtime }}" + runtime_ver=$(ruby script.rb) + echo "Found version: >$runtime_ver<" echo "::set-output name=runtime_ver::$runtime_ver" - name: Upload compressed ${{ matrix.runtime }} wasm From a386d1524041b1ba4058725c47f492896eab3c26 Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Fri, 19 Nov 2021 16:24:59 +0100 Subject: [PATCH 43/46] Cleanup and doc --- .github/workflows/draft_release.yml | 4 ---- scripts/changelog/.gitignore | 1 + scripts/changelog/README.md | 17 +++++++++++++---- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/.github/workflows/draft_release.yml b/.github/workflows/draft_release.yml index 16c49fb8cf3..72258efa0a4 100644 --- a/.github/workflows/draft_release.yml +++ b/.github/workflows/draft_release.yml @@ -1,10 +1,6 @@ name: Publish draft release on: - # push: - # tags: - # # Catches v1.2.3 and v1.2.3-rc1 - # - v[0-9]+.[0-9]+.[0-9]+* workflow_dispatch: inputs: ref1: diff --git a/scripts/changelog/.gitignore b/scripts/changelog/.gitignore index 20869bda8df..4fbcc523b04 100644 --- a/scripts/changelog/.gitignore +++ b/scripts/changelog/.gitignore @@ -1,3 +1,4 @@ changelog.md *.json release*.md +.env diff --git a/scripts/changelog/README.md b/scripts/changelog/README.md index 10e6d9fc4d3..7226530c42a 100644 --- a/scripts/changelog/README.md +++ b/scripts/changelog/README.md @@ -19,14 +19,23 @@ For instance: ./bin/changelog statemine-v5.0.0 ``` -A file called `release-notes-cumulus.md` will be generated and can be used for the release. +A file called `release-notes.md` will be generated and can be used for the release. ## ENV -You may use the following ENV: -- DEBUG -- NO_CACHE +You may use the following ENV for testing: +``` +RUSTC_STABLE="rustc 1.56.1 (59eed8a2a 2021-11-01)" +RUSTC_NIGHTLY="rustc 1.57.0-nightly (51e514c0f 2021-09-12)" +PRE_RELEASE=true +HIDE_SRTOOL_ROCOCO=true +HIDE_SRTOOL_SHELL=true +REF1=statemine-v5.0.0 +REF2=HEAD +DEBUG=1 +NO_CACHE=1 +``` ## Considered labels The following list will likely evolve over time and it will be hard to keep it in sync. From a6c9ba987ca961698830bc06cdf11efe4fb10373 Mon Sep 17 00:00:00 2001 From: Chevdor Date: Fri, 19 Nov 2021 16:40:19 +0100 Subject: [PATCH 44/46] Delete sample .env --- scripts/changelog/.env | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 scripts/changelog/.env diff --git a/scripts/changelog/.env b/scripts/changelog/.env deleted file mode 100644 index 570760eb862..00000000000 --- a/scripts/changelog/.env +++ /dev/null @@ -1,7 +0,0 @@ -RUSTC_STABLE="rustc 1.56.1 (59eed8a2a 2021-11-01)" -RUSTC_NIGHTLY="rustc 1.57.0-nightly (51e514c0f 2021-09-12)" -PRE_RELEASE=true -HIDE_SRTOOL_ROCOCO=true -HIDE_SRTOOL_SHELL=true -REF1=statemine-v5.0.0 -REF2=HEAD From 68cb0ed12b889a3dbc80a2dec3998fce3396ab95 Mon Sep 17 00:00:00 2001 From: Chevdor Date: Fri, 19 Nov 2021 16:58:36 +0100 Subject: [PATCH 45/46] Update scripts/changelog/templates/change.md.tera Co-authored-by: Alexander Popiak --- scripts/changelog/templates/change.md.tera | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/changelog/templates/change.md.tera b/scripts/changelog/templates/change.md.tera index f92d79583b4..826ba700488 100644 --- a/scripts/changelog/templates/change.md.tera +++ b/scripts/changelog/templates/change.md.tera @@ -14,7 +14,7 @@ {%- set audit = "" -%} {# {%- if c.meta.D and c.meta.D.value == 1 -%} -{%- set audit = "✅ audtited " -%} +{%- set audit = "✅ audited " -%} {%- elif c.meta.D and c.meta.D.value == 2 -%} {%- set audit = "✅ trivial " -%} {%- elif c.meta.D and c.meta.D.value == 3 -%} From 6265a1c1ed45f97d957867f8939883d86e3e63aa Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Fri, 19 Nov 2021 17:04:04 +0100 Subject: [PATCH 46/46] =?UTF-8?q?Change=20XCM=20emoji=20marker=20for=20a?= =?UTF-8?q?=20=E2=9C=89=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/changelog/templates/change.md.tera | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/changelog/templates/change.md.tera b/scripts/changelog/templates/change.md.tera index 826ba700488..7a4c9a357c3 100644 --- a/scripts/changelog/templates/change.md.tera +++ b/scripts/changelog/templates/change.md.tera @@ -37,7 +37,7 @@ {%- endif -%} {%- if c.meta.T and c.meta.T.value == 6 -%} -{%- set xcm = " [⛓ XCM]" -%} +{%- set xcm = " [✉️ XCM]" -%} {%- else -%} {%- set xcm = "" -%} {%- endif -%}