2.6 KiB
PR#131: Reviews Wait Longer for a Slow Gitea, and hs-review Names the Cause of a Failure
Version: patch
WARNING: This document describes only the change applied in this PR. It may already be outdated once the next PR is merged. Historic PR documentation is not maintained along with new PRs; treat it as a snapshot.
Problem
On 2026-10-20 and 2026-10-22 the TLS handshake of dev.hostsharing.net took 15 to 22 s, once more than 40 s;
TCP connects took 0.04 s, and git.javagil.de shook hands in 0.1 s.
werkrevisor opens a connection per request and gives up after 30 s, tools/review-report after 60 s,
so one slow handshake ended hs-review 342 and hs-review 343 without a result.
hs-review then printed the first line of the error, "werkrevisor: operator config from …",
an info line, instead of the cause "cannot read the PR: … The handshake operation timed out".
Non-Goals
- No retries and no reuse of connections.
Specification
Feature: a slow Gitea ends fewer reviews, and a failure names its cause
Scenario#131.01: the summary of hs-review names the cause of a failure
… so that the human sees why the review did not complete without opening the draft.
- Given a review by
hs-reviewthat fails, e.g. because Gitea does not answer in time - When
hs-reviewshows its summary - Then the summary names the cause of the failure, not a line about the config in use
Verified by
Scenario#131.02: a Gitea request waits 90 s
… so that a TLS handshake of up to a minute does not end the review.
- Given a Gitea client of werkrevisor or of
tools/review-report - When it sends a request
- Then it waits up to 90 s for the answer, before 30 s and 60 s
Verified by
Solution
werkrevisor/gitea.py:TIMEOUT_SECONDS = 90is the default timeout ofGiteaClient, before 30 s. A request that hangs costs at most 90 s; the ai-review build has 15 minutes.werkrevisor/reviewreport.py: its two Gitea clients take that default instead of 60 s.error_textdrops the lines "werkrevisor: operator config from …" and "werkrevisor: config: …" from the stderr of a failed dry run; the summary line ofhs-reviewshows the first line that is left.tests/test_reviewreport.py:ErrorTextTestchecks both scenarios.werkrevisor/__init__.pyandstatistics/build.gradle.kts: version 0.60.1.