Skip to content

Commit

Permalink
Merge branch 'main' into ddc-secretary-collective2
Browse files Browse the repository at this point in the history
  • Loading branch information
Doordashcon authored Jul 7, 2024
2 parents bcd0a17 + 40f849d commit 47ed39e
Show file tree
Hide file tree
Showing 39 changed files with 814 additions and 614 deletions.
30 changes: 28 additions & 2 deletions .github/changelog-processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,39 @@
help="Print the changelog from the last release.",
action="store_true"
)
group.add_argument(
"--validate-changelog",
dest="validate_changelog",
help="Validates that the changelog uses the correct syntax",
action="store_true"
)

args = parser.parse_args()

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

if args.validate_changelog:
for line in lines:
if line.startswith("##"):
if line.startswith("###"):
continue
elif not line.startswith("## ["):
print("Line starting with `##` needs to be followed by ` [`, e.g.: `## [Unreleased]`, `## [400.2.1]`")
print(line)
sys.exit(-1)
elif line.strip().removeprefix("## [").split("]")[0].count(".") != 2 and not "unreleased" in line.lower():
print("Only Major.Minor.Patch are supported as versioning")
print(line)
sys.exit(-1)
elif line.startswith("#"):
if line.strip() != "# Changelog":
print("Line starting with `#` is only allowed for `# Changelog`")
print(line)
sys.exit(-1)

sys.exit(0)

changelog_last_release = ""
found_last_version = False

Expand All @@ -53,7 +80,6 @@
else:
break


if args.changelog_last_release:
print(changelog_last_release, end = "")
sys.exit(0)
Expand All @@ -63,7 +89,7 @@
elif args.should_release:
if version.lower() == "unreleased":
print("0", end = "")
sys.exit(-1)
sys.exit(0)
elif version.count(".") != 2:
print("0", end = "")
sys.exit(-1)
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ jobs:
if: ${{ github.event.issue.pull_request && startsWith(github.event.comment.body, '/merge') }}
steps:
- name: Get the GitHub handle of the fellows
uses: paritytech/get-fellows-action@v1.1.2
uses: paritytech/get-fellows-action@v1.1.4
id: fellows
- name: Generate a token
id: merge_token
uses: actions/create-github-app-token@v1.8.1
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.MERGE_APP_ID }}
private-key: ${{ secrets.MERGE_APP_KEY }}
Expand Down
47 changes: 41 additions & 6 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
name: Modify Changelog
name: Verify Changelog

# If you modify more test jobs, ensure that you add them as required to the job "confirmTestPassed"
# which is located at the end of this file (more info in the job)

on:
pull_request_target:
types:
- synchronize
- edited
push:
branches: ["main", "release-*"]
pull_request:
types: [opened, reopened, synchronize, edited]
workflow_dispatch:

# cancel previous runs
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:

verifyChangelog:
verify-changelog-updated:
name: Verify that Changelog is Updated
runs-on: ubuntu-latest
env:
Expand All @@ -22,3 +31,29 @@ jobs:
- name: Set error
if: steps.changed.outputs.matched != 'true' && !contains(github.event.pull_request.body, '[x] Does not require a CHANGELOG entry')
run: echo "::error::CHANGELOG.md has not been modified. Either modify the file or check the checkbox in the body" && exit 1

verify-changelog-valid:
name: Verify that Changelog is valid
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ github.token }}
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Verify
run: .github/changelog-processor.py CHANGELOG.md --validate-changelog

# This will only run if all the tests in its "needs" array passed.
# Add this as your required job, becuase if the matrix changes size (new things get added)
# it will still require all the steps to succeed.
# If you add more jobs, remember to add them to the "needs" array.
confirmChangelogChecksPassed:
runs-on: ubuntu-latest
name: All tests passed
# If any new job gets added, be sure to add it to this list
needs:
- verify-changelog-updated
- verify-changelog-valid
steps:
- run: echo '### Good job! All the tests passed 🚀' >> $GITHUB_STEP_SUMMARY
21 changes: 20 additions & 1 deletion .github/workflows/check-migrations.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Check Migrations

