Skip to content

Commit a0df470

Browse files
committed
fix(ci3): sanitize slash in TARGET_BRANCH for test history URL
1 parent 4d8791a commit a0df470

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

ci3/exec_test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Env: REF_NAME=${REF_NAME:-} CURRENT_VERSION=${CURRENT_VERSION:-} CI_FULL=${CI_FU
3636
Date: $(date)
3737
System: ARCH=$(arch) CPUS=$(nproc --all) MEM=$(free -h | awk '/^Mem:/{print $2}') HOSTNAME=$(hostname)
3838
Resources: CPU_LIST=$CPU_LIST CPUS=$CPUS MEM=$MEM TIMEOUT=$TIMEOUT
39-
History: $DASHBOARD_URL/list/history_$test_hash${TARGET_BRANCH:+_$TARGET_BRANCH}
39+
History: $DASHBOARD_URL/list/history_$test_hash${TARGET_BRANCH:+_${TARGET_BRANCH//\//_}}
4040
4141
EOF
4242

ci3/run_test_cmd

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,10 @@ function track_test {
236236
redis_cli LTRIM $list_key 0 $max_lines &>/dev/null
237237
}
238238

239+
# Slashes in TARGET_BRANCH (e.g. merge-train/spartan) are replaced with underscores
240+
# so the key is safe to embed in the /list/<key> dashboard URL.
239241
function track_test_history {
240-
track_test "history_${test_hash}${TARGET_BRANCH:+_$TARGET_BRANCH}" "$1" ${2:-}
242+
track_test "history_${test_hash}${TARGET_BRANCH:+_${TARGET_BRANCH//\//_}}" "$1" ${2:-}
241243
}
242244

243245
function track_test_failed {

0 commit comments

Comments
 (0)