about summary refs log tree commit diff
path: root/src/ci/docker/x86_64-gnu-tools
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2018-08-01 18:03:19 +0800
committerkennytm <kennytm@gmail.com>2018-08-01 18:03:19 +0800
commit0da7da8391cfb27a809b3fea7e0f50dd64d018c8 (patch)
treecaf4f096c637cd762096aae1705859ec6b1f80c4 /src/ci/docker/x86_64-gnu-tools
parente94df4acb4c3f42fdc224a7164b63a99240add1e (diff)
downloadrust-0da7da8391cfb27a809b3fea7e0f50dd64d018c8.tar.gz
rust-0da7da8391cfb27a809b3fea7e0f50dd64d018c8.zip
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.
Diffstat (limited to 'src/ci/docker/x86_64-gnu-tools')
-rwxr-xr-xsrc/ci/docker/x86_64-gnu-tools/checktools.sh10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/ci/docker/x86_64-gnu-tools/checktools.sh b/src/ci/docker/x86_64-gnu-tools/checktools.sh
index 16055078ad5..d876cb7f37a 100755
--- a/src/ci/docker/x86_64-gnu-tools/checktools.sh
+++ b/src/ci/docker/x86_64-gnu-tools/checktools.sh
@@ -17,9 +17,11 @@ TOOLSTATE_FILE="$(realpath $2)"
 OS="$3"
 COMMIT="$(git rev-parse HEAD)"
 CHANGED_FILES="$(git diff --name-status HEAD HEAD^)"
-SIX_WEEK_CYCLE="$(( ($(date +%s) / 604800 - 3) % 6 ))"
-# ^ 1970 Jan 1st is a Thursday, and our release dates are also on Thursdays,
-#   thus we could divide by 604800 (7 days in seconds) directly.
+SIX_WEEK_CYCLE="$(( ($(date +%s) / 86400 - 20) % 42 ))"
+# ^ Number of days after the last promotion of beta.
+#   Its value is 41 on the Tuesday where "Promote master to beta (T-2)" happens.
+#   The Wednesday after this has value 0.
+#   We track this value to prevent regressing tools in the last week of the 6-week cycle.
 
 touch "$TOOLSTATE_FILE"
 
@@ -98,7 +100,7 @@ change_toolstate() {
     if python2.7 "$CHECK_NOT" "$OS" "$TOOLSTATE_FILE" "_data/latest.json" changed; then
         echo 'Toolstate is not changed. Not updating.'
     else
-        if [ $SIX_WEEK_CYCLE -eq 5 ]; then
+        if [ $SIX_WEEK_CYCLE -ge 35 ]; then
             python2.7 "$CHECK_NOT" "$OS" "$TOOLSTATE_FILE" "_data/latest.json" regressed
         fi
         sed -i "1 a\\