Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump: weaver/testutils version in all go modules #466

Merged
merged 2 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion core/network/fabric-interop-cc/contracts/interop/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/golang/protobuf v1.5.4
github.com/hyperledger-labs/weaver-dlt-interoperability/common/protos-go v1.5.11
github.com/hyperledger-labs/weaver-dlt-interoperability/core/network/fabric-interop-cc/libs/assetexchange v1.5.11
github.com/hyperledger-labs/weaver-dlt-interoperability/core/network/fabric-interop-cc/libs/testutils v0.0.0-20220522111555-ae96e46bf4a1
github.com/hyperledger-labs/weaver-dlt-interoperability/core/network/fabric-interop-cc/libs/testutils v0.0.0-20240521164517-4cb6d4e59bfa
github.com/hyperledger-labs/weaver-dlt-interoperability/core/network/fabric-interop-cc/libs/utils v1.5.11
github.com/hyperledger/fabric-chaincode-go v0.0.0-20240425200701-0431f709af2c
github.com/hyperledger/fabric-contract-api-go v1.2.2
Expand Down
130 changes: 2 additions & 128 deletions core/network/fabric-interop-cc/contracts/interop/go.sum

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.20
require (
github.com/golang/protobuf v1.5.4
github.com/hyperledger-labs/weaver-dlt-interoperability/common/protos-go v1.5.11
github.com/hyperledger-labs/weaver-dlt-interoperability/core/network/fabric-interop-cc/libs/testutils v0.0.0-20210920170720-5d5bf2a54081
github.com/hyperledger-labs/weaver-dlt-interoperability/core/network/fabric-interop-cc/libs/testutils v0.0.0-20240521164517-4cb6d4e59bfa
github.com/hyperledger/fabric-chaincode-go v0.0.0-20240425200701-0431f709af2c
github.com/hyperledger/fabric-contract-api-go v1.2.2
github.com/hyperledger/fabric-protos-go v0.3.3
Expand Down
130 changes: 2 additions & 128 deletions core/network/fabric-interop-cc/interfaces/asset-mgmt/go.sum

Large diffs are not rendered by default.

46 changes: 29 additions & 17 deletions go-gen-checksum.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,24 @@ GOMODULE_PATHS=("core/network/fabric-interop-cc/libs/utils"
"core/network/fabric-interop-cc/contracts/interop")

for GOMODULE in ${GOMODULE_PATHS[@]}; do
echo "!!!!! START !!!!!!!"
echo "############# START $GOMODULE ################"
echo $GOMODULE
pushd $ROOT_DIR/$GOMODULE
GOMOD_DEPS=$(go mod graph | grep "$REPO/$GOMODULE $REPO" | cut -d ' ' -f 2)
cp go.sum go.sum.bkp
GOMOD_DEPS=$((go mod graph | grep "$REPO/$GOMODULE $REPO" | cut -d ' ' -f 2) || (echo "ERROR: In generating dependency graph" && exit 1))
popd

for GOMOD_DEP in ${GOMOD_DEPS[@]}; do
echo "######## START MOD DEP ############"
echo "--------- START DEP -----------"
GOMOD_PATH=$(echo $GOMOD_DEP | cut -d '@' -f 1 | awk -F "$REPO/" '{print $2}')
echo $GOMOD_DEP
echo $GOMOD_PATH
echo "DEP: $GOMOD_DEP"
echo "DEP: $GOMOD_PATH"
cp $ROOT_DIR/LICENSE $ROOT_DIR/$GOMOD_PATH
pushd $ROOT_DIR/$GOMOD_PATH
GOMOD_NAME="$REPO/$GOMOD_PATH"
if [ ! -f VERSION ]; then
echo "VERSION absent"
echo "INFO: VERSION absent"
popd
echo "######## END ############"
echo "------------ END --------------"
continue
fi
GOMOD_VERSION=v$(cat VERSION)
Expand All @@ -41,21 +40,34 @@ for GOMODULE in ${GOMODULE_PATHS[@]}; do
GOMOD_SUM_ENTRY="$GOMOD_NAME $GOMOD_VERSION $GOMOD_SUM"
GOMOD_DOTMOD_SUM_ENTRY="$GOMOD_NAME $GOMOD_VERSION/go.mod $GOMOD_DOTMOD_SUM"
echo "----"
echo $GOMOD_SUM_ENTRY
echo $GOMOD_DOTMOD_SUM_ENTRY
echo "GOSUM: $GOMOD_SUM_ENTRY"
echo "GOSUM: $GOMOD_DOTMOD_SUM_ENTRY"
echo "----"
popd
rm $ROOT_DIR/$GOMOD_PATH/LICENSE

pushd $ROOT_DIR/$GOMODULE
go mod edit -require $GOMOD_NAME@$GOMOD_VERSION
# mv go.sum go.sum.old
# grep -v "$GOMOD_NAME $GOMOD_VERSION" go.sum.old > go.sum
echo $GOMOD_SUM_ENTRY >> go.sum
echo $GOMOD_DOTMOD_SUM_ENTRY >> go.sum
UPDATE=false
(cat go.mod | grep -q "$GOMOD_NAME $GOMOD_VERSION") || UPDATE=True
if $UPDATE; then
go mod edit -require $GOMOD_NAME@$GOMOD_VERSION
else
echo "ERROR: Version $GOMOD_VERSION already there in go.mod, skipping $GOMOD_PATH in $GOMODULE"
fi
UPDATE=false
(cat go.sum | grep -q "$GOMOD_SUM_ENTRY") || UPDATE=True
(cat go.sum | grep -q "$GOMOD_DOTMOD_SUM_ENTRY") || UPDATE=True
if $UPDATE; then
# mv go.sum go.sum.old
# grep -v "$GOMOD_NAME $GOMOD_VERSION" go.sum.old > go.sum
echo "$GOMOD_SUM_ENTRY" >> go.sum
echo "$GOMOD_DOTMOD_SUM_ENTRY" >> go.sum
else
echo "ERROR: Version $GOMOD_VERSION already there in go.sum, skipping $GOMOD_PATH in $GOMODULE"
VRamakrishna marked this conversation as resolved.
Show resolved Hide resolved
fi
popd
echo "######## END ############"
echo "------------ END --------------"
done
echo "!!!!! END !!!!!!!"
echo "############# END $GOMODULE ################\n"
done

3 changes: 2 additions & 1 deletion go-mod-tidy.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# Root of repo
ROOT_DIR=${1:-'..'}
ROOT_DIR=${1:-'.'}

GOMODULE_PATHS=("core/network/fabric-interop-cc/libs/utils"
"core/network/fabric-interop-cc/libs/assetexchange"
Expand All @@ -18,6 +18,7 @@ GOMODULE_PATHS=("core/network/fabric-interop-cc/libs/utils"
for GOMODULE in ${GOMODULE_PATHS[@]}; do
echo "############# START $GOMODULE ################"
pushd $ROOT_DIR/$GOMODULE > /dev/null
go mod tidy
make run-vendor || (go mod tidy && make run-vendor)
make undo-vendor
go mod tidy
Expand Down
2 changes: 1 addition & 1 deletion samples/fabric/simpleasset/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/golang/protobuf v1.5.4
github.com/hyperledger-labs/weaver-dlt-interoperability/common/protos-go v1.5.11
github.com/hyperledger-labs/weaver-dlt-interoperability/core/network/fabric-interop-cc/interfaces/asset-mgmt v1.5.11
github.com/hyperledger-labs/weaver-dlt-interoperability/core/network/fabric-interop-cc/libs/testutils v0.0.0-20210920170720-5d5bf2a54081
github.com/hyperledger-labs/weaver-dlt-interoperability/core/network/fabric-interop-cc/libs/testutils v0.0.0-20240521164517-4cb6d4e59bfa
github.com/hyperledger/fabric-chaincode-go v0.0.0-20240425200701-0431f709af2c
github.com/hyperledger/fabric-contract-api-go v1.2.2
github.com/hyperledger/fabric-protos-go v0.3.3
Expand Down
Loading
Loading