Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
polkadot-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
parity
Mirrored projects
polkadot-sdk
Commits
a230a377
Commit
a230a377
authored
11 months ago
by
Serban Iorga
Committed by
Bastian Köcher
11 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Leftovers
parent
4ad46c81
Branches
Branches containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
BRIDGES.md
+0
-91
0 additions, 91 deletions
BRIDGES.md
scripts/bridges_update_subtree.sh
+0
-85
0 additions, 85 deletions
scripts/bridges_update_subtree.sh
with
0 additions
and
176 deletions
BRIDGES.md
deleted
100644 → 0
+
0
−
91
View file @
4ad46c81
# 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)
## 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)
## How to pull latest Bridges code to the `bridges` subtree
(in practice)
The
`bridges`
repo has a stabilized branch
`polkadot-staging`
dedicated for releasing.
```
cd <cumulus-git-repo-dir>
# this will update new git branches from bridges repo
# there could be unresolved conflicts, but don't worry,
# lots of them are caused because of removed unneeded files with patch step,
BRANCH=polkadot-staging ./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
```
## 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.
### 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
```
### To update Bridges
```
git fetch bridges polkadot-staging
git subtree pull --prefix=bridges bridges polkadot-staging --squash
```
We use
`--squash`
to avoid adding individual commits and rather squashing them
all into one.
### Clean unneeded files here
```
./bridges/scripts/verify-pallets-build.sh --ignore-git-state --no-revert
```
### Contributing back to Bridges (creating upstream PR)
```
git subtree push --prefix=bridges my-bridges polkadot-staging
```
This command will push changes to your personal fork of Bridges repo, from where
you can simply create a PR to the main repo.
This diff is collapsed.
Click to expand it.
scripts/bridges_update_subtree.sh
deleted
100755 → 0
+
0
−
85
View file @
4ad46c81
#!/bin/bash
# A script to update bridges repo as subtree to Cumulus
# Usage:
# ./scripts/bridges_update_subtree.sh fetch
# ./scripts/bridges_update_subtree.sh patch
# ./scripts/bridges_update_subtree.sh merge
set
-e
BRIDGES_BRANCH
=
"
${
BRANCH
:-
polkadot
-staging
}
"
BRIDGES_TARGET_DIR
=
"
${
TARGET_DIR
:-
bridges
}
"
function
fetch
()
{
# the script is able to work only on clean git copy
[[
-z
"
$(
git status
--porcelain
)
"
]]
||
{
echo
>
&2
"The git copy must be clean (stash all your changes):"
;
git status
--porcelain
exit
1
;
}
local
bridges_remote
=
$(
git remote
-v
|
grep
"parity-bridges-common.git (fetch)"
|
head
-n1
|
awk
'{print $1;}'
)
if
[
-z
"
$bridges_remote
"
]
;
then
echo
""
echo
"Adding new remote: 'bridges' repo..."
echo
""
echo
"... check your YubiKey ..."
git remote add
-f
bridges git@github.com:paritytech/parity-bridges-common.git
bridges_remote
=
"bridges"
else
echo
""
echo
"Fetching remote: '
${
bridges_remote
}
' repo..."
echo
""
echo
"... check your YubiKey ..."
git fetch
${
bridges_remote
}
--prune
fi
echo
""
echo
"Syncing/updating subtree with remote branch '
${
bridges_remote
}
/
$BRIDGES_BRANCH
' to target directory: '
$BRIDGES_TARGET_DIR
'"
echo
""
echo
"... check your YubiKey ..."
git subtree pull
--prefix
=
$BRIDGES_TARGET_DIR
${
bridges_remote
}
$BRIDGES_BRANCH
--squash
}
function
patch
()
{
echo
""
echo
"Patching/removing unneeded stuff from subtree in target directory: '
$BRIDGES_TARGET_DIR
'"
$BRIDGES_TARGET_DIR
/scripts/verify-pallets-build.sh
--ignore-git-state
--no-revert
}
function
merge
()
{
echo
""
echo
"Merging stuff from subtree in target directory: '
$BRIDGES_TARGET_DIR
'"
# stage all removed by patch: DU, MD, D, AD - only from subtree directory
git status
-s
|
awk
'$1 == "DU" || $1 == "D" || $1 == "MD" || $1 == "AD" {print $2}'
|
grep
"^
$BRIDGES_TARGET_DIR
/"
| xargs git
rm
-q
--ignore-unmatch
echo
""
echo
"When all conflicts are resolved, do 'git merge --continue'"
}
function
amend
()
{
echo
""
echo
"Amend stuff from subtree in target directory: '
$BRIDGES_TARGET_DIR
'"
git commit
--amend
-S
-m
"updating bridges subtree + remove extra folders"
}
case
"
$1
"
in
fetch
)
fetch
;;
patch
)
patch
;;
merge
)
merge
;;
amend
)
amend
;;
all
)
fetch
patch
;;
esac
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment