* Fix doc

* Formatting fixes and bump prio if host functions are detected

* Add canvas

* Bump canvas-kusama's runtime version to 800

* Add db migrations

* Prepare for client releases

* Split the upload of the context artifact

* Rename of the srtool digests to match script default expectations

* Fix runtime name for canvas

* Fix jobs dependencies when skipping jobs/steps for client builds

* Fix CI for the client builds

* Fix issue when building in client mode

* Bump checkout action to v3 and gate some tests

* Fix notification

ref #851
This commit is contained in:
Chevdor
2022-03-28 10:00:07 +02:00
committed by GitHub
parent dc10d1520d
commit b468d0c33e
11 changed files with 198 additions and 87 deletions
+8 -1
View File
@@ -16,7 +16,7 @@ Run:
For instance:
```
./bin/changelog statemine-v5.0.0
./bin/changelog parachains-v7.0.0-rc8
```
A file called `release-notes.md` will be generated and can be used for the release.
@@ -36,6 +36,13 @@ REF2=HEAD
DEBUG=1
NO_CACHE=1
```
By default, the template will include all the information, including the runtime data.
For clients releases, we don't need those and they can be skipped by setting the following env:
```
RELEASE_TYPE=client
```
## Considered labels
The following list will likely evolve over time and it will be hard to keep it in sync.
+42 -20
View File
@@ -81,34 +81,56 @@ 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/statemint-srtool-digest.json'
ROCOCO_PARA_DIGEST = ENV['ROCOCO_PARA_DIGEST'] || 'digests/rococo-parachain-srtool-digest.json'
CANVAS_KUSAMA_DIGEST = ENV['CANVAS_KUSAMA_DIGEST'] || 'digests/canvas-kusama-srtool-digest.json'
# Here we compose all the pieces together into one
# single big json file.
cmd = format('jq \
logger.debug("Release type: #{ENV['RELEASE_TYPE']}")
if ENV['RELEASE_TYPE'] && ENV['RELEASE_TYPE'] == 'client'
logger.debug("Building changelog without runtimes")
cmd = format('jq \
--slurpfile cumulus %s \
--slurpfile substrate %s \
--slurpfile polkadot %s \
--slurpfile srtool_shell %s \
--slurpfile srtool_westmint %s \
--slurpfile srtool_statemine %s \
--slurpfile srtool_statemint %s \
--slurpfile srtool_rococo_parachain %s \
-n \'{
cumulus: $cumulus[0],
substrate: $substrate[0],
polkadot: $polkadot[0],
srtool: [
{ name: "rococo", data: $srtool_rococo_parachain[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] }
] }\' > context.json', cumulus_data, substrate_data, polkadot_data,
SHELL_DIGEST,
WESTMINT_DIGEST,
STATEMINE_DIGEST,
STATEMINT_DIGEST,
ROCOCO_PARA_DIGEST)
}\' > context.json', cumulus_data, substrate_data, polkadot_data,
)
else
logger.debug("Building changelog with runtimes")
# 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_shell %s \
--slurpfile srtool_westmint %s \
--slurpfile srtool_statemine %s \
--slurpfile srtool_statemint %s \
--slurpfile srtool_rococo_parachain %s \
--slurpfile srtool_canvas_kusama %s \
-n \'{
cumulus: $cumulus[0],
substrate: $substrate[0],
polkadot: $polkadot[0],
srtool: [
{ name: "rococo", data: $srtool_rococo_parachain[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] },
{ name: "canvas", data: $srtool_canvas_kusama[0] }
] }\' > context.json', cumulus_data, substrate_data, polkadot_data,
SHELL_DIGEST,
WESTMINT_DIGEST,
STATEMINE_DIGEST,
STATEMINT_DIGEST,
ROCOCO_PARA_DIGEST,
CANVAS_KUSAMA_DIGEST)
end
system(cmd)
cmd = format('tera --env --env-key env --include-path templates \
@@ -1,4 +1,4 @@
{% import "high_priority.md.tera" as m_p -%}
{%- import "high_priority.md.tera" as m_p -%}
## Global Priority
{%- set cumulus_prio = 0 -%}
@@ -23,10 +23,7 @@
{%- endif -%}
{%- if substrate_prio > global_prio -%}
{%- set global_prio = substrate_prio -%}
{%- endif -%}
{# We show the result #}
{{ m_p::high_priority(p=global_prio, changes=changes) }}
{%- endif %}
<!--
- Cumulus: {{ cumulus_prio }}
@@ -34,4 +31,5 @@
- Substrate: {{ substrate_prio }}
-->
{# todo: show high prio list here #}
{# We show the result #}
{{ m_p::high_priority(p=global_prio, changes=changes) }}
@@ -3,7 +3,23 @@
{# This macro convert a priority level into readable output #}
{%- macro high_priority(p, changes) -%}
{%- if p >= 7 -%}
{# real globals don't work so we count the number of host functions here as well #}
{# unfortunately, the next snippet is duplicated in the host_functions.md.tera template #}
{# as well #}
{%- set_global host_fn_count = 0 -%}
{# We loop first to count the number of host functions but we do not display anything yet #}
{%- for pr in changes -%}
{%- 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_global host_fn_count = host_fn_count + 1 -%}
{%- endif -%}
{%- endif -%}
{%- endfor -%}
{%- if p >= 7 or host_fn_count > 0 -%}
{%- set prio = "‼️ HIGH" -%}
{%- set text = "This is a **high priority** release and you must upgrade as as soon as possible." -%}
{%- elif p >= 5 -%}
@@ -12,16 +28,17 @@
{%- elif p >= 3 -%}
{%- set prio = "Low" -%}
{%- set text = "This is a low priority release and you may upgrade at your convenience." -%}
{%- endif %}
{%- endif -%}
{%- if prio %}
{%- if prio -%}
{{prio}}: {{text}}
{%- else -%}
<!-- No relevant Priority label as been detected -->
{% endif %}
{%- endif %}
{# We only show details if Medium or High #}
{%- if p >= 5 -%}
The changes motivating this priority level are:
{% for pr in changes | sort(attribute="merged_at") -%}
{%- if pr.meta.C -%}
{%- if pr.meta.C.value == p %}
@@ -29,9 +46,10 @@ The changes motivating this priority level are:
{%- if pr.meta.B and pr.meta.B.value == 7 %}
(RUNTIME)
{% endif %}
{%- endif -%}
{%- endif -%}
{%- endfor %}
{%- endif %}
{%- endmacro priority -%}
@@ -1,30 +1,37 @@
{%- import "change.md.tera" as m_c -%}
{%- set_global host_fn_count = 0 -%}
{# We loop first to count the number of host functions but we do not display anything yet #}
{%- for pr in changes -%}
{%- 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_global host_fn_count = host_fn_count + 1 -%}
{% endif -%}
{%- endif -%}
{%- endfor -%}
<!-- {{ host_fn_count }} host functions were detected -->
{% if host_fn_count == 0 -%}
<!-- ️ This release does not contain any new host functions. -->
{%- else -%}
## Host functions
⚠️ 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.
{% 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.E and pr.meta.E.value == 4 -%}
{%- set_global host_fn_count = host_fn_count + 1 -%}
- {{ m_c::change(c=pr) }}
{% endif -%}
{% endif -%}
{%- endfor -%}
<!-- {{ host_fn_count }} host functions were detected -->
{% if host_fn_count == 0 -%}
<!-- ️ This release does not contain any new host functions. -->
{% elif host_fn_count == 1 -%}
## Host functions
⚠️ The runtimes in this release contain one new **host function**.
⚠️ It is critical that you update your client before the chain switches to the new runtimes.
{%- else -%}
⚠️ 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 %}
@@ -0,0 +1,26 @@
{%- import "change.md.tera" as m_c %}
{%- set_global db_migration_count = 0 -%}
## Database Migrations
{% 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.E and pr.meta.E.value == 2 -%}
{%- set_global db_migration_count = db_migration_count + 1 -%}
- {{ m_c::change(c=pr) }}
{% endif -%}
{% endif -%}
{% endfor -%}
{%- if db_migration_count == 0 -%}
No Database migration detected in this release.
{% else %}
There is {{ db_migration_count }} database migration(s) in this release.
Database migrations are operations bringing your database to the latest stand.
Some migrations may break compatibility and making a backup of your database is highly recommended.
{%- endif %}
@@ -1,6 +1,6 @@
{%- import "change.md.tera" as m_c %}
## Migrations
## Runtime Migrations
{% for pr in changes | sort(attribute="merged_at") -%}
@@ -1,4 +1,4 @@
{# This is the entry point of the template -#}
{# This is the entry point of the template for the parachains-* releases-#}
<!-- repository: {{ cumulus.repository.name }} -->
{% include "pre_release.md.tera" -%}
@@ -16,16 +16,23 @@ This release contains the changes from `{{ env.REF1 }}` to `{{ env.REF2 }}`.
{%- set DOT = "[P]" -%}
{%- set SUB = "[S]" -%}
{# We check for host function first because no matter what the priority is, #}
{# we will force it to HIGH if at least one host function was detected. #}
{% include "host_functions.md.tera" -%}
{% include "global_priority.md.tera" -%}
{% include "host_functions.md.tera" -%}
{% include "compiler.md.tera" -%}
{% include "migrations.md.tera" -%}
{% include "migrations-db.md.tera" -%}
{% include "migrations-runtime.md.tera" -%}
{% if env.RELEASE_TYPE and env.RELEASE_TYPE == "client" %}
<!-- skipping runtime data for RELEASE_TYPE = {{ env.RELEASE_TYPE }} -->
{% else %}
{% include "runtimes.md.tera" -%}
{% endif %}
{% include "changes.md.tera" -%}