Skip to content

Commit 3114880

Browse files
committed
fix(ci3): accept slashes in /list/<path:key> for merge-train history
1 parent a0df470 commit 3114880

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

ci3/dashboard/rk.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,11 @@ def show_section(section):
403403
follow='top'
404404
)
405405

406-
@app.route('/list/<key>')
406+
# <path:key> (not <key>) so branch-qualified history keys like
407+
# `history_<hash>_merge-train/spartan` route correctly. WSGI decodes %2F to /
408+
# in PATH_INFO before Flask routes, so percent-encoding can't rescue a plain
409+
# <key> converter — only <path:key> matches segments containing /.
410+
@app.route('/list/<path:key>')
407411
@optional_auth
408412
def get_list(key):
409413
value = get_list_as_string(key)

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: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,10 +236,8 @@ 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.
241239
function track_test_history {
242-
track_test "history_${test_hash}${TARGET_BRANCH:+_${TARGET_BRANCH//\//_}}" "$1" ${2:-}
240+
track_test "history_${test_hash}${TARGET_BRANCH:+_$TARGET_BRANCH}" "$1" ${2:-}
243241
}
244242

245243
function track_test_failed {

0 commit comments

Comments
 (0)