Skip to content

Commit b2d05db

Browse files
RalfJungmark-i-m
authored andcommitted
add a few comments for the toolstate stuff
1 parent 8070bb8 commit b2d05db

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

Diff for: src/ci/docker/x86_64-gnu-tools/checktools.sh

+8-4
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ check_tool_failed() {
4242
}
4343

4444
# This function checks that if a tool's submodule changed, the tool's state must improve
45-
verify_status() {
45+
verify_submodule_changed() {
4646
echo "Verifying status of $1..."
4747
if echo "$CHANGED_FILES" | grep -q "^M[[:blank:]]$2$"; then
4848
echo "This PR updated '$2', verifying if status is 'test-pass'..."
@@ -67,7 +67,7 @@ verify_status() {
6767
check_dispatch() {
6868
if [ "$1" = submodule_changed ]; then
6969
# ignore $2 (branch id)
70-
verify_status $3 $4
70+
verify_submodule_changed $3 $4
7171
elif [ "$2" = beta ]; then
7272
echo "Requiring test passing for $3..."
7373
if check_tool_failed "$3"; then
@@ -76,7 +76,9 @@ check_dispatch() {
7676
fi
7777
}
7878

79-
# list all tools here
79+
# List all tools here.
80+
# This function gets called with "submodule_changed" for each PR that changed a submodule,
81+
# and with "beta_required" for each PR that lands on beta/stable.
8082
status_check() {
8183
check_dispatch $1 beta book src/doc/book
8284
check_dispatch $1 beta nomicon src/doc/nomicon
@@ -86,7 +88,8 @@ status_check() {
8688
check_dispatch $1 beta rls src/tools/rls
8789
check_dispatch $1 beta rustfmt src/tools/rustfmt
8890
check_dispatch $1 beta clippy-driver src/tools/clippy
89-
# these tools are not required for beta to successfully branch
91+
# These tools are not required on the beta/stable branches.
92+
# They will still cause failure during the beta cutoff week, see `src/tools/publish_toolstate.py` for that.
9093
check_dispatch $1 nightly miri src/tools/miri
9194
check_dispatch $1 nightly embedded-book src/doc/embedded-book
9295
}
@@ -97,6 +100,7 @@ status_check() {
97100
status_check "submodule_changed"
98101

99102
CHECK_NOT="$(readlink -f "$(dirname $0)/checkregression.py")"
103+
# This callback is called by `commit_toolstate_change`, see `repo.sh`.
100104
change_toolstate() {
101105
# only update the history
102106
if python2.7 "$CHECK_NOT" "$OS" "$TOOLSTATE_FILE" "_data/latest.json" changed; then

Diff for: src/ci/docker/x86_64-gnu-tools/repo.sh

+4
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ commit_toolstate_change() {
6262
MESSAGE_FILE="$1"
6363
shift
6464
for RETRY_COUNT in 1 2 3 4 5; do
65+
# Call the callback; this will in the end call `change_toolstate` from
66+
# `checktools.sh` if we are in the `auto` branch (pre-landing) or
67+
# `src/tools/publish_toolstate.py` if we are in the `master` branch
68+
# (post-landing).
6569
"$@"
6670
# `git commit` failing means nothing to commit.
6771
FAILURE=0

0 commit comments

Comments
 (0)