# If you modify more jobs, ensure that you add them as required to the job "confirmMigrationsPassed"
# which is located at the end of this file (more info in the job)

on:
push:
branches: ["main", "release-*"]
Expand All @@ -16,6 +19,7 @@ concurrency:
permissions: {}

jobs:
# This generates a matrix with all the required jobs which will be run in the next step
runtime-matrix:
runs-on: ubuntu-latest
outputs:
Expand All @@ -36,6 +40,8 @@ jobs:
TASKS=$(echo $TASKS | jq -c .)
echo "runtime=$TASKS" >> $GITHUB_OUTPUT
# This runs all the jobs in the matrix. It is required by the "confirmMigrationsPassed" job, so
# if they all pass, that job will pass too.
check-migrations:
needs: [runtime-matrix]
continue-on-error: true
Expand All @@ -59,7 +65,8 @@ jobs:
fi
# Disable the spec version check when we dont want to release.
if ! .github/changelog-processor.py CHANGELOG.md --should-release ; then
# The program prints either `1` or `0`.
if [ "$(.github/changelog-processor.py CHANGELOG.md --should-release)" = "0" ]; then
EXTRA_FLAGS+=" --disable-spec-version-check"
echo "Disabling the spec version check since we are not releasing"
else
Expand All @@ -77,3 +84,15 @@ jobs:
node-uri: ${{ matrix.runtime.uri }}
checks: "pre-and-post"
extra-args: ${{ env.EXTRA_ARGS }}

# This will only run if all the tests in its "needs" array passed.
# Add this as your required job, becuase if the matrix changes size (new things get added)
# it will still require all the steps to succeed.
# If you add more jobs, remember to add them to the "needs" array.
confirmMigrationsPassed:
runs-on: ubuntu-latest
name: All migrations passed
# If any new job gets added, be sure to add it to this array
needs: [check-migrations]
steps:
- run: echo '### Good job! All the migrations passed 🚀' >> $GITHUB_STEP_SUMMARY
6 changes: 6 additions & 0 deletions .github/workflows/fmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ on:
pull_request:
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:
rustfmt:
runs-on: ubuntu-22.04
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/review-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ jobs:
steps:
- name: Extract content of artifact
id: number
uses: Bullrich/extract-text-from-artifact@v1.0.0
uses: Bullrich/extract-text-from-artifact@v1.0.1
with:
artifact-name: pr_number
- name: Generate token
id: team_token
uses: actions/create-github-app-token@v1.9.3
uses: actions/create-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.4.1
uses: paritytech/review-bot@v2.5.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
team-token: ${{ steps.team_token.outputs.token }}
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/review-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ on:
- review_request_removed
- ready_for_review
pull_request_review:
pull_request:
workflow_dispatch:

jobs:
trigger-review-bot:
Expand All @@ -26,7 +28,7 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
- name: Get the GitHub handle of the fellows
uses: paritytech/get-fellows-action@v1.1.2
uses: paritytech/get-fellows-action@v1.1.4
id: fellows
# Require new reviews when the author is pushing and he is not a fellow
- name: Fail when author pushes new code
Expand All @@ -36,7 +38,7 @@ jobs:
github.event_name == 'pull_request_target' &&
github.event.action == 'synchronize' &&
github.event.sender.login == github.event.pull_request.user.login &&
contains(steps.fellows.outputs.github-handles, github.event.pull_request.user.login)
!contains(steps.fellows.outputs.github-handles, github.event.pull_request.user.login)
run: |
# We get the list of reviewers who approved the PR
REVIEWERS=$(gh api repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/reviews \
Expand Down
29 changes: 24 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: "Test all features"

# If you modify more test jobs, ensure that you add them as required to the job "confirmTestPassed"
# which is located at the end of this file (more info in the job)

on:
push:
branches: ["main", "release-*"]
Expand All @@ -12,6 +15,7 @@ concurrency:
cancel-in-progress: true

jobs:
# This generates a matrix with all the required jobs which will be run in the next step
runtime-matrix:
runs-on: ubuntu-latest
outputs:
Expand All @@ -38,6 +42,7 @@ jobs:
echo $TASKS
echo "itest=$TASKS" >> $GITHUB_OUTPUT
# Job required by "confirmTestPassed"
runtime-test:
needs: [runtime-matrix]
continue-on-error: true
Expand All @@ -46,11 +51,6 @@ jobs:
matrix:
runtime: ${{ fromJSON(needs.runtime-matrix.outputs.runtime) }}
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # v0.11.0
with:
access_token: ${{ github.token }}

- name: Install updates and protobuf-compiler
run: sudo apt update && sudo apt install --assume-yes cmake protobuf-compiler

Expand Down Expand Up @@ -94,6 +94,7 @@ jobs:
RUSTFLAGS: "-C debug-assertions -D warnings"
SKIP_WASM_BUILD: 1

# Job required by "confirmTestPassed"
integration-test:
needs: [integration-test-matrix]
continue-on-error: true
Expand Down Expand Up @@ -144,6 +145,7 @@ jobs:
env:
RUSTFLAGS: "-C debug-assertions -D warnings"

# Job required by "confirmTestPassed"
build-chain-spec-generator:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -190,6 +192,7 @@ jobs:
RUSTFLAGS: "-C debug-assertions -D warnings"
SKIP_WASM_BUILD: 1

# Job required by "confirmTestPassed"
zombienet-smoke:
needs: [build-chain-spec-generator]
runs-on: ubuntu-latest
Expand Down Expand Up @@ -240,3 +243,19 @@ jobs:
run: |
export PATH=$(pwd)/target/release:$PATH
cargo test --manifest-path integration-tests/zombienet/Cargo.toml
# This will only run if all the tests in its "needs" array passed.
# Add this as your required job, becuase if the matrix changes size (new things get added)
# it will still require all the steps to succeed.
# If you add more jobs, remember to add them to the "needs" array.
confirmTestPassed:
runs-on: ubuntu-latest
name: All tests passed
# If any new job gets added, be sure to add it to this list
needs:
- runtime-test
- integration-test
- build-chain-spec-generator
- zombienet-smoke
steps:
- run: echo '### Good job! All the tests passed 🚀' >> $GITHUB_STEP_SUMMARY
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@ Changelog for the runtimes governed by the Polkadot Fellowship.

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

## [1.2.8] 03.07.2024

### Changed

- Polkadot chains: allow arbitrary XCM execution ([polkadot-fellows/runtimes#345](https://github.com/polkadot-fellows/runtimes/pull/345))
- Snowbridge: Sync headers on demand ([polkadot-fellows/runtimes#345](https://github.com/polkadot-fellows/runtimes/pull/365))

Note: This release only affects the following runtimes and is not a full system release:

- Polkadot Relay Chain
- Polkadot Asset Hub
- Polkadot Bridge Hub
- Polkadot Collectives
- Kusama Relay Chain
- Kusama Bridge Hub

## [1.2.7] 14.06.2024

Note: This release only affects the following runtimes and is not a full system release:
Expand Down Expand Up @@ -38,6 +54,10 @@ Note: This release only affects the following runtimes and is not a full system

- Kusama People: clear requested judgements that do not have corresponding deposits reserved ([polkadot-fellows/runtimes#339](https://github.com/polkadot-fellows/runtimes/pull/339))

### Changed

- People chain now uses 6-second block times ([polkadot-fellows/runtimes#308](https://github.com/polkadot-fellows/runtimes/pull/308))

### Removed

- Removed Identity-related code from Kusama Relay Chain ([polkadot-fellows/runtimes#315](https://github.com/polkadot-fellows/runtimes/pull/315))
Expand Down
Loading

0 comments on commit 47ed39e

Please sign in to comment.