Align 6-week cycle check with beta promotion instead of stable release. · rust-lang/rust@0da7da8 (original) (raw)

File tree

1 file changed

lines changed

1 file changed

lines changed

Original file line number Diff line number Diff line change
@@ -17,9 +17,11 @@ TOOLSTATE_FILE="$(realpath $2)"
17 17 OS="$3"
18 18 COMMIT="$(git rev-parse HEAD)"
19 19 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.
23 25
24 26 touch "$TOOLSTATE_FILE"
25 27
@@ -98,7 +100,7 @@ change_toolstate() {
98 100 if python2.7 "$CHECK_NOT" "$OS" "$TOOLSTATE_FILE" "_data/latest.json" changed; then
99 101 echo 'Toolstate is not changed. Not updating.'
100 102 else
101 -if [ $SIX_WEEK_CYCLE -eq 5 ]; then
103 +if [ $SIX_WEEK_CYCLE -ge 35 ]; then
102 104 python2.7 "$CHECK_NOT" "$OS" "$TOOLSTATE_FILE" "_data/latest.json" regressed
103 105 fi
104 106 sed -i "1 a\\