Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kennytm committed Aug 1, 2018
1 parent e94df4a commit 0da7da8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/ci/docker/x86_64-gnu-tools/checktools.sh
Expand Up @@ -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"

Expand Down Expand Up @@ -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\\
Expand Down

0 comments on commit 0da7da8

Please sign in to comment.