Skip to content

Commit

Permalink
Merge branch 'base' into yuji/ibc-rs-0.52.0
Browse files Browse the repository at this point in the history
  • Loading branch information
yito88 committed May 2, 2024
2 parents babaeab + 9d4de02 commit 3e4e57b
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,12 @@ jobs:
curl -o hermes.zip -LO https://github.com/heliaxdev/hermes/releases/download/v${HERMES_VERSION}/hermes-v${HERMES_VERSION}-x86_64-unknown-linux-gnu.zip
unzip hermes.zip
mv hermes /usr/local/bin
- name: Download Gaia
run: |
GAIA_VERSION=$(cat .github/workflows/scripts/gaia.txt)
echo "Using gaiad version: ${GAIA_VERSION}"
curl -o gaiad -LO https://github.com/cosmos/gaia/releases/download/v${GAIA_VERSION}/gaiad-v${GAIA_VERSION}-linux-amd64
mv gaiad /usr/local/bin
- name: Change permissions
run: |
chmod +x target/release/namada
Expand All @@ -684,6 +690,7 @@ jobs:
chmod +x target/release/namadar
chmod +x /usr/local/bin/cometbft
chmod +x /usr/local/bin/hermes
chmod +x /usr/local/bin/gaiad
- name: Run e2e test
run: python3 .github/workflows/scripts/schedule-e2e.py
env:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/scripts/gaia.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
15.2.0
2 changes: 1 addition & 1 deletion genesis/localnet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ The validator transactions are signed using (note the extra `--alias` argument n
cargo run --bin namadac -- --base-dir "genesis/localnet/src" utils \
sign-genesis-txs \
--path "genesis/localnet/src/pre-genesis/validator-0/unsigned-transactions.toml" \
--output "genesis/localnet/src/validator-0/signed-transactions.toml"
--output "genesis/localnet/src/pre-genesis/validator-0/signed-transactions.toml" \
--alias validator-0
```

Expand Down
2 changes: 1 addition & 1 deletion scripts/gen_localnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def edit_parameters(params_toml, **kwargs):
if args.max_validator_slots:
params['pos_params'] = {'max_validator_slots': args.max_validator_slots}
if args.epoch_length:
epochs_per_year = 365 * 24 * 60 * 60 / args.epoch_length
epochs_per_year = round(365 * 24 * 60 * 60 / args.epoch_length)
params['parameters'] = {'epochs_per_year': epochs_per_year }
if len(params.keys())>0:
edit_parameters(localnet_dir + '/parameters.toml', **params)
Expand Down
65 changes: 65 additions & 0 deletions scripts/merge_pr.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/usr/bin/env bash
#
# A helper to merge e.g. a PR from draft to an RC branch where any neccessary
# conflicts resolutions are expected to have been trained with rerere.
#
# It merges PRs from "origin" remote which should be set to "git@github.com:anoma/namada.git".
# Make sure to fetch latest before running with e.g. `git fetch origin`.
#
# Requires `gh` to be installed and authenticated.
#
# Usage example:
# $ scripts/merge_pr.sh 2627 2db3acdb21581bb502b27dc9c1c831b4e94ad013 && \
# $ scripts/merge_pr.sh 2698 0d3b252e7f5ceb85a276966fe8ee7d7e1c0c6e63 ce68d3a57eb342495a43dc65ee03394b116fd484 && \
# $ scripts/merge_pr.sh 2819
#
# The first argument is a PR number, followed by any number of evil commit
# hashes.

set -Eo pipefail

PR_NUM=$1

BRANCH=$(gh pr view "$PR_NUM" --json headRefName -q .headRefName)
echo "🔴 Merging branch $BRANCH https://github.com/anoma/namada/pull/$PR_NUM ..."

# TODO: handle cross-repository PRs (and remote & fetch)
IS_CROSS=$(gh pr view "$PR_NUM" --json isCrossRepository -q .isCrossRepository)
if [ "$IS_CROSS" == "true" ]; then
echo "🪦 Cross-repository PR, manual intervention needed for PR #$PR_NUM"
exit 1
fi

# Merge the PR
git merge --no-ff -m "Merge branch '$BRANCH' (#$PR_NUM)" origin/"$BRANCH"

if [ $? -ne 0 ]; then
echo ""
echo "In rerere we trust 🙏"

git add wasm_for_tests/*.wasm

git commit --no-edit

if [ $? -ne 0 ]; then
echo "🪦 Automatic resolution failed, manual intervention needed for PR #$PR_NUM"
exit 1
fi
fi

# Add evil commits
for var in "${@:2}" # Skip the first arg (PR number)
do
echo ""
echo "🙉 Adding evil $var..."
git cherry-pick --no-commit "$var"
git commit --amend --no-edit

if [ $? -ne 0 ]; then
echo "🪦 Evil commit failed to apply, manual intervention needed for PR #$PR_NUM"
exit 1
fi
done

echo ""
echo ""

0 comments on commit 3e4e57b

Please sign in to comment.