Skip to content

Commit a151cdc

Browse files
committed
add a few comments for the toolstate stuff
1 parent 4b65a86 commit a151cdc

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ check_tool_failed() {
4141
}
4242

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

78-
# list all tools here
78+
# List all tools here.
79+
# This function gets called with "submodule_changed" for each PR that changed a submodule,
80+
# and with "beta_required" for each PR that lands on beta/stable.
7981
status_check() {
8082
check_dispatch $1 beta book src/doc/book
8183
check_dispatch $1 beta nomicon src/doc/nomicon
@@ -85,7 +87,8 @@ status_check() {
8587
check_dispatch $1 beta rls src/tools/rls
8688
check_dispatch $1 beta rustfmt src/tools/rustfmt
8789
check_dispatch $1 beta clippy-driver src/tools/clippy
88-
# these tools are not required for beta to successfully branch
90+
# These tools are not required on the beta/stable branches.
91+
# They will still cause failure during the beta cutoff week, see `src/tools/publish_toolstate.py` for that.
8992
check_dispatch $1 nightly miri src/tools/miri
9093
check_dispatch $1 nightly embedded-book src/doc/embedded-book
9194
check_dispatch $1 nightly rustc-guide src/doc/rustc-guide
@@ -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

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

Lines changed: 4 additions & 0 deletions
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)