eBPF-based security platform
ci: file main failures under the area/ci/main label
Martynas Pumputis0d7e51bcddd9
diff --git a/.github/scripts/main-status.sh b/.github/scripts/main-status.shindex a6d57139..a8b6de38 100755--- a/.github/scripts/main-status.sh+++ b/.github/scripts/main-status.sh@@ -2,8 +2,8 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# .github/scripts/main-status.sh -- keep an issue open, labelled ci-main,-# while a workflow fails on main: open it, or add the run to it, when the+# .github/scripts/main-status.sh -- keep an issue open, labelled+# area/ci/main, while a workflow fails on main: open it, or add the run to it, when the# workflow's newest finished push run on main failed, and close it when# that run passed.#@@ -15,7 +15,8 @@set -eurepo=repos/$GITHUB_REPOSITORY-label=ci-main+label=area/ci/main+label_path=$(printf '%s' "$label" | sed 's|/|%2F|g')TITLE="main: $WORKFLOW_NAME fails"export TITLE@@ -45,10 +46,10 @@ reported() {# Another workflow's run can create the label first.ensure_label() {- gh api "$repo/labels/$label" --silent 2>/dev/null ||- gh api -X POST "$repo/labels" -f name="$label" -f color=d73a4a \- -f description='A workflow fails on main' --silent ||- gh api "$repo/labels/$label" --silent+ gh api "$repo/labels/$label_path" --silent 2>/dev/null ||+ gh api -X POST "$repo/labels" -f name="$label" -f color=e7878f \+ -f description='CI issues on main branch' --silent ||+ gh api "$repo/labels/$label_path" --silent}report_failure() {diff --git a/.github/workflows/main-status.yml b/.github/workflows/main-status.ymlindex 16ccea3e..ac6ff231 100644--- a/.github/workflows/main-status.yml+++ b/.github/workflows/main-status.yml@@ -1,8 +1,8 @@name: Main status# The merge queue, not a person, starts the runs on main, so GitHub tells-# no one when one fails. Keep an issue open, labelled ci-main, for each-# workflow failing on main until it passes there again. The list names+# no one when one fails. Keep an issue open, labelled area/ci/main, for+# each workflow failing on main until it passes there again. The list names# every workflow that runs on a push to main.on:workflow_run:diff --git a/Documentation/contribute/testing/testing.rst b/Documentation/contribute/testing/testing.rstindex c15a6e82..cd2fbf28 100644--- a/Documentation/contribute/testing/testing.rst+++ b/Documentation/contribute/testing/testing.rst@@ -100,8 +100,8 @@ kernel.The merge queue starts the runs on ``main``, so GitHub tells no one whenone fails. The ``Main status`` workflow opens an issue labelled-``ci-main`` instead, ``main: <workflow> fails``, with the commit, the run-and the jobs that failed. A later failure on ``main`` adds its run to the+``area/ci/main`` instead, ``main: <workflow> fails``, with the commit,+the run and the jobs that failed. A later failure on ``main`` adds its run to theissue, and the workflow's next pass there closes it... raw:: htmldiff --git a/testing/ci-checks/t0011-main-status.sh b/testing/ci-checks/t0011-main-status.shindex 86e7b2d5..f5e21b5d 100755--- a/testing/ci-checks/t0011-main-status.sh+++ b/testing/ci-checks/t0011-main-status.sh@@ -40,7 +40,7 @@ repos/o/r/actions/runs/*/jobs\?*) file=jobs ;;repos/o/r/issues\?*) file=issues ;;repos/o/r/issues/*/comments) file=comments ;;repos/o/r/issues/*) file=issue ;;-repos/o/r/labels/ci-main) file=label ;;+repos/o/r/labels/area%2Fci%2Fmain) file=label ;;*) exit 1 ;;esac[ -e "$fixture/$file.json" ] || exit 1@@ -72,7 +72,7 @@ state() {printf '%s\n' "$4" >"$fixture/comments.json"printf '{"jobs":[{"name":"CI functional tests (shard 1)","conclusion":"failure"},{"name":"CI unit tests","conclusion":"success"}]}\n' \>"$fixture/jobs.json"- printf '{"name":"ci-main"}\n' >"$fixture/label.json"+ printf '{"name":"area/ci/main"}\n' >"$fixture/label.json"}report() {@@ -93,8 +93,8 @@ test_expect_success 'a failure opens an issue with the commit, the run and the fstate "$(runs 12:failure)" "[]" "" "[]" &&rm "$fixture/label.json" &&report &&- grep -Fx "POST repos/o/r/labels name=ci-main color=d73a4a description=A workflow fails on main" "$fixture/writes" &&- grep -F "POST repos/o/r/issues title=main: CI suite fails labels[]=ci-main body=" "$fixture/writes" &&+ grep -Fx "POST repos/o/r/labels name=area/ci/main color=e7878f description=CI issues on main branch" "$fixture/writes" &&+ grep -F "POST repos/o/r/issues title=main: CI suite fails labels[]=area/ci/main body=" "$fixture/writes" &&grep -F "fails on main at sha12: $url/12" "$fixture/writes" &&grep -F "Failed jobs: CI functional tests (shard 1)" "$fixture/writes" &&! grep -F "CI unit tests" "$fixture/writes"