Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Initial version of bridging pallets as git subtree #2458

Merged
merged 23 commits into from
May 4, 2023
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
795fe4e
Initial version of bridges pallet as subtree of https://github.com/pa…
bkontur Apr 14, 2023
a9e2773
Squashed 'bridges/' content from commit d30927c08
bkontur Apr 17, 2023
71a1d47
Merge commit 'a9e27730296e3269b82cd315aed9d635610f076c' as 'bridges'
bkontur Apr 17, 2023
1e489dd
Updated REAMDE.md and BRIDGES.md (inspired by original https://github…
bkontur Apr 17, 2023
0670d9f
Squashed 'bridges/' changes from d30927c08..d3970944b
bkontur Apr 17, 2023
71aad1e
Merge commit '0670d9fa5ae67f6f01028440318a723d1b330720' into bridge-h…
bkontur Apr 17, 2023
f2277b6
Squashed 'bridges/' changes from d3970944b..2180797fb
bkontur Apr 18, 2023
873f5cc
Merge commit 'f2277b6f81208bd38a15cb74ebd535c4cd851b32' into bridge-h…
bkontur Apr 18, 2023
8f2b30d
Merge remote-tracking branch 'origin/master' into bridge-hub-subtree
bkontur Apr 18, 2023
ad6bfdf
Merge remote-tracking branch 'origin/master' into bridge-hub-subtree
bkontur Apr 27, 2023
9c5701c
Squashed 'bridges/' changes from 2180797fbf..4850aac8ce
bkontur Apr 27, 2023
a6bf890
Merge commit '9c5701c8ccafd307cae9abff43e8a3f86e855f47' into bridge-h…
bkontur Apr 27, 2023
6c29018
Merge commit 'fd69d9414cdc2586be3e26d7599dc50b587c7428' into bridge-h…
bkontur Apr 27, 2023
fd69d94
Squashed 'bridges/' changes from 4850aac8ce..66aaf0dd23
bkontur Apr 27, 2023
4f7c913
Merge remote-tracking branch 'origin/master' into bridge-hub-subtree
Apr 27, 2023
17fc1c1
Merge remote-tracking branch 'origin/master' into bridge-hub-subtree
bkontur May 3, 2023
8b62a00
Squashed 'bridges/' changes from 66aaf0dd23..557ecbcecc
bkontur May 3, 2023
00e45c5
Merge commit '8b62a005717fbe976832504b1f0c39eee19ac0a6' into bridge-h…
bkontur May 3, 2023
b93712d
fmt
bkontur May 3, 2023
e6497d4
Merge remote-tracking branch 'origin/master' into bridge-hub-subtree
bkontur May 3, 2023
65ee2dc
Squashed 'bridges/' changes from 557ecbcecc..04b3dda6aa
bkontur May 3, 2023
6dd9e36
Merge commit '65ee2dc77f5c0832f48b5331371483ff5c3c2574' into bridge-h…
bkontur May 3, 2023
1a986c5
".git/.scripts/commands/fmt/fmt.sh"
May 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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