Auto merge of #3376 - saethlin:sysroots-notification, r=saethlin

Improve sysroots notification

* Removes the T-miri ping (because these failures can't be acted on quickly, ergo they cannot be urgent)
* Puts the message in a separate Zulip topic
* Lists which targets failed to build in the Zulip message
This commit is contained in:
bors 2024-03-14 00:15:10 +00:00
commit 34d6f07646
2 changed files with 22 additions and 6 deletions

View File

@ -21,6 +21,13 @@ jobs:
./miri install ./miri install
python3 -m pip install beautifulsoup4 python3 -m pip install beautifulsoup4
./ci/build-all-targets.sh ./ci/build-all-targets.sh
- name: Upload build errors
# We don't want to skip this step on failure
if: always()
uses: actions/upload-artifact@v4
with:
name: failures
path: failures.tar.gz
sysroots-cron-fail-notify: sysroots-cron-fail-notify:
name: sysroots cronjob failure notification name: sysroots cronjob failure notification
@ -28,6 +35,11 @@ jobs:
needs: [sysroots] needs: [sysroots]
if: failure() || cancelled() if: failure() || cancelled()
steps: steps:
# Download our build error logs
- name: Download build errors
uses: actions/download-artifact@v4
with:
name: failures
# Send a Zulip notification # Send a Zulip notification
- name: Install zulip-send - name: Install zulip-send
run: pip3 install zulip run: pip3 install zulip
@ -36,11 +48,12 @@ jobs:
ZULIP_BOT_EMAIL: ${{ secrets.ZULIP_BOT_EMAIL }} ZULIP_BOT_EMAIL: ${{ secrets.ZULIP_BOT_EMAIL }}
ZULIP_API_TOKEN: ${{ secrets.ZULIP_API_TOKEN }} ZULIP_API_TOKEN: ${{ secrets.ZULIP_API_TOKEN }}
run: | run: |
tar xf failures.tar.gz
ls failures
~/.local/bin/zulip-send --user $ZULIP_BOT_EMAIL --api-key $ZULIP_API_TOKEN --site https://rust-lang.zulipchat.com \ ~/.local/bin/zulip-send --user $ZULIP_BOT_EMAIL --api-key $ZULIP_API_TOKEN --site https://rust-lang.zulipchat.com \
--stream miri --subject "Cron Job Failure (miri, $(date -u +%Y-%m))" \ --stream miri --subject "Sysroot Build Errors (miri, $(date -u +%Y-%m))" \
--message 'Dear @*T-miri*, --message 'It would appear that the [Miri sysroots cron job build]('"https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"') failed to build these targets:
$(ls failures)
It would appear that the [Miri sysroots cron job build]('"https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"') failed.
Would you mind investigating this issue? Would you mind investigating this issue?

View File

@ -3,6 +3,7 @@
set -eu set -eu
set -o pipefail set -o pipefail
# .github/workflows/sysroots.yml relies on this name this to report which sysroots didn't build
FAILS_DIR=failures FAILS_DIR=failures
rm -rf $FAILS_DIR rm -rf $FAILS_DIR
@ -13,14 +14,16 @@ PLATFORM_SUPPORT_FILE=$(rustc +miri --print sysroot)/share/doc/rust/html/rustc/p
for target in $(python3 ci/scrape-targets.py $PLATFORM_SUPPORT_FILE); do for target in $(python3 ci/scrape-targets.py $PLATFORM_SUPPORT_FILE); do
# Wipe the cache before every build to minimize disk usage # Wipe the cache before every build to minimize disk usage
cargo +miri miri clean cargo +miri miri clean
if cargo +miri miri setup --target $target 2>&1 | tee failures/$target; then if cargo +miri miri setup --target $target 2>&1 | tee $FAILS_DIR/$target; then
# If the build succeeds, delete its output. If we have output, a build failed. # If the build succeeds, delete its output. If we have output, a build failed.
rm $FAILS_DIR/$target rm $FAILS_DIR/$target
fi fi
done done
tar czf $FAILS_DIR.tar.gz $FAILS_DIR
# If the sysroot for any target fails to build, we will have a file in FAILS_DIR. # If the sysroot for any target fails to build, we will have a file in FAILS_DIR.
if [[ $(ls failures | wc -l) -ne 0 ]]; then if [[ $(ls $FAILS_DIR | wc -l) -ne 0 ]]; then
echo "Sysroots for the following targets failed to build:" echo "Sysroots for the following targets failed to build:"
ls $FAILS_DIR ls $FAILS_DIR
exit 1 exit 1