Skip to content

Commit 003b063

Browse files
committed
Auto merge of #47063 - kennytm:gate-tools-on-update, r=<try>
[WIP] Requires tools to test-pass if the corresponding submodule is updated. Follow up of #46554. Breaking a tool would not stop bors from accepting a merge, but this also means when we intend to *fix* a tool but failed, bors will *still* accept the PR. This behavior is not helpful to the tool maintainers. This PR attempts to fix this by rejecting the tool-update merge when a tool failed. It recognizes a PR as "tool-updating" when the corresponding submodule is changed, compared with the previous commit. [WIP] - Final check to ensure the CI is interpreting the PR description correctly.
2 parents 35681fb + 05953b3 commit 003b063

File tree

3 files changed

+28
-6
lines changed

3 files changed

+28
-6
lines changed

.travis.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ services:
55
- docker
66

77
git:
8-
depth: 1
8+
depth: 2
99
submodules: false
1010

1111
matrix:
@@ -16,13 +16,13 @@ matrix:
1616
if: type = pull_request OR branch = auto
1717

1818
- env: IMAGE=dist-x86_64-linux DEPLOY=1
19-
if: branch = try OR branch = auto
19+
if: branch = tryx OR branch = auto
2020

2121
# "alternate" deployments, these are "nightlies" but have LLVM assertions
2222
# turned on, they're deployed to a different location primarily for
2323
# additional testing.
2424
- env: IMAGE=dist-x86_64-linux DEPLOY_ALT=1
25-
if: branch = try OR branch = auto
25+
if: branch = tryx OR branch = auto
2626

2727
- env: >
2828
RUST_CHECK_TARGET=dist
@@ -169,7 +169,7 @@ matrix:
169169
- env: IMAGE=x86_64-gnu-aux
170170
if: branch = auto
171171
- env: IMAGE=x86_64-gnu-tools
172-
if: branch = auto
172+
# if: branch = auto
173173
- env: IMAGE=x86_64-gnu-debug
174174
if: branch = auto
175175
- env: IMAGE=x86_64-gnu-nopt

appveyor.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ environment:
9696
matrix:
9797
fast_finish: true
9898

99-
clone_depth: 1
99+
clone_depth: 2
100100
build: false
101101

102102
install:

src/ci/docker/x86_64-gnu-tools/checktools.sh

+23-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ X_PY="$1"
1616
TOOLSTATE_FILE="$(realpath $2)"
1717
OS="$3"
1818
COMMIT="$(git rev-parse HEAD)"
19+
CHANGED_FILES="$(git diff --name-status HEAD HEAD^)"
1920

2021
touch "$TOOLSTATE_FILE"
2122

@@ -29,7 +30,28 @@ set -e
2930

3031
cat "$TOOLSTATE_FILE"
3132

32-
if [ "$RUST_RELEASE_CHANNEL" = nightly ]; then
33+
# If this PR is intended to update one of these tools, do not let the build pass
34+
# when they do not test-pass.
35+
for TOOL in rls rustfmt miri clippy; do
36+
echo "Verifying status of $TOOL..."
37+
if echo "$CHANGED_FILES" | grep -q "^M[[:blank:]]src/tools/$TOOL$"; then
38+
echo "This PR updated 'src/tools/$TOOL', verifying if status is 'test-pass'..."
39+
if grep -vq '"'"$TOOL"'[^"]*":"test-pass"' "$TOOLSTATE_FILE"; then
40+
echo
41+
echo "⚠️ We detected that this PR updated '$TOOL', but its tests failed."
42+
echo
43+
echo "If you do intend to update '$TOOL', please check the error messages above and"
44+
echo "commit another update."
45+
echo
46+
echo "If you do NOT intend to update '$TOOL', please ensure you did not accidentally"
47+
echo "change the submodule at 'src/tools/$TOOL'. You may ask your reviewer for the"
48+
echo "proper steps."
49+
exit 3
50+
fi
51+
fi
52+
done
53+
54+
if [ "$RUST_RELEASE_CHANNEL" = nightly -a -n "${TOOLSTATE_REPO_ACCESS_TOKEN+is_set}" ]; then
3355
. "$(dirname $0)/repo.sh"
3456
MESSAGE_FILE=$(mktemp -t msg.XXXXXX)
3557
echo "($OS CI update)" > "$MESSAGE_FILE"

0 commit comments

Comments
 (0)