From 54948e410871c345b8fa25774f3ec78a50170907 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=20Bol=C3=ADvar?= Date: Wed, 11 May 2022 01:10:03 -0700 Subject: [PATCH] .github: add workflows/bug_snapshot.yaml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This creates a new GitHub workflow that snapshots open bugs in a compressed format that is convenient to extract for later analysis in a Python script, using scripts/make_bugs_pickle.py. The workflow is only run on demand. This allows us to run it during the weekly release readiness meeting, right after we have finished the initial bug triage for the week. That ensures that results are as fresh and relevant as possible. The resulting file is uploaded to S3; with the goal of enabling later tracking and analysis. Getting the analysis scripts themselves merged into Zephyr is left for future work. This commit just allows us to get the data. Co-authored-by: Stephanos Ioannidis Signed-off-by: Martí Bolívar Signed-off-by: Stephanos Ioannidis --- .github/workflows/bug_snapshot.yaml | 57 +++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/bug_snapshot.yaml diff --git a/.github/workflows/bug_snapshot.yaml b/.github/workflows/bug_snapshot.yaml new file mode 100644 index 00000000000000..93ae09231b8475 --- /dev/null +++ b/.github/workflows/bug_snapshot.yaml @@ -0,0 +1,57 @@ +# Copyright (c) 2021, 2022 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +# Make a snapshot of open bugs as a python pickle file, compressed +# using xz. Upload the xz file to Amazon S3. + +name: Bug Snapshot + +on: + workflow_dispatch: + branches: [ main ] + +jobs: + make_bugs_pickle: + name: Make bugs pickle + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install Python dependencies + run: | + sudo pip3 install -U setuptools wheel pip + pip3 install -U pygithub + + - name: Snapshot bugs + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + BUGS_PICKLE_FILENAME="zephyr-bugs-$(date -I).pickle.xz" + BUGS_PICKLE_PATH="${RUNNER_TEMP}/${BUGS_PICKLE_FILENAME}" + + set -euo pipefail + python3 scripts/make_bugs_pickle.py | xz > ${BUGS_PICKLE_PATH} + + echo "BUGS_PICKLE_FILENAME=${BUGS_PICKLE_FILENAME}" >> ${GITHUB_ENV} + echo "BUGS_PICKLE_PATH=${BUGS_PICKLE_PATH}" >> ${GITHUB_ENV} + + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_BUILDS_ZEPHYR_BUG_SNAPSHOT_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_BUILDS_ZEPHYR_BUG_SNAPSHOT_SECRET_ACCESS_KEY }} + aws-region: us-east-1 + + - name: Upload to AWS S3 + run: | + PUBLISH_BUCKET="builds.zephyrproject.org" + PUBLISH_DOMAIN="builds.zephyrproject.io" + PUBLISH_ROOT="${{ github.event.repository.name }}/bug-snapshot" + + PUBLISH_UPLOAD_URI="s3://${PUBLISH_BUCKET}/${PUBLISH_ROOT}/${BUGS_PICKLE_FILENAME}" + PUBLISH_DOWNLOAD_URI="https://${PUBLISH_DOMAIN}/${PUBLISH_ROOT}/${BUGS_PICKLE_FILENAME}" + + aws s3 cp --quiet ${BUGS_PICKLE_PATH} ${PUBLISH_UPLOAD_URI} + echo "Bug pickle is available at: ${PUBLISH_DOWNLOAD_URI}" >> ${GITHUB_STEP_SUMMARY}