From 6096f82435eee1d8607f824548989de0c73f01b6 Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Tue, 1 Oct 2019 19:41:42 -0400 Subject: [PATCH 1/2] Change toolstate to no longer fail on nightly Previously, toolstate would always error the build if the tool regressed (or didn't improve to test-pass). This isn't great for rollups, in particular, as it means we basically can't viably rollup tool updates. In most cases, when trying to land a submodule (tool) change, you mostly want to just bump the sub-commit, and don't care too much if that actually fully fixes the tool. --- src/ci/docker/x86_64-gnu-tools/checktools.sh | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/ci/docker/x86_64-gnu-tools/checktools.sh b/src/ci/docker/x86_64-gnu-tools/checktools.sh index 4243effdf9b4b..53089a499ee76 100755 --- a/src/ci/docker/x86_64-gnu-tools/checktools.sh +++ b/src/ci/docker/x86_64-gnu-tools/checktools.sh @@ -56,7 +56,11 @@ verify_submodule_changed() { echo "If you do NOT intend to update '$1', please ensure you did not accidentally" echo "change the submodule at '$2'. You may ask your reviewer for the" echo "proper steps." - exit 3 + # exit if we're in beta week, otherwise we don't want to, + # it's fine to land changes/regressions to toolstate + if [ $SIX_WEEK_CYCLE -ge 35 ]; then + exit 3 + fi fi fi } @@ -105,21 +109,11 @@ status_check() { status_check "submodule_changed" -CHECK_NOT="$(readlink -f "$(dirname $0)/checkregression.py")" # This callback is called by `commit_toolstate_change`, see `repo.sh`. change_toolstate() { - # only update the history - 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 -ge 35 ]; then - # Reject any regressions during the week before beta cutoff. - python2.7 "$CHECK_NOT" "$OS" "$TOOLSTATE_FILE" "_data/latest.json" regressed - fi - sed -i "1 a\\ + sed -i "1 a\\ $COMMIT\t$(cat "$TOOLSTATE_FILE") " "history/$OS.tsv" - fi } if [ "$RUST_RELEASE_CHANNEL" = nightly ]; then From dbf6ac3ef20fe79b68f279057768e8466d4dd0de Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Tue, 1 Oct 2019 19:46:14 -0400 Subject: [PATCH 2/2] Fail toolstate like before on the PR builder The previous commit changed toolstate to never fail the build (excluding beta week and beta/stable branches). This amends that logic to also fail the PR builder "as if" we were on beta, since a PR author changing a submodule likely does want some indication of failure rather than silent acceptance. Ideally, there'd be some way to provide a "warning" but I don't believe that's possible with current set of checks. --- src/ci/azure-pipelines/pr.yml | 1 + src/ci/docker/x86_64-gnu-tools/checktools.sh | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/ci/azure-pipelines/pr.yml b/src/ci/azure-pipelines/pr.yml index 62e23efe1ef16..bd4ba352fe61b 100644 --- a/src/ci/azure-pipelines/pr.yml +++ b/src/ci/azure-pipelines/pr.yml @@ -32,4 +32,5 @@ jobs: parameters: only_on_updated_submodules: 'yes' variables: + FORCE_FAIL_TOOLSTATE: true IMAGE: x86_64-gnu-tools diff --git a/src/ci/docker/x86_64-gnu-tools/checktools.sh b/src/ci/docker/x86_64-gnu-tools/checktools.sh index 53089a499ee76..1548d85d52b3e 100755 --- a/src/ci/docker/x86_64-gnu-tools/checktools.sh +++ b/src/ci/docker/x86_64-gnu-tools/checktools.sh @@ -61,6 +61,11 @@ verify_submodule_changed() { if [ $SIX_WEEK_CYCLE -ge 35 ]; then exit 3 fi + # we want the PR builder to error out even though the auto branch + # builder will not + if [ -n "$FORCE_FAIL_TOOLSTATE" ]; then + exit 3 + fi fi fi }