Skip to content

Commit 96179cd

Browse files
authored
Rollup merge of rust-lang#52940 - kennytm:move-checktool-protection-week, r=alexcrichton
Align 6-week cycle check with beta promotion instead of stable release. The regression check is to make beta promotion easier, so it makes more sense to use the Tuesday of the release week (T-2) as the end point of the regression prevention, instead of Thursday (T-0). But since the beta promotion PR is sent at Tuesday evening at UTC, the protection should include the whole Tuesday as well, meaning the 6-week cycle will start from Wednesdays. This will also move the start of the regression protection week one day earlier.
2 parents 579adf8 + 0da7da8 commit 96179cd

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

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

+6-4
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@ TOOLSTATE_FILE="$(realpath $2)"
1717
OS="$3"
1818
COMMIT="$(git rev-parse HEAD)"
1919
CHANGED_FILES="$(git diff --name-status HEAD HEAD^)"
20-
SIX_WEEK_CYCLE="$(( ($(date +%s) / 604800 - 3) % 6 ))"
21-
# ^ 1970 Jan 1st is a Thursday, and our release dates are also on Thursdays,
22-
# thus we could divide by 604800 (7 days in seconds) directly.
20+
SIX_WEEK_CYCLE="$(( ($(date +%s) / 86400 - 20) % 42 ))"
21+
# ^ Number of days after the last promotion of beta.
22+
# Its value is 41 on the Tuesday where "Promote master to beta (T-2)" happens.
23+
# The Wednesday after this has value 0.
24+
# We track this value to prevent regressing tools in the last week of the 6-week cycle.
2325

2426
touch "$TOOLSTATE_FILE"
2527

@@ -98,7 +100,7 @@ change_toolstate() {
98100
if python2.7 "$CHECK_NOT" "$OS" "$TOOLSTATE_FILE" "_data/latest.json" changed; then
99101
echo 'Toolstate is not changed. Not updating.'
100102
else
101-
if [ $SIX_WEEK_CYCLE -eq 5 ]; then
103+
if [ $SIX_WEEK_CYCLE -ge 35 ]; then
102104
python2.7 "$CHECK_NOT" "$OS" "$TOOLSTATE_FILE" "_data/latest.json" regressed
103105
fi
104106
sed -i "1 a\\

0 commit comments

Comments
 (0)