-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix migrations and add migration CI checks (#75)
Closes #70 The error with Asset Hub Kusama will be fixed when [this commit](paritytech/polkadot-sdk@db3fd68) lands in the runtime. --------- Co-authored-by: Oliver Tale-Yazdi <[email protected]> Co-authored-by: ordian <[email protected]> Co-authored-by: Bastian Köcher <[email protected]>
- Loading branch information
1 parent
41d3ca6
commit 569787c
Showing
6 changed files
with
181 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
name: Check Migrations | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
pull_request: | ||
branches: ["main"] | ||
workflow_dispatch: | ||
|
||
# Cancel a currently running workflow from the same PR, branch or tag when a new workflow is | ||
# triggered (ref https://stackoverflow.com/a/72408109) | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
runtime-matrix: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
runtime: ${{ steps.runtime.outputs.runtime }} | ||
name: Extract tasks from matrix | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- id: runtime | ||
run: | | ||
# Filter out runtimes that don't have a URI | ||
TASKS=$(jq '[.[] | select(.uri != null)]' .github/workflows/runtimes-matrix.json) | ||
SKIPPED_TASKS=$(jq '[.[] | select(.uri == null)]' .github/workflows/runtimes-matrix.json) | ||
echo --- Running the following tasks --- | ||
echo $TASKS | ||
echo --- Skipping the following tasks due to not having a uri field --- | ||
echo $SKIPPED_TASKS | ||
# Strip whitespace from Tasks now that we've logged it | ||
TASKS=$(echo $TASKS | jq -c .) | ||
echo "runtime=$TASKS" >> $GITHUB_OUTPUT | ||
check-migrations: | ||
needs: [runtime-matrix] | ||
continue-on-error: true | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
runtime: ${{ fromJSON(needs.runtime-matrix.outputs.runtime) }} | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
|
||
- name: Download try-runtime-cli | ||
run: | | ||
curl -sL https://github.com/paritytech/try-runtime-cli/releases/download/v0.5.0/try-runtime-x86_64-unknown-linux-musl -o try-runtime | ||
chmod +x ./try-runtime | ||
- name: Install Protoc | ||
uses: arduino/setup-protoc@v1 | ||
with: | ||
version: "3.6.1" | ||
|
||
- name: Add wasm32-unknown-unknown target | ||
run: rustup target add wasm32-unknown-unknown | ||
|
||
- name: Build ${{ matrix.runtime.name }} | ||
run: | | ||
cargo build --profile production -p ${{ matrix.runtime.package }} --features try-runtime | ||
- name: Check migrations | ||
run: | | ||
PACKAGE_NAME=${{ matrix.runtime.package }} | ||
RUNTIME_BLOB_NAME=$(echo $PACKAGE_NAME | sed 's/-/_/g').compact.compressed.wasm | ||
# When running on relay, we don't need weight checks. | ||
NO_WEIGHT_WARNINGS_FLAG="" | ||
if [[ "${{ matrix.runtime.is_relay }}" == "true" ]]; then | ||
NO_WEIGHT_WARNINGS_FLAG="--no-weight-warnings" | ||
fi | ||
# Disable idempotency checks for now because the Scheduler pallet MigrateToV1 migration is | ||
# non-idempotent at its root in Polkadot SDK V1.2.0. In V1.3.0 we can re-enable | ||
# idempotency checks. | ||
EXTRA_ARGS="--disable-spec-version-check --disable-idempotency-checks" | ||
./try-runtime \ | ||
--runtime ./target/production/wbuild/$PACKAGE_NAME/$RUNTIME_BLOB_NAME \ | ||
on-runtime-upgrade --checks=pre-and-post $EXTRA_ARGS $NO_WEIGHT_WARNINGS_FLAG live --uri ${{ matrix.runtime.uri }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
[ | ||
{ | ||
"name": "polkadot", | ||
"package": "polkadot-runtime", | ||
"path": "relay/polkadot", | ||
"uri": "wss://polkadot-try-runtime-node.parity-chains.parity.io:443", | ||
"is_relay": true | ||
}, | ||
{ | ||
"name": "kusama", | ||
"package": "staging-kusama-runtime", | ||
"path": "relay/kusama", | ||
"uri": "wss://kusama-try-runtime-node.parity-chains.parity.io:443", | ||
"is_relay": true | ||
}, | ||
{ | ||
"name": "glutton-kusama", | ||
"package": "glutton-kusama-runtime", | ||
"path": "system-parachains/gluttons/glutton-kusama", | ||
"is_relay": false | ||
}, | ||
{ | ||
"name": "asset-hub-kusama", | ||
"package": "asset-hub-kusama-runtime", | ||
"path": "system-parachains/asset-hubs/asset-hub-kusama", | ||
"uri": "wss://kusama-asset-hub-rpc.polkadot.io:443", | ||
"is_relay": false | ||
}, | ||
{ | ||
"name": "asset-hub-polkadot", | ||
"package": "asset-hub-polkadot-runtime", | ||
"path": "system-parachains/asset-hubs/asset-hub-polkadot", | ||
"uri": "wss://polkadot-asset-hub-rpc.polkadot.io:443", | ||
"is_relay": false | ||
}, | ||
{ | ||
"name": "bridge-hub-kusama", | ||
"package": "bridge-hub-kusama-runtime", | ||
"path": "system-parachains/bridge-hubs/bridge-hub-kusama", | ||
"uri": "wss://kusama-bridge-hub-rpc.polkadot.io:443", | ||
"is_relay": false | ||
}, | ||
{ | ||
"name": "bridge-hub-polkadot", | ||
"package": "bridge-hub-polkadot-runtime", | ||
"path": "system-parachains/bridge-hubs/bridge-hub-polkadot", | ||
"uri": "wss://polkadot-bridge-hub-rpc.polkadot.io:443", | ||
"is_relay": false | ||
}, | ||
{ | ||
"name": "collectives-polkadot", | ||
"package": "collectives-polkadot-runtime", | ||
"path": "system-parachains/collectives/collectives-polkadot", | ||
"uri": "wss://polkadot-collectives-rpc.polkadot.io:443", | ||
"is_relay": false | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters