fix: the harness says what it is doing while it does it - #130
Merged
Conversation
Nothing called `logging.basicConfig`, so every `log.info` and `log.warning` in the package went to a root logger with no handler and was discarded -- including the lines written specifically to explain a lost claim, a drained project, or a result that had to be thrown away. `run` made it worse by printing a header and then nothing until an item finished. A real run against a live endpoint sat silent for four minutes; the event stream, which nobody was tailing, said `reviewer error HTTP 504` and then `retry_wait waiting 209.9s`. That backoff is correct behaviour and it is indistinguishable from a wedged process, so the natural response is to kill a run that was working. Configure logging once in `main()`, behind `--log-level` (default info, because this process spends money unattended and silence is not a safe default for that), and mirror every stage transition to it. The events file stays the record; the terminal now gets a line a human can follow. Also make `--repo` optional for `run` when `--no-push` is set: with nothing to push there is nothing to open a pull request against, and requiring a repo meant inventing one to work locally.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #129.
Found by running the harness end to end for the first time, locally, against a
real endpoint — no container, no session host, no GitHub.
logging.basicConfigwas never called anywhere in the package, so everylog.infoandlog.warningwent to a root logger with no handler and wasdiscarded. That includes the lines written specifically to explain unusual
behaviour:
started %d worker(s),drained project %s,lease: could not beat for %s,release: … result was discarded.runcompounded it by printing a header and then nothing until the itemfinished. The run that prompted this sat silent for four minutes. The event
stream — the only place anything was recorded — said:
A 210-second backoff after a gateway error is correct. It is also
indistinguishable from a wedged process, and the natural response to a command
that has printed nothing for four minutes is to kill it — which throws away an
item mid-flight.
Changes
--log-level(or$HARNESS_LOG_LEVEL), configured once inmain().Defaults to
info: this process spends money unattended, and silence is nota safe default for that.
runmirrors every stage transition to the log as it happens. The eventsfile is still the record; the terminal now gets a line a human can follow.
--repois optional forrunwhen--no-pushis set. With nothing to pushthere is nothing to open a pull request against, and requiring it meant
inventing a repo name to work locally. Refuses clearly when a push is
actually wanted and no repo was given.
Gates: 548 tests, ruff,
mypy .all green.