From b41ee6995c3722a2953e106585f75d52d737beae Mon Sep 17 00:00:00 2001 From: bong-water-water-bong Date: Tue, 10 Nov 2026 21:01:56 -0400 Subject: [PATCH 1/2] bump-hrx: the failure report reads the log, so the issue names the step and the conflict (engine#1945) --- CMakeLists.txt | 6 ++ scripts/bump-hrx-report.sh | 128 ++++++++++++++++++++++++++++++++++ tests/bump_hrx_report_test.sh | 113 ++++++++++++++++++++++++++++++ 3 files changed, 247 insertions(+) create mode 100755 scripts/bump-hrx-report.sh create mode 100755 tests/bump_hrx_report_test.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index a0b3ce73b..d37f2a941 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -200,6 +200,12 @@ add_test(NAME serve_hangup COMMAND ${CMAKE_SOURCE_DIR}/tests/serve_hangup_test.s # engine#1945: scripts/bump-hrx-sync.sh tells AMD's own commit from a line AMD rebased apart from a commit that # is not AMD's. Local git repositories only: no network, no GPU. add_test(NAME bump_hrx_sync COMMAND bash ${CMAKE_SOURCE_DIR}/tests/bump_hrx_sync_test.sh ${CMAKE_SOURCE_DIR}/scripts/bump-hrx-sync.sh) +# engine#1945: the body `bump-hrx` files when a scheduled sync fails -- the step name, the conflicting paths +# the log names, and the remedy. Fixture logs only: no network, no git. +add_test(NAME bump_hrx_report COMMAND bash ${CMAKE_SOURCE_DIR}/tests/bump_hrx_report_test.sh) +# engine#1945: the body `bump-hrx` files when a scheduled sync fails -- the step name, the conflicting paths +# the log names, and the remedy. Fixture logs only: no network, no git. +add_test(NAME bump_hrx_report COMMAND bash ${CMAKE_SOURCE_DIR}/tests/bump_hrx_report_test.sh) add_test(NAME metrics_serve COMMAND ${CMAKE_SOURCE_DIR}/tests/metrics_serve.sh $) # serve --print-backend: the llama-server Lemonade starts itself, one hop (docs/serve.md): no GPU. add_test(NAME print_backend COMMAND ${CMAKE_SOURCE_DIR}/tests/print_backend.sh $) diff --git a/scripts/bump-hrx-report.sh b/scripts/bump-hrx-report.sh new file mode 100755 index 000000000..b5829ebb4 --- /dev/null +++ b/scripts/bump-hrx-report.sh @@ -0,0 +1,128 @@ +#!/usr/bin/env bash +# Copyright 2026 bong-water-water-bong +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# The body of the issue `bump-hrx` files when a scheduled sync fails (engine#1945). +# +# The workflow already notices a failure and files one issue per episode (#332, #350, #372, #388, #406, +# #628, #1945). What it cannot do inline is *read the log*: the body it posts today says "Look at the +# sync steps", so the person who opens the issue starts by opening a run page and scrolling. This +# script turns the failing step's log into the three things that step actually needs — which step +# failed, which files are in conflict (the log names them), and what to do about it. +# +# scripts/bump-hrx-report.sh --run-id 42839424667 [--repo OWNER/REPO] [--log FILE] [--step NAME] +# +# --log defaults to stdin; --step defaults to the step named in the log's own `##[error]` context. The +# body goes to stdout, so the caller decides whether it becomes an issue or a comment. +# +# Exit: 0 the body was produced; 2 the log named no failing step (a report about nothing is worse than +# no report: the caller then posts the workflow's plain body rather than a confident-looking empty one). + +set -uo pipefail + +run_id="" +repo="${GITHUB_REPOSITORY:-1bit-MONSTER/engine}" +log="" +step="" + +while [ $# -gt 0 ]; do + case "$1" in + --run-id) run_id="${2:-}"; shift 2 ;; + --repo) repo="${2:-}"; shift 2 ;; + --log) log="${2:-}"; shift 2 ;; + --step) step="${2:-}"; shift 2 ;; + -h|--help) sed -n '19,33p' "$0" | sed 's/^# \{0,1\}//'; exit 0 ;; + *) printf 'bump-hrx-report: unknown argument: %s\n' "$1" >&2; exit 2 ;; + esac +done + +text="" +if [ -n "$log" ]; then + [ -r "$log" ] || { printf 'bump-hrx-report: cannot read %s\n' "$log" >&2; exit 2; } + text=$(cat -- "$log") +else + text=$(cat) +fi + +# The step name, in the order GitHub prints it: the `##[group]Run …`/`##[error]` wrapper first, then a bare +# banner, then a `Run