Two independent reviews landed on the same gap: logging is bare console.log/warn/error with ad-hoc prefixes ([Stale Bot], GitHub API call failed...), and the correlation id GitHub hands us for free — the X-GitHub-Delivery header — is never read.
Proposal: one log(level, event, fields) helper emitting a single JSON object per line, which Cloudflare indexes:
{ "level": "warn", "event": "github_api_retry", "delivery": "8ad0...",
"repo": "openwrt/packages", "pr": 1234, "installation": 456,
"method": "GET", "endpoint": "/repos/.../commits", "status": 503,
"attempt": 2, "budget_used": 31, "deploy": "d8f0c4e" }
Worth carrying on every line: delivery id, event/action, repo, PR or issue number, installation id, head SHA, and for API calls the operation, attempt, status and remaining budget. That turns "why did this PR behave oddly" into one filter on delivery=... covering the whole lifecycle — token, config, commits, validators, labels, comment, check-runs.
Not urgent, but it is the difference between reading logs and grepping them.
Two independent reviews landed on the same gap: logging is bare
console.log/warn/errorwith ad-hoc prefixes ([Stale Bot],GitHub API call failed...), and the correlation id GitHub hands us for free — theX-GitHub-Deliveryheader — is never read.Proposal: one
log(level, event, fields)helper emitting a single JSON object per line, which Cloudflare indexes:{ "level": "warn", "event": "github_api_retry", "delivery": "8ad0...", "repo": "openwrt/packages", "pr": 1234, "installation": 456, "method": "GET", "endpoint": "/repos/.../commits", "status": 503, "attempt": 2, "budget_used": 31, "deploy": "d8f0c4e" }Worth carrying on every line: delivery id, event/action, repo, PR or issue number, installation id, head SHA, and for API calls the operation, attempt, status and remaining budget. That turns "why did this PR behave oddly" into one filter on
delivery=...covering the whole lifecycle — token, config, commits, validators, labels, comment, check-runs.Not urgent, but it is the difference between reading logs and grepping them.