Skip to content

Commit 4822f39

Browse files
authored
Update release template (#2092)
# Goal The goal of this PR is to make various minor improvements to our release content Closes #1800 # Discussion - [x] Add sections for `changes/breaking` and `changes/storage-migration` labels - [x] Remove deployment section from RC releases - [x] Highlight the metadata changes - [x] Update github actions - [x] Corrected Polkadot-SDK Version code Example Release: https://github.com/frequency-chain/frequency/releases/tag/v0.0.1-rc6 ## Test the release summary - Compare it to mainnet polkadot: - `docker run jacogr/polkadot-js-tools:0.57.1 metadata wss://0.rpc.frequency.xyz wss://polkadot-rpc.publicnode.com >> /tmp/metadata-compare-mainnet.txt` - Run the summarizer - `./tools/ci/scripts/extrinsic-ordering-filter.sh /tmp/metadata-compare-mainnet.txt`
1 parent 8474884 commit 4822f39

File tree

8 files changed

+155
-62
lines changed

8 files changed

+155
-62
lines changed

.github/workflows/benchmarks-run.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
6464
- name: Commit Updated Weights
6565
id: commit-updated-weights
66-
uses: stefanzweifel/git-auto-commit-action@8756aa072ef5b4a080af5dc8fef36c5d586e521d
66+
uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842
6767
with:
6868
commit_message: "Update weights"
6969
file_pattern: "pallets/**/*.rs runtime/common/src/weights/*"

.github/workflows/check-polkadot-releases.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
cat ${{env.RELEASE_TRACK_FILENAME}}
3535
- name: Commit Latest Release Version
3636
id: commit-updated-release
37-
uses: stefanzweifel/git-auto-commit-action@8756aa072ef5b4a080af5dc8fef36c5d586e521d
37+
uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842
3838
with:
3939
commit_message: "Record new Polkadot release version"
4040
commit_user_name: Frequency CI [bot]

.github/workflows/release.yml

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ jobs:
106106
git diff
107107
- name: Commit Updated Weights
108108
if: steps.is-full-release.outputs.is-full-release == 'true'
109-
uses: stefanzweifel/git-auto-commit-action@8756aa072ef5b4a080af5dc8fef36c5d586e521d
109+
uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842
110110
with:
111111
commit_message: "Update weights for release ${{env.NEW_RELEASE_TAG}}"
112112
file_pattern: "pallets/**/*.rs runtime/common/src/weights/*"
@@ -132,11 +132,11 @@ jobs:
132132
git diff
133133
- name: Commit Updated Version
134134
id: commit-updated-version
135-
uses: stefanzweifel/git-auto-commit-action@8756aa072ef5b4a080af5dc8fef36c5d586e521d
135+
uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842
136136
with:
137137
commit_message: "Update versions for release ${{env.NEW_RELEASE_TAG}}"
138138
- name: Update Release Version Tag
139-
uses: rickstaa/action-create-tag@88dbf7ff6fe2405f8e8f6c6fdfd78829bc631f83
139+
uses: rickstaa/action-create-tag@a1c7777fcb2fee4f19b0f283ba888afa11678b72
140140
with:
141141
tag: ${{env.NEW_RELEASE_TAG}}
142142
force_push_tag: true
@@ -586,14 +586,13 @@ jobs:
586586
- name: Compare Metadata
587587
timeout-minutes: 10
588588
run: |
589-
CMD="docker run --pull always --net=net-${{env.RELEASE_BRANCH_NAME}} jacogr/polkadot-js-tools:0.55.3 metadata ws://ref-node:9944 ws://test-node:9944"
589+
CMD="docker run --pull always --net=net-${{env.RELEASE_BRANCH_NAME}} jacogr/polkadot-js-tools:0.57.1 metadata ws://ref-node:9944 ws://test-node:9944"
590590
echo -e "Running:\n$CMD"
591591
$CMD >> ${{env.OUTPUT_DIR}}/${{env.OUTPUT_FILENAME}}
592-
sed -z -i 's/\n\n/\n/g' ${{env.OUTPUT_DIR}}/${{env.OUTPUT_FILENAME}}
593592
cat ${{env.OUTPUT_DIR}}/${{env.OUTPUT_FILENAME}} | egrep -n -i ''
594593
SUMMARY=$(./tools/ci/scripts/extrinsic-ordering-filter.sh ${{env.OUTPUT_DIR}}/${{env.OUTPUT_FILENAME}})
595-
echo -e $SUMMARY
596-
echo -e $SUMMARY >> ${{env.OUTPUT_DIR}}/${{env.OUTPUT_FILENAME}}
594+
echo -e "$SUMMARY"
595+
echo -e "$SUMMARY" >> ${{env.OUTPUT_DIR}}/${{env.OUTPUT_FILENAME}}
597596
- name: Show Result
598597
working-directory: ${{env.OUTPUT_DIR}}
599598
run: |
@@ -668,7 +667,7 @@ jobs:
668667
tera --version
669668
- name: Build Changelog
670669
id: build-changelog
671-
uses: mikepenz/release-changelog-builder-action@6fd5cc6eaf7567dbd0f9666061215bb476f012fc
670+
uses: mikepenz/release-changelog-builder-action@32e3c96f29a6532607f638797455e9e98cfc703d
672671
env:
673672
GITHUB_TOKEN: ${{ github.token }}
674673
with:
@@ -677,12 +676,20 @@ jobs:
677676
configurationJson: |
678677
{
679678
"categories": [
679+
{
680+
"title": "### Breaking Changes|n|",
681+
"labels": ["change/breaking"]
682+
},
680683
{
681684
"title": "### Major Changes|n|",
682685
"labels": ["change/major"]
686+
},
687+
{
688+
"title": "### Storage Migrations|n|",
689+
"labels": ["change/storage-migration"]
683690
}
684691
],
685-
"template": "#{{CHANGELOG}}|n||n|### Uncategorized Changes|n||n| #{{UNCATEGORIZED}}",
692+
"template": "#{{CHANGELOG}}|n||n|### Additional Changes|n||n| #{{UNCATEGORIZED}}",
686693
"pr_template": "- #{{TITLE}} ##{{NUMBER}}",
687694
"empty_template": "- No changes",
688695
"transformers": [
@@ -737,15 +744,18 @@ jobs:
737744
CHANGELOG: ${{steps.sanitize-changelog.outputs.sanitized}}
738745
RUNTIME_INFO_PASEO: ${{steps.get-runtimes-info.outputs.runtime_info_paseo}}
739746
RUNTIME_INFO_MAINNET: ${{steps.get-runtimes-info.outputs.runtime_info_mainnet}}
747+
IS_FULL_RELEASE: ${{steps.is-full-release.outputs.is-full-release}}
740748
run: |
741749
./build-release-notes.sh '${{steps.polkadot-version.outputs.version}}' \
742750
"${CHANGELOG}" \
743751
"${RUNTIME_INFO_MAINNET}" \
744752
"${RUNTIME_INFO_PASEO}" \
753+
"${IS_FULL_RELEASE}" \
754+
"/tmp/metadata-compare-mainnet.txt" \
745755
> release-notes.md
746756
- name: Publish Release Candidate on GitHub
747757
if: steps.is-full-release.outputs.is-full-release != 'true'
748-
uses: softprops/action-gh-release@9d7c94cfd0a1f3ed45544c887983e9fa900f0564
758+
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191
749759
with:
750760
name: "[Release Candidate] ${{env.NEW_RELEASE_TAG}}"
751761
prerelease: true
@@ -857,7 +867,7 @@ jobs:
857867
username: ${{secrets.DOCKERHUB_USERNAME}}
858868
password: ${{secrets.DOCKERHUB_TOKEN}}
859869
- name: Build and Push Parachain Image
860-
uses: docker/build-push-action@v5
870+
uses: docker/build-push-action@v6
861871
with:
862872
context: .
863873
platforms: ${{matrix.docker-platform}}
@@ -867,7 +877,7 @@ jobs:
867877
${{env.DOCKER_HUB_PROFILE}}/${{env.IMAGE_NAME}}-${{matrix.network}}:${{env.NEW_RELEASE_TAG}}
868878
- name: Update DockerHub Latest Tag
869879
if: steps.is-full-release.outputs.is-full-release == 'true'
870-
uses: docker/build-push-action@v5
880+
uses: docker/build-push-action@v6
871881
with:
872882
context: .
873883
platforms: ${{matrix.docker-platform}}
@@ -949,7 +959,7 @@ jobs:
949959
password: ${{secrets.DOCKERHUB_TOKEN}}
950960
- name: Build and Push Dev Image
951961
# if: env.TEST_RUN != 'true'
952-
uses: docker/build-push-action@v5
962+
uses: docker/build-push-action@v6
953963
with:
954964
context: .
955965
platforms: ${{matrix.docker-platform}}
@@ -959,7 +969,7 @@ jobs:
959969
${{env.DOCKER_HUB_PROFILE}}/${{matrix.node}}:${{env.NEW_RELEASE_TAG}}
960970
- name: Update DockerHub Latest Tag
961971
if: steps.is-full-release.outputs.is-full-release == 'true'
962-
uses: docker/build-push-action@v5
972+
uses: docker/build-push-action@v6
963973
with:
964974
context: .
965975
platforms: ${{matrix.docker-platform}}

.github/workflows/verify-pr-commit.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Check Out Repo
2828
uses: actions/checkout@v4
2929
- name: Check for Changed Files
30-
uses: dorny/paths-filter@ebc4d7e9ebcb0b1eb21480bb8f43113e996ac77a
30+
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36
3131
id: filter
3232
with:
3333
filters: |
@@ -486,7 +486,7 @@ jobs:
486486
- name: Build collator image for local relay chain
487487
env:
488488
IMAGE_NAME: collator-node-local
489-
uses: docker/build-push-action@v5
489+
uses: docker/build-push-action@v6
490490
with:
491491
context: .
492492
push: false

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ try-runtime-check-migrations-paseo-testnet: check-try-runtime-installed
306306
try-runtime --runtime ./target/release/wbuild/frequency-runtime/frequency_runtime.wasm on-runtime-upgrade --checks="pre-and-post" --disable-spec-version-check --no-weight-warnings live --uri wss://0.rpc.testnet.amplica.io:443
307307
# Pull the Polkadot version from the polkadot-cli package in the Cargo.lock file.
308308
# This will break if the lock file format changes
309-
POLKADOT_VERSION=$(shell awk -F "=" '/name = "polkadot-cli"/,/version = ".*"/{ print $2 }' Cargo.lock | tail -n 1 | cut -d " " -f 3 | tr -d \")
309+
POLKADOT_VERSION=$(shell grep -o 'release-polkadot-v[0-9.]*' Cargo.toml | sed 's/release-polkadot-v//' | head -n 1)
310310

311311
.PHONY: version
312312
version:

tools/ci/release-notes/build-release-notes.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,16 @@ polkadot_version=$1
55
changelog=$2
66
runtime_mainnet_info=$3
77
runtime_paseo_info=$4
8+
is_full_release=$5
9+
metadata_change_summary_file=$6
10+
11+
# Extract the contents of the Summary section from the metadata change summary file, but remove trailing whitespace/blank lines
12+
metadata_change_summary=`sed -n '/SUMMARY/,/^------/p' "$metadata_change_summary_file" | sed '1d;$d' | sed -e :a -e '/^[[:space:]]*$/{$d;N;ba' -e '}'`
813

914
CHANGELOG="$changelog" \
1015
POLKADOT_VERSION="$polkadot_version" \
1116
RUNTIME_MAINNET_INFO="$runtime_mainnet_info" \
1217
RUNTIME_PASEO_INFO="$runtime_paseo_info" \
18+
IS_FULL_RELEASE="$is_full_release" \
19+
METADATA_CHANGE_SUMMARY="$metadata_change_summary" \
1320
tera -a --env --env-key env --env-only --template release-notes.md.tera

tools/ci/release-notes/release-notes.md.tera

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
1+
{% if env.IS_FULL_RELEASE == 'true' %}
12
This release contains the changes from `{{env.PREVIOUS_RELEASE_TAG}}` to `{{env.NEW_RELEASE_TAG}}`.
3+
{% else %}
4+
This release candidate contains the changes from `{{env.PREVIOUS_RELEASE_TAG}}` to `{{env.NEW_RELEASE_TAG}}`.
5+
{% endif %}
26

37
Full changelog: https://github.com/frequency-chain/frequency/compare/{{env.PREVIOUS_RELEASE_TAG}}...{{env.NEW_RELEASE_TAG}}
48

59
## Versions
610
- Rust Toolchain: `{{env.RUST_TOOLCHAIN}}`
711
- Polkadot-SDK: `v{{env.POLKADOT_VERSION}}`
812

13+
{% if env.IS_FULL_RELEASE == 'true' %}
914
## Deployed
1015

1116
- Frequency-Paseo Testnet: [TBD]()
1217
- Frequency Mainnet: [TBD]()
1318

19+
{% endif %}
1420
## What's Changed
1521

1622
{% set changelog = env.CHANGELOG | split(pat='|n|') -%}
@@ -39,3 +45,12 @@ The information about the runtimes included in this release can be found below.
3945
{{ line | safe }}
4046
{% endfor -%}
4147
```
48+
49+
### Metadata Change Summary vs Mainnet
50+
51+
{% set summary = env.METADATA_CHANGE_SUMMARY | split(pat='|') -%}
52+
```
53+
{% for line in summary -%}
54+
{{ line | safe }}
55+
{% endfor -%}
56+
```
Lines changed: 104 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,116 @@
11
#!/usr/bin/env bash
2-
# This script is used in a Github Workflow. It helps filtering out what is interesting
3-
# when comparing metadata and spot what would require a tx version bump.
42

53
FILE=$1
64

7-
# Higlight indexes that were deleted
8-
function find_deletions() {
9-
echo "\n## Deletions\n"
10-
RES=$(cat "$FILE" | grep -n '\[\-\]' | tr -s " ")
11-
if [ "$RES" ]; then
12-
echo "$RES" | awk '{ printf "%s\\n", $0 }'
13-
else
14-
echo "n/a"
15-
fi
5+
function find_module_changes() {
6+
echo "## Modules"
7+
echo "- Added"
8+
grep '\[+\] modules:' "$FILE" | sed 's/.*modules: / - /' || echo " n/a"
9+
echo "- Removed"
10+
grep '\[-\] modules:' "$FILE" | sed 's/.*modules: / - /' || echo " n/a"
11+
echo
1612
}
1713

18-
# Highlight indexes that have been deleted
19-
function find_index_changes() {
20-
echo "\n## Index changes\n"
21-
RES=$(cat "$FILE" | grep -E -n -i 'idx:\s*([0-9]+)\s*(->)\s*([0-9]+)' | tr -s " ")
22-
if [ "$RES" ]; then
23-
echo "$RES" | awk '{ printf "%s\\n", $0 }'
24-
else
25-
echo "n/a"
26-
fi
14+
function find_removals() {
15+
echo "## Removals"
16+
# Find all the modules with changes and pull in all the changes after it
17+
grep -n -E '\[.*\] idx: .*\((calls:.*|storage:.*)\)' "$FILE" |
18+
while read -r mod_line; do
19+
module=$(echo "$mod_line" | sed -E 's/^[0-9]+:[[:space:]]*\[([^]]+)\].*/\1/')
20+
mod_line_number=$(echo "$mod_line" | sed -E 's/^([0-9]+):.*/\1/')
21+
mod_line_number_plus=$(($mod_line_number + 1))
22+
# Find all the [-] lines after that line until the next empty line
23+
lines=$(sed -n -E "${mod_line_number_plus},\$ {
24+
/\[-\]/ {
25+
p
26+
a\\
27+
|
28+
}
29+
/^$/ q
30+
}" "$FILE")
31+
# If some were found, then echo out the header, and the lines
32+
if [ -n "$lines" ]; then
33+
echo "- $module"
34+
echo $lines | tr "|" "\n" |
35+
while read -r line; do
36+
if [ -n "${line}" ]; then
37+
echo " - ${line}"
38+
fi
39+
done
40+
fi
41+
done || echo " n/a"
42+
echo
2743
}
2844

29-
# Highlight values that decreased
30-
function find_decreases() {
31-
echo "\n## Decreases\n"
32-
OUT=$(cat "$FILE" | grep -E -i -o '([0-9]+)\s*(->)\s*([0-9]+)' | awk '$1 > $3 { printf "%s;", $0 }')
33-
IFS=$';' LIST=("$OUT")
34-
unset RES
35-
# for line in "${LIST[@]}"; do
36-
for line in ${LIST[@]}; do
37-
# RES="$RES\n$(cat "$FILE" | grep -E -i -n $line | tr -s " ")"
38-
RES="$RES$(cat "$FILE" | grep -E -i -n $line | tr -s " ")\n"
39-
done
45+
function find_changes() {
46+
echo "## Changes"
47+
# Find all the modules with changes and pull in all the changes after it
48+
grep -n -E '\[.*\] idx: .*\((calls:.*|storage:.*)\)' "$FILE" |
49+
while read -r mod_line; do
50+
module=$(echo "$mod_line" | sed -E 's/^[0-9]+:[[:space:]]*\[([^]]+)\].*/\1/')
51+
mod_line_number=$(echo "$mod_line" | sed -E 's/^([0-9]+):.*/\1/')
52+
mod_line_number_plus=$(($mod_line_number + 1))
53+
# Find all the [extrinsic] lines after that line until the next empty line
54+
lines=$(sed -n -E "${mod_line_number_plus},\$ {
55+
/\[[^\+-]+\]/ {
56+
p
57+
a\\
58+
|
59+
}
60+
/^$/ q
61+
}" "$FILE")
62+
# If some were found, then echo out the header, and the lines
63+
if [ -n "$lines" ]; then
64+
echo "- $module"
65+
echo $lines | tr "|" "\n" |
66+
while read -r line; do
67+
if [ -n "${line}" ]; then
68+
echo " - ${line}"
69+
fi
70+
done
71+
fi
72+
done || echo " n/a"
73+
echo
74+
}
4075

41-
if [ "$RES" ]; then
42-
echo "$RES" | awk '{ printf "%s\\n", $0 }' | sort -u -g | uniq
43-
else
44-
echo "n/a"
45-
fi
76+
function find_additions() {
77+
echo "## Additions"
78+
# Find all the modules with changes and pull in all the changes after it
79+
grep -n -E '\[.*\] idx: .*\((calls:.*|storage:.*)\)' "$FILE" |
80+
while read -r mod_line; do
81+
module=$(echo "$mod_line" | sed -E 's/^[0-9]+:[[:space:]]*\[([^]]+)\].*/\1/')
82+
mod_line_number=$(echo "$mod_line" | sed -E 's/^([0-9]+):.*/\1/')
83+
mod_line_number_plus=$(($mod_line_number + 1))
84+
# Find all the [+] lines after that line until the next empty line
85+
lines=$(sed -n -E "${mod_line_number_plus},\$ {
86+
/\[\+\]/ {
87+
p
88+
a\\
89+
|
90+
}
91+
/^$/ q
92+
}" "$FILE")
93+
# If some were found, then echo out the header, and the lines
94+
if [ -n "$lines" ]; then
95+
echo "- $module"
96+
echo $lines | tr "|" "\n" |
97+
while read -r line; do
98+
if [ -n "${line}" ]; then
99+
echo " - ${line}"
100+
fi
101+
done
102+
fi
103+
done || echo " n/a"
104+
echo
46105
}
47106

48-
echo "\n------------------------------ SUMMARY -------------------------------"
49-
echo "\n⚠️ This filter is here to help spotting changes that should be reviewed carefully."
50-
echo "\n⚠️ It catches only index changes, deletions and value decreases".
107+
echo "------------------------------ SUMMARY -------------------------------"
108+
echo "⚠️ This filter is here to help spotting changes that should be reviewed carefully."
109+
echo "⚠️ It catches only index changes, deletions and value decreases."
110+
echo
51111

52-
find_deletions "$FILE"
53-
find_index_changes "$FILE"
54-
find_decreases "$FILE"
55-
echo "\n----------------------------------------------------------------------\n"
112+
find_module_changes "$FILE"
113+
find_removals "$FILE"
114+
find_additions "$FILE"
115+
find_changes "$FILE"
116+
echo "----------------------------------------------------------------------"

0 commit comments

Comments
 (0)