Use reverse postsubmit for impact detection

This commit is contained in:
Mustafa Gezen 2022-11-01 04:24:51 +01:00
parent e9f7e34810
commit a3fb219ed8
Signed by untrusted user who does not match committer: mustafa
GPG Key ID: DCDF010D946438C1

View File

@ -9,16 +9,19 @@ workspace_dir="$(pwd)"
$BAZEL_B //:bazel-diff $BAZEL_B //:bazel-diff
BASE_HASH="$PULL_BASE_SHA"
TARGET_HASH="$PULL_PULL_SHA"
if [[ -z "$TARGET_HASH" ]]; then
BASE_HASH="$(git log --pretty=format:"%H" --merges -n 1)"
TARGET_HASH="$PULL_BASE_SHA"
fi
# Generate starting hashes # Generate starting hashes
echo "Base hash is $PULL_BASE_SHA" echo "Base hash is $BASE_HASH"
git checkout "$PULL_BASE_SHA" --quiet git checkout "$BASE_HASH" --quiet
bazel-bin/bazel-diff generate-hashes -w "$workspace_dir" -b "$bazel_bin" starting_hashes_json bazel-bin/bazel-diff generate-hashes -w "$workspace_dir" -b "$bazel_bin" starting_hashes_json
# Generate ending hashes # Generate ending hashes
TARGET_HASH="$PULL_PULL_SHA"
if [[ -z "$TARGET_HASH" ]]; then
TARGET_HASH="$(git log --pretty=format:"%H" --merges -n 1)"
fi
echo "Target hash is $TARGET_HASH" echo "Target hash is $TARGET_HASH"
git checkout "$TARGET_HASH" --quiet git checkout "$TARGET_HASH" --quiet
bazel-bin/bazel-diff generate-hashes -w "$workspace_dir" -b "$bazel_bin" ending_hashes_json bazel-bin/bazel-diff generate-hashes -w "$workspace_dir" -b "$bazel_bin" ending_hashes_json