Skip to content

Commit a4433c2

Browse files
authored
fix(ci3): accept slashes in /list/<path:key> for merge-train history (#23160)
## Summary Test logs print a **History** link like `…/list/history_<hash>_<TARGET_BRANCH>`. For `TARGET_BRANCH=merge-train/spartan` the URL contains a `/`, and Flask's default `/list/<key>` converter only matches a single path segment, so the link 404s. Percent-encoding (`%2F`) doesn't help: WSGI (gunicorn) URL-decodes `PATH_INFO` per PEP 3333, so by the time Werkzeug routes the request, the `%2F` is already a `/`. Fix: change the route to `/list/<path:key>`, which matches slashes. This makes the existing history links work — and recovers all data already written to Redis under keys like `history_<hash>_merge-train/spartan` (history tracking for `merge-train/*` is already enabled by the existing condition in `ci3/run_test_cmd`). This commit reverts the earlier producer-side sanitization in `ci3/run_test_cmd` / `ci3/exec_test`. Doing it in the producer would leave existing entries orphaned under the old slash keys; the dashboard-side fix avoids the split. Note: dashboard changes ship via `ci3/dashboard/deploy.sh` (manual rsync + `systemctl restart rkapp`). Reproducer: http://ci.aztec-labs.com/54e749c45512a629 → click **History**. Background: https://gist.github.com/AztecBot/33fcdd84eba7b273d3f67dfd2ad6be8f ## Test plan - [ ] After `ci3/dashboard/deploy.sh`, the History link on a test run on a `merge-train/*` PR resolves to the existing list. - [ ] Existing `/list/<key>` URLs without slashes (e.g. `…_next`, `…_v4`) continue to work.
1 parent 01f196a commit a4433c2

1 file changed

Lines changed: 5 additions & 1 deletion

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)

0 commit comments

Comments
 (0)