]> git.kaiwu.me - haproxy.git/commit
DEV: patchbot: update: return the stored overlay as JSON on GET
authorWilly Tarreau <w@1wt.eu>
Mon, 6 Jul 2026 21:12:22 +0000 (23:12 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 7 Jul 2026 12:45:32 +0000 (14:45 +0200)
commit13d465a61a502789766e856dedb52b512de33eb1
tree1629438cca0d5e0a5ee5482b3c6d88e253250c9e
parentb232b554f22deceff490dd789a132c9da17e65a9
DEV: patchbot: update: return the stored overlay as JSON on GET

This adds the read side of the review persistence CGI: GET
update.cgi?branch=X.Y now returns the current overlay for that branch
as a JSON array of {"cid", "state", "notes"} objects with absent fields
omitted; a missing or empty file yields "[]". The raw storage format
never travels: the notes are unescaped by the parser and JSON-escaped
on output, so the client can JSON.parse() the response and insert the
notes via textContent directly. Unparseable lines or fields are
silently skipped as everywhere else.

Reads are lockless: the atomic rename on the write side guarantees
that the file is always a complete valid version. The response carries
Cache-Control: no-store so that a browser never reuses a stale overlay
on refresh.
dev/patchbot/cgi/update.awk