From a0c8445606ed53f1daefc6b9d61dda2e336ae12a Mon Sep 17 00:00:00 2001 From: AztecBot Date: Mon, 11 May 2026 18:02:40 +0000 Subject: [PATCH 1/2] fix(ci3): sanitize slash in TARGET_BRANCH for test history URL --- ci3/exec_test | 2 +- ci3/run_test_cmd | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ci3/exec_test b/ci3/exec_test index a04bd456403f..eb8605b28b83 100755 --- a/ci3/exec_test +++ b/ci3/exec_test @@ -36,7 +36,7 @@ Env: REF_NAME=${REF_NAME:-} CURRENT_VERSION=${CURRENT_VERSION:-} CI_FULL=${CI_FU Date: $(date) System: ARCH=$(arch) CPUS=$(nproc --all) MEM=$(free -h | awk '/^Mem:/{print $2}') HOSTNAME=$(hostname) Resources: CPU_LIST=$CPU_LIST CPUS=$CPUS MEM=$MEM TIMEOUT=$TIMEOUT -History: $DASHBOARD_URL/list/history_$test_hash${TARGET_BRANCH:+_$TARGET_BRANCH} +History: $DASHBOARD_URL/list/history_$test_hash${TARGET_BRANCH:+_${TARGET_BRANCH//\//_}} EOF diff --git a/ci3/run_test_cmd b/ci3/run_test_cmd index 2a9bd3fe8fa3..1f8c4cd4ad50 100755 --- a/ci3/run_test_cmd +++ b/ci3/run_test_cmd @@ -236,8 +236,10 @@ function track_test { redis_cli LTRIM $list_key 0 $max_lines &>/dev/null } +# Slashes in TARGET_BRANCH (e.g. merge-train/spartan) are replaced with underscores +# so the key is safe to embed in the /list/ dashboard URL. function track_test_history { - track_test "history_${test_hash}${TARGET_BRANCH:+_$TARGET_BRANCH}" "$1" ${2:-} + track_test "history_${test_hash}${TARGET_BRANCH:+_${TARGET_BRANCH//\//_}}" "$1" ${2:-} } function track_test_failed { From 09100c6bd0b214ac2c96be95c4ec376ad005618b Mon Sep 17 00:00:00 2001 From: AztecBot Date: Mon, 11 May 2026 18:30:08 +0000 Subject: [PATCH 2/2] fix(ci3): accept slashes in /list/<path:key> for merge-train history --- ci3/dashboard/rk.py | 6 +++++- ci3/exec_test | 2 +- ci3/run_test_cmd | 4 +--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ci3/dashboard/rk.py b/ci3/dashboard/rk.py index 5cd6dbfb0693..ac1f40e3f50d 100644 --- a/ci3/dashboard/rk.py +++ b/ci3/dashboard/rk.py @@ -403,7 +403,11 @@ def show_section(section): follow='top' ) -@app.route('/list/') +# (not ) so branch-qualified history keys like +# `history__merge-train/spartan` route correctly. WSGI decodes %2F to / +# in PATH_INFO before Flask routes, so percent-encoding can't rescue a plain +# converter — only matches segments containing /. +@app.route('/list/') @optional_auth def get_list(key): value = get_list_as_string(key) diff --git a/ci3/exec_test b/ci3/exec_test index eb8605b28b83..a04bd456403f 100755 --- a/ci3/exec_test +++ b/ci3/exec_test @@ -36,7 +36,7 @@ Env: REF_NAME=${REF_NAME:-} CURRENT_VERSION=${CURRENT_VERSION:-} CI_FULL=${CI_FU Date: $(date) System: ARCH=$(arch) CPUS=$(nproc --all) MEM=$(free -h | awk '/^Mem:/{print $2}') HOSTNAME=$(hostname) Resources: CPU_LIST=$CPU_LIST CPUS=$CPUS MEM=$MEM TIMEOUT=$TIMEOUT -History: $DASHBOARD_URL/list/history_$test_hash${TARGET_BRANCH:+_${TARGET_BRANCH//\//_}} +History: $DASHBOARD_URL/list/history_$test_hash${TARGET_BRANCH:+_$TARGET_BRANCH} EOF diff --git a/ci3/run_test_cmd b/ci3/run_test_cmd index 1f8c4cd4ad50..2a9bd3fe8fa3 100755 --- a/ci3/run_test_cmd +++ b/ci3/run_test_cmd @@ -236,10 +236,8 @@ function track_test { redis_cli LTRIM $list_key 0 $max_lines &>/dev/null } -# Slashes in TARGET_BRANCH (e.g. merge-train/spartan) are replaced with underscores -# so the key is safe to embed in the /list/ dashboard URL. function track_test_history { - track_test "history_${test_hash}${TARGET_BRANCH:+_${TARGET_BRANCH//\//_}}" "$1" ${2:-} + track_test "history_${test_hash}${TARGET_BRANCH:+_$TARGET_BRANCH}" "$1" ${2:-} } function track_test_failed {