Skip to content

Commit

Permalink
Merge branch 'bridge-hub-rococo-wococo' into alistair/merge-from-upst…
Browse files Browse the repository at this point in the history
…ream
  • Loading branch information
alistair-singh committed Apr 17, 2023
2 parents ee4c538 + 5b20c4e commit 60502b2
Show file tree
Hide file tree
Showing 102 changed files with 4,028 additions and 898 deletions.
10 changes: 9 additions & 1 deletion .github/pr-custom-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,20 @@ rules:
check_type: changed_files
condition:
include: .*
# excluding files from 'Runtime files' and 'CI files' rules
# excluding files from 'Runtime files' and 'CI files' rules and `Bridges subtree files`
exclude: ^parachains/runtimes/assets/(statemine|statemint)/src/[^/]+\.rs$|^parachains/runtimes/bridge-hubs/(bridge-hub-kusama|bridge-hub-polkadot)/src/[^/]+\.rs$|^parachains/runtimes/collectives/collectives-polkadot/src/[^/]+\.rs$|^parachains/common/src/[^/]+\.rs$|^\.gitlab-ci\.yml|^scripts/ci/.*|^\.github/.*
min_approvals: 2
teams:
- core-devs

# if there are any changes in the bridges subtree (in case of backport changes back to bridges repo)
- name: Bridges subtree files
check_type: changed_files
condition: ^bridges/.*
min_approvals: 1
teams:
- bridges-core

- name: CI files
check_type: changed_files
condition:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
protoc --version
- name: Checkout repository
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2

- name: Rust versions
run: rustup show
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/fmt-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
target
key: ${{ runner.os }}-${{ matrix.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2

- name: Cargo fmt
uses: actions-rs/cargo@ae10961054e4aa8b4aa7dffede299aaf087aa33b # v1.0.3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-01_branch-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with:
fetch-depth: 0

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-10_rc-automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
pre-releases: true
steps:
- name: Checkout sources
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with:
fetch-depth: 0
- id: compute_tag
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
REF_URL: ${{github.event.inputs.reference_url}}

steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2

- name: Fetch binary
run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
relay: polkadot-local

steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2

- name: Create tmp dir
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release-30_create-draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
runtime: rococo-parachain
steps:
- name: Checkout sources
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with:
ref: ${{ github.event.inputs.ref2 }}

Expand Down Expand Up @@ -120,7 +120,7 @@ jobs:
asset_upload_url: ${{ steps.create-release.outputs.upload_url }}
steps:
- name: Checkout sources
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with:
fetch-depth: 0
path: cumulus
Expand Down Expand Up @@ -246,7 +246,7 @@ jobs:
runtime: rococo-parachain
steps:
- name: Checkout sources
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with:
ref: ${{ github.event.inputs.ref2 }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-50_docker-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:

steps:
- name: Checkout sources
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with:
ref: ${{ github.event.release.tag_name }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-50_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

steps:
- name: Checkout sources
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with:
ref: ${{ github.event.release.tag_name }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/srtool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
- category: testing
runtime: rococo-parachain
steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with:
fetch-depth: 0

Expand Down
2 changes: 0 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,6 @@ variables:
- !reference [.common-before-script, before_script]
- rustup show
- cargo --version
- rustup +nightly show
- cargo +nightly --version
- bash --version
tags:
- linux-docker-vm-c2
Expand Down
88 changes: 88 additions & 0 deletions BRIDGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Using Parity Bridges Common dependency (`git subtree`).

In `./bridges` sub-directory you can find a `git subtree` imported version of:
[parity-bridges-common](https://github.com/paritytech/parity-bridges-common/) repository.

(For regular Cumulus contributor 1. is relevant) \
(For Cumulus maintainer 1. and 2. are relevant) \
(For Bridges team 1. and 2. and 3. are relevant)

# 1. How to fix broken Bridges code?

To fix Bridges code simply create a commit in current (`Cumulus`) repo. Best if
the commit is isolated to changes in `./bridges` sub-directory, because it makes
it easier to import that change back to upstream repo.

(Any changes to `bridges` subtree require Bridges team approve and they should manage backport to Bridges repo)


# 2. How to pull latest Bridges code to the `bridges` subtree
(in practice)
```
cd <cumulus-git-repo-dir>
# this will update new git branches from bridges repo
# there could be unresolved conflicts, but dont worry,
# lots of them are caused because of removed unneeded files with patch step,
./scripts/bridges_update_subtree.sh fetch
# so, after fetch and before solving conflicts just run patch,
# this will remove unneeded files and checks if subtree modules compiles
./scripts/bridges_update_subtree.sh patch
# if there are conflicts, this could help,
# this removes locally deleted files at least (move changes to git stash for commit)
./scripts/bridges_update_subtree.sh merge
# (optional) when conflicts resolved, you can check build again - should pass
# also important: this updates global Cargo.lock
./scripts/bridges_update_subtree.sh patch
# add changes to the commit, first command `fetch` starts merge,
# so after all conflicts are solved and patch passes and compiles,
# then we need to finish merge with:
git merge --continue
````

# 3. How to pull latest Bridges code or contribute back?
(in theory)

Note that it's totally fine to ping the **Bridges Team** to do that for you. The point
of adding the code as `git subtree` is to **reduce maintenance cost** for Cumulus/Polkadot
developers.

If you still would like to either update the code to match latest code from the repo
or create an upstream PR read below. The following commands should be run in the
current (`polkadot`) repo.

1. Add Bridges repo as a local remote:
```
$ git remote add -f bridges git@github.com:paritytech/parity-bridges-common.git
```

If you plan to contribute back, consider forking the repository on Github and adding
your personal fork as a remote as well.
```
$ git remote add -f my-bridges git@github.com:tomusdrw/parity-bridges-common.git
```

2. To update Bridges:
```
$ git fetch bridges master
$ git subtree pull --prefix=bridges bridges master --squash
````

We use `--squash` to avoid adding individual commits and rather squashing them
all into one.

3. Clean unneeded files here:
```
./bridges/scripts/verify-pallets-build.sh --ignore-git-state --no-revert
```

4. Contributing back to Bridges (creating upstream PR)
```
$ git subtree push --prefix=bridges my-bridges master
```
This command will push changes to your personal fork of Bridges repo, from where
you can simply create a PR to the main repo.
Loading

0 comments on commit 60502b2

Please sign in to comment.