From ff6e27c73731ccbee96ad6ffa71ce282c4837462 Mon Sep 17 00:00:00 2001 From: terence Date: Thu, 10 Apr 2025 06:40:29 -0700 Subject: [PATCH] Remove unused hack script (#15157) --- changelog/tt_6.md | 3 ++ hack/coverage.sh | 18 --------- hack/mirror-ethereumapis.sh | 80 ------------------------------------- 3 files changed, 3 insertions(+), 98 deletions(-) create mode 100644 changelog/tt_6.md delete mode 100755 hack/coverage.sh delete mode 100755 hack/mirror-ethereumapis.sh diff --git a/changelog/tt_6.md b/changelog/tt_6.md new file mode 100644 index 0000000000..9ec22331b0 --- /dev/null +++ b/changelog/tt_6.md @@ -0,0 +1,3 @@ +### Removed + +- Removed unused hack scripts. \ No newline at end of file diff --git a/hack/coverage.sh b/hack/coverage.sh deleted file mode 100755 index 6bcfd36259..0000000000 --- a/hack/coverage.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash - -declare -a skip_coverage=("github.com/prysmaticlabs/prysm/contracts/sharding-manager-contract" - "github.com/prysmaticlabs/prysm/contracts/validator-registration-contract") - -set -e -echo "" > coverage.txt - -for d in $(go list ./... | grep -v vendor); do - if [[ ${skip_coverage[*]} =~ $d ]]; then - continue - fi - go test -coverprofile=profile.out -covermode=atomic "$d" - if [ -f profile.out ]; then - cat profile.out >> coverage.txt - rm profile.out - fi -done diff --git a/hack/mirror-ethereumapis.sh b/hack/mirror-ethereumapis.sh deleted file mode 100755 index fa3ae7d289..0000000000 --- a/hack/mirror-ethereumapis.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/env bash -# -# Script to mirror a tag from Prysm into EthereumAPIs protocol buffers -# -# Example: -# -# mirror-ethereumapis.sh -# -set -e - -# Validate settings. -[ "$TRACE" ] && set -x - -## Define variables. -GH_API="https://api.github.com" -GH_REPO="$GH_API/repos/prysmaticlabs/ethereumapis" - -AUTH="Authorization: token $GITHUB_SECRET_ACCESS_TOKEN" -## skipcq: SH-2034 -export WGET_ARGS="--content-disposition --auth-no-challenge --no-cookie" -## skipcq: SH-2034 -export CURL_ARGS="-LJO#" - -## Validate token. -curl -o /dev/null -sH "$AUTH" "$GH_REPO" || { echo "Error: Invalid repo, token or network issue!"; exit 1; } - -# Clone ethereumapis and prysm -git clone https://github.com/prysmaticlabs/prysm /tmp/prysm/ -git clone https://github.com/prysmaticlabs/ethereumapis /tmp/ethereumapis/ - -# Checkout the release tag in prysm and copy over protos -cd /tmp/prysm && git checkout "$BUILDKITE_COMMIT" - -# Copy proto files, go files, and markdown files -find proto/eth \( -name '*.go' -o -name '*.proto' -o -name '*.md' \) -print0 | - while IFS= read -r -d '' line; do - item_path=$(dirname "$line") - mkdir -p /tmp/ethereumapis"${item_path#*proto}" && cp "$line" /tmp/ethereumapis"${line#*proto}" - done - -cd /tmp/ethereumapis || exit - -## Replace imports in go files and proto files as needed -find ./eth -name '*.go' -print0 | - while IFS= read -r -d '' line; do - sed -i 's/prysm\/proto\/eth/ethereumapis\/eth/g' "$line" - done - -find ./eth -name '*.go' -print0 | - while IFS= read -r -d '' line; do - sed -i 's/proto\/eth/eth/g' "$line" - done - -find ./eth -name '*.go' -print0 | - while IFS= read -r -d '' line; do - sed -i 's/proto_eth/eth/g' "$line" - done - -find ./eth -name '*.proto' -print0 | - while IFS= read -r -d '' line; do - sed -i 's/"proto\/eth/"eth/g' "$line" - done - -find ./eth -name '*.proto' -print0 | - while IFS= read -r -d '' line; do - sed -i 's/prysmaticlabs\/prysm\/proto\/eth/prysmaticlabs\/ethereumapis\/eth/g' "$line" - done - -if git diff-index --quiet HEAD --; then - echo "nothing to push, exiting early" - exit 0 -else - echo "changes detected, committing and pushing to ethereumapis" -fi - -# Push to the mirror repository -git add --all -GIT_AUTHOR_EMAIL=contact@prysmaticlabs.com GIT_AUTHOR_NAME=prysm-bot GIT_COMMITTER_NAME=prysm-bot GIT_COMMITTER_EMAIL=contact@prysmaticlabs.com git commit -am "Mirrored from github.com/prysmaticlabs/prysm@$BUILDKITE_COMMIT" -git remote set-url origin https://prylabs:"$GITHUB_SECRET_ACCESS_TOKEN"@github.com/prysmaticlabs/ethereumapis.git -git push origin master