Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into muharem-remove-fellow…
Browse files Browse the repository at this point in the history
…ship-import-migration
  • Loading branch information
muharem committed Nov 22, 2023
2 parents ffdfb02 + 41d3ca6 commit a5624e1
Show file tree
Hide file tree
Showing 40 changed files with 1,707 additions and 1,234 deletions.
65 changes: 65 additions & 0 deletions .github/changelog-processor.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/usr/bin/env python

import os
import sys
import argparse

parser = argparse.ArgumentParser(description="Process the CHANGELOG.md")
parser.add_argument(
"changelog",
metavar="CHANGELOG",
help="Path to the CHANGELOG.md file",
default="CHANGELOG.md",
nargs='?'
)

group = parser.add_mutually_exclusive_group()
group.add_argument(
"--print-latest-version",
dest="print_latest_version",
help="Print the latest version (first in the file) found in the CHANGELOG.md",
action="store_true"
)
group.add_argument(
"--should-release",
dest="should_release",
help="Should a release be made? Prints `1` or `0`.",
action="store_true"
)

args = parser.parse_args()

with open(args.changelog, "r") as changelog:
lines = changelog.readlines()

# Find the latest version
for line in lines:
if not line.startswith("## ["):
continue

version = line.strip().removeprefix("## [").split("]")[0]
break

if args.print_latest_version:
print(version, end = "")
sys.exit(0)
elif args.should_release:
if version.lower() == "unreleased":
print("0", end = "")
sys.exit(-1)
elif version.count(".") != 2:
print("0", end = "")
sys.exit(-1)

stream = os.popen("git tag -l v" + version)
output = stream.read()

# Empty output means that the tag doesn't exist and that we should release.
if output.strip() == "":
print("1", end = "")
else:
print("0", end = "")

sys.exit(0)
else:
parser.print_help()
1 change: 1 addition & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- Remember that you can run `/merge` to enable auto-merge in the PR -->
24 changes: 10 additions & 14 deletions .github/review-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,25 @@ rules:
include:
- ^\.github/.*
type: fellows
minRank: 4
minRank: 3
minApprovals: 2
- name: Relay and system files
condition:
include:
- ^relay\/kusama\/.*
- ^relay\/polkadot\/.*
- ^relay\/.*
- ^system-parachains\/.*
- ^CHANGELOG$
exclude:
- ^relay\/.+\.adoc$
- ^CHANGELOG.md$
type: fellows
minRank: 3
minApprovals: 4
minRank: 2
minApprovals: 3
- name: General Files
condition:
include:
- '.*'
exclude:
- ^relay\/kusama\/.*
- ^relay\/polkadot\/.*
- ^\.github/.*
exclude:
- ^relay\/.*
- ^system-parachains\/.*
- ^target\/.*
- ^\.github/.*
- ^CHANGELOG.md$
type: fellows
minRank: 2
minRank: 1
29 changes: 29 additions & 0 deletions .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Auto Merge Bot

on:
# GitHub considers PRs as issues
issue_comment:
types: [created]

jobs:
set-auto-merge:
runs-on: ubuntu-latest
environment: master
# Important! This forces the job to run only on comments on Pull Requests that starts with '/merge'
if: ${{ github.event.issue.pull_request && startsWith(github.event.comment.body, '/merge') }}
steps:
- name: Get the GitHub handle of the fellows
uses: paritytech/[email protected]
id: fellows
- name: Generate token
id: merge_token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.MERGE_APP_ID }}
private_key: ${{ secrets.MERGE_APP_KEY }}
- name: Set auto merge
uses: paritytech/[email protected]
with:
GITHUB_TOKEN: ${{ steps.merge_token.outputs.token }}
MERGE_METHOD: "SQUASH"
ALLOWLIST: ${{ steps.fellows.outputs.github-handles }}
38 changes: 25 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Create Draft Release
name: Create Release

on:
push:
Expand All @@ -7,7 +7,21 @@ on:
workflow_dispatch:

jobs:
collect-release-information:
runs-on: ubuntu-latest
outputs:
should-release: ${{ steps.run.outputs.should-release }}
version: ${{ steps.run.outputs.version }}
steps:
- uses: actions/checkout@v2
- id: run
run: |
echo "should-release=$(.github/changelog-processor.py CHANGELOG.md --should-release)" >> $GITHUB_OUTPUT
echo "version=$(.github/changelog-processor.py CHANGELOG.md --print-latest-version)" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
runtime-matrix:
needs: [ collect-release-information ]
if: needs.collect-release-information.outputs.should-release == '1'
runs-on: ubuntu-latest
outputs:
runtime: ${{ steps.runtime.outputs.runtime }}
Expand Down Expand Up @@ -66,9 +80,9 @@ jobs:
path: |
${{ steps.srtool_build.outputs.wasm_compressed }}
publish-draft-release:
publish-release:
runs-on: ubuntu-latest
needs: [ build-runtimes ]
needs: [ build-runtimes, collect-release-information ]
outputs:
release_url: ${{ steps.create-release.outputs.html_url }}
asset_upload_url: ${{ steps.create-release.outputs.upload_url }}
Expand All @@ -92,7 +106,6 @@ jobs:
SRTOOL() { <$(<<<$CONTEXT head -n1) jq -r .$1; }
WASM() { <${JSON} jq -r ".runtimes.compressed.subwasm.$1"; }
tee -a DRAFT <<-EOF
## Changelog
EOF
tee -a DRAFT <CHANGELOG.md
tee -a DRAFT <<-EOF
Expand All @@ -115,19 +128,19 @@ jobs:
EOF
done
- name: Create draft release
- name: Create release
id: create-release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Runtimes ${{ github.sha }}
tag_name: ${{ format('v{0}', needs.collect-release-information.outputs.version) }}
release_name: Runtimes ${{ needs.collect-release-information.outputs.version }}
body_path: DRAFT
draft: true
draft: false

publish-runtimes:
needs: [ runtime-matrix, publish-draft-release ]
needs: [ runtime-matrix, publish-release ]
continue-on-error: true
runs-on: ubuntu-latest
env:
Expand All @@ -148,14 +161,13 @@ jobs:
run: |
>>$GITHUB_ENV echo ASSET=$(find ${{ matrix.runtime.name }} -name '*.compact.compressed.wasm')
>>$GITHUB_ENV echo SPEC=$(<${JSON} jq -r .runtimes.compact.subwasm.core_version.specVersion)
>>$GITHUB_ENV echo TXVER=$(<${JSON} jq -r .runtimes.compact.subwasm.core_version.transactionVersion)
- name: Upload compressed ${{ matrix.runtime.name }} v${{ env.SPEC }} tx${{ env.TXVER }} wasm
- name: Upload compressed ${{ matrix.runtime.name }} v${{ env.SPEC }} wasm
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.publish-draft-release.outputs.asset_upload_url }}
upload_url: ${{ needs.publish-release.outputs.asset_upload_url }}
asset_path: ${{ env.ASSET }}
asset_name: ${{ matrix.runtime.name }}_runtime-v${{ env.SPEC }}.tx${{ env.TXVER }}.compact.compressed.wasm
asset_name: ${{ matrix.runtime.name }}_runtime-v${{ env.SPEC }}.compact.compressed.wasm
asset_content_type: application/wasm
24 changes: 13 additions & 11 deletions .github/workflows/review-bot.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,34 @@
name: Review PR
name: Review Bot

on:
pull_request_target:
workflow_run:
workflows:
- Review-Trigger
types:
- opened
- reopened
- synchronize
- review_requested
- review_request_removed
- ready_for_review
pull_request_review:
- completed

permissions:
contents: read
checks: write

jobs:
review-approvals:
runs-on: ubuntu-latest
steps:
- name: Extract content of artifact
id: number
uses: Bullrich/[email protected]
with:
artifact-name: pr_number
- name: Generate token
id: team_token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.REVIEW_APP_ID }}
private_key: ${{ secrets.REVIEW_APP_KEY }}
- name: "Evaluates PR reviews and assigns reviewers"
uses: paritytech/review-bot@v2.0.0
uses: paritytech/review-bot@v2.1.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
team-token: ${{ steps.team_token.outputs.token }}
checks-token: ${{ steps.team_token.outputs.token }}
pr-number: ${{ steps.number.outputs.content }}
31 changes: 31 additions & 0 deletions .github/workflows/review-trigger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Review-Trigger

on:
pull_request_target:
types:
- opened
- reopened
- synchronize
- review_requested
- review_request_removed
- ready_for_review
pull_request_review:

jobs:
trigger-review-bot:
runs-on: ubuntu-latest
name: trigger review bot
steps:
- name: Get PR number
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
echo "Saving PR number: $PR_NUMBER"
mkdir -p ./pr
echo $PR_NUMBER > ./pr/pr_number
- uses: actions/upload-artifact@v3
name: Save PR number
with:
name: pr_number
path: pr/
retention-days: 5
30 changes: 28 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,32 @@

Changelog for the runtimes governed by the Polkadot Fellowship.

## [1.0.0]
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [Unreleased]

### Changed

- Upgrade parachains runtime API from v5 to v7 in Polkadot and Kusama ([polkadot-fellows/runtimes#56](https://github.com/polkadot-fellows/runtimes/pull/56))
- Upgrade Preimage pallet's config implementations to adapt the new `Consideration` API ([polkadot-fellows/runtimes#56](https://github.com/polkadot-fellows/runtimes/pull/56))
- Remove `experimental` feature flag for `pallet-society`, `pallet-xcm`, and `runtime-common` crates imports ([polkadot-fellows/runtimes#56](https://github.com/polkadot-fellows/runtimes/pull/56))
- Election provider: use a geometric deposit base calculation for EPM signed submissions in Polkadot and Kusama ([polkadot-fellows/runtimes#56](https://github.com/polkadot-fellows/runtimes/pull/56))

### Fixed

- Add missing weight functions for `runtime_parachains_hrmp` and `preimage` pallets ([polkadot-fellows/runtimes#56](https://github.com/polkadot-fellows/runtimes/pull/56))

## [1.0.1] 22.10.2023

### Changed

- Restore governance lock periods to 7 days in Polkadot ([polkadot-fellows/runtimes#86](https://github.com/polkadot-fellows/runtimes/pull/86))

## [1.0.0] 22.10.2023

### Changed

- Update Polkadot ideal staking rate ([polkadot-fellows/runtimes#26](https://github.com/polkadot-fellows/runtimes/pull/26))
- Treasury deprecate `propose_spend` dispatchable ([paritytech/substrate#14538](https://github.com/paritytech/substrate/pull/14538))
- Use benchmarked weights for `XCM` ([paritytech/polkadot#7077](https://github.com/paritytech/polkadot/pull/7077))
- Put HRMP Channel Management on General Admin Track ([paritytech/polkadot#7477](https://github.com/paritytech/polkadot/pull/7477))
Expand All @@ -31,6 +53,7 @@ Changelog for the runtimes governed by the Polkadot Fellowship.
- Stabilize Metadata V15 ([paritytech/substrate#14481](https://github.com/paritytech/substrate/pull/14481))
- Add Ability to Add/Remove Invulnerable Collators ([paritytech/cumulus#2596](https://github.com/paritytech/cumulus/pull/2596))
- Polkadot Fellowship promotion/demotion periods, members activity and salaries ([paritytech/cumulus#2607](https://github.com/paritytech/cumulus/pull/2607))
- Add asset conversion to asset hub Kusama ([paritytech/cumulus#2935](https://github.com/paritytech/cumulus/pull/2935))

### Fixed

Expand All @@ -39,4 +62,7 @@ Changelog for the runtimes governed by the Polkadot Fellowship.
- XCM: Fix issue with RequestUnlock ([paritytech/polkadot#7278](https://github.com/paritytech/polkadot/pull/7278))
- Clear Existing HRMP Channel Request When Force Opening ([paritytech/polkadot#7389](https://github.com/paritytech/polkadot/pull/7389))
- Prune upgrade cooldowns ([paritytech/polkadot#7470](https://github.com/paritytech/polkadot/pull/7470))
- Assets `destroy_accounts` releases the deposit ([paritytech/substrate#14443](https://github.com/paritytech/substrate/pull/14443))
- Assets `destroy_accounts` releases the deposit
([paritytech/substrate#14443](https://github.com/paritytech/substrate/pull/14443))
- Update Polkadot Collectives to use `limited_teleport_assets` for automatic slash handling, as
`teleport_assets` is deprecated and caused a failing integration test. ([polkadot-fellows/runtimes#46](https://github.com/polkadot-fellows/runtimes/pull/46))
Loading

0 comments on commit a5624e1

Please sign in to comment.