You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Log start and end of repochecker checks with user, repo and time needed - #216
Users get 504 responses from /api/repochecker/ while the server logs look fine. The nginx proxy log shows upstream timed out ... while reading response header from upstream, which means a check took longer than the proxy's read timeout (60s by default). Until now the backend didn't log when a check started or how long it took, so this couldn't be seen from the server side.
Changes
Each check gets an id and logs these lines:
Repochecker #12 by someuser for "https://github.com/owner/ioBroker.x" requested (running: 1, queued: 0)
Repochecker #12 by someuser for "https://github.com/owner/ioBroker.x" started after 8.3s in queue
Repochecker #12 by someuser for "https://github.com/owner/ioBroker.x" finished with status 200 (2 errors, 5 warnings), time needed 71.9s (queued 8.3s, checking 63.6s)
If the check throws, the last line is ... failed, time needed Xs instead. The error itself and the token are still never logged.
If the client or the proxy closes the connection before the result is sent, which is what happens on a proxy timeout, a warning is logged: ... connection closed by client or proxy after 60.0s, before the result was sent.
The user name comes from the existing getGitHubLogin in api/user.ts, which is now exported. It caches the token-to-login lookup for an hour. If the lookup fails, the log shows unknown and the check still runs.
The branch is added to the log when it's given. URL and branch are JSON-quoted, so a crafted query string can't inject fake log lines.
Tests
npm test in express/backend: 8/8 pass. The new tests cover the requested, started and finished lines and the warning when the connection is closed early. The existing tests now use a mocked login lookup, so they make no GitHub requests.
Each check gets an id and logs when it is requested (user, repository,
branch, queue state), when it starts running (time spent queued) and
when it finishes or fails (result, total time, queued vs. checking
time). A warning is logged when the client or a proxy closes the
connection before the result is sent, e.g. on a proxy timeout (504).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BSR3invYVCrhJk7Swpp9qn
The login lookup was awaited before the request entered the queue, so
concurrent requests with uncached logins could all pass the capacity
check, a disconnect during the lookup was missed, and lookup time was
reported as queue time. The lookup now runs in parallel and the log
lines are chained on it, with times taken when each event happens.
Also use singular labels for counts of one.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BSR3invYVCrhJk7Swpp9qn
Queue telemetry snapshot omits the newly admitted request
express/backend/src/api/repochecker.ts:119
The queue snapshot excludes the request being logged because it is captured before withCheckSlot() increments runningChecks or appends to waitingChecks. Consequently, the first accepted check reports running: 0, queued: 0, and every queued check under-reports the queue by one, contradicting the advertised telemetry and making the capacity logs misleading. Include the newly admitted request in this snapshot.
🧠 Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Users get
504responses from/api/repochecker/while the server logs look fine. The nginx proxy log showsupstream timed out ... while reading response header from upstream, which means a check took longer than the proxy's read timeout (60s by default). Until now the backend didn't log when a check started or how long it took, so this couldn't be seen from the server side.Changes
Each check gets an id and logs these lines:
... failed, time needed Xsinstead. The error itself and the token are still never logged.... connection closed by client or proxy after 60.0s, before the result was sent.getGitHubLogininapi/user.ts, which is now exported. It caches the token-to-login lookup for an hour. If the lookup fails, the log showsunknownand the check still runs.Tests
npm testinexpress/backend: 8/8 pass. The new tests cover the requested, started and finished lines and the warning when the connection is closed early. The existing tests now use a mocked login lookup, so they make no GitHub requests.🤖 Generated with Claude Code
https://claude.ai/code/session_01BSR3invYVCrhJk7Swpp9qn
Generated by Claude Code