Skip to content

Commit

Permalink
Require that go.mod, go.sum, vendor/modules.txt be up to date (#194)
Browse files Browse the repository at this point in the history
Originally, this tool didn't fuss if these files were the only thing out of
date. However, this has allowed some merge conflicts to appear.

Signed-off-by: Dean Roehrich <[email protected]>
  • Loading branch information
roehrich-hpe authored Aug 29, 2024
1 parent 274808b commit c6cfbc0
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions tools/release-all/release-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -253,21 +253,14 @@ check_peer_modules() {
go mod vendor || do_fail "${indent}Failure in go mod vendor"
fi

# If the module update touched only go.mod, go.sum, or modules.txt then
# forget about it.
# Let the user deal with any changes bigger than that.
if [[ $(git status -s | grep -c -v -e go.mod -e go.sum -e vendor/modules.txt) -gt 0 ]]; then
if [[ $(git status -s | wc -l) -gt 0 ]]; then
msg "${indent}Peer modules are behind."
msg "${indent}Update the modules and create a PR. I used:"
echo
echo "go get $peer_modules"
echo
exit 1
fi

# It was only go.mod, go.sum, or modules.txt, so toss those.
git restore go.mod go.sum
[[ -f vendor/modules.txt ]] && git restore vendor/modules.txt
fi
}

Expand Down

0 comments on commit c6cfbc0

Please sign in to comment.