Skip to content

File labelled issues for failing tests and slipping coverage - #49

Merged
MarkRosemaker merged 4 commits into
mainfrom
feat/test-failure-issues
Nov 12, 2026
Merged

MarkRosemaker merged 4 commits into
mainfrom
feat/test-failure-issues

Conversation

@MarkRosemaker

@MarkRosemaker MarkRosemaker commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

A maintained run now opens a GitHub issue on a repository when its tests fail, whether on main or after one of the run's tasks, and when its coverage slips below its floor. Issues are filed through ghrepo's issue methods (ghrepo#5), and ghrepo is bumped to that main.

Labels. Every issue carries devtool, plus one label for what it's about. A repository that lacks a label gets it created, with a colour and description:

Label When
coverage coverage fell below the floor, or a public repository is below its floor
failing on main build or tests fail before any change (broken or flaky)
dependency update breaks build / tests the update dependencies task's change breaks the build ([build failed]) or the tests
devtool breaks build / tests any other task's change (devtool update, go generate, go fix, lint fix, …) breaks the build or the tests

One issue per problem. The body starts with a hidden comment that identifies the problem:

  • for failing tests, a hash of the task (empty for main) and the failing tests (packages where no test is named), leaving out timings and seeds;
  • for coverage, fell or public.

Before filing, devtool looks for an open devtool-labelled issue holding that comment. If it finds one, it updates that issue with the latest output, commit and time instead of filing another.

What an issue holds (internal/run/issue_tests.md.tmpl, issue_coverage.md.tmpl), written for an agent to act on:

  • Failing tests:

    • what broke: main itself, or a task's change that wasn't committed and was discarded;
    • the failing tests, and go test's output with the passing packages left out (gorepo#7);
    • how to reproduce it: a link to main's commit, the Go version, the exact command, the shuffle seed, and make test-race;
    • the task's file and module changes, and any tasks that committed earlier in the run but weren't pushed.

    The title says "Build fails" or "Tests fail", "on main" or after "<task>", then the failing tests.

  • Coverage: the old and new figures and the floor; how to measure (make cover uses the same -coverpkg=./..., and a one-liner lists the least-covered functions); and a warning against tests that execute code without checking anything.

  • Both: read AGENTS.md, pass make ready, and reference the issue with Fixes in the pull request.

Failing to file is logged and never fails the run. GITHUB_TOKEN needs permission to write issues and labels on the maintained repositories.

Checks

  • Tests drive the real engine against a fake repository that keeps issues and labels in memory:
    • tests failing on main over two runs: one issue, refreshed by the second run, labelled devtool and failing on main;
    • devtool breaks tests, and dependency update breaks build, each with its title and change;
    • coverage falling from 85% to 70%;
    • other failures, and success, filing nothing;
    • the identifying comment ignoring timings and seeds.
  • The fake repository answers go version itself. Run for real against a temporary HOME, it downloaded a toolchain and wrote Go telemetry after the test ended, which made cleanup fail now and then. Five clean runs in a row since.
  • docs/architecture.md describes it.
  • make ci passes.

Not in this PR

  • The Telegram failure message doesn't link to the issue. That would need devtool-engine's event stream to carry the issue's address.
  • devtool doesn't close an issue once the problem is gone. The Fixes reference in the fixing PR closes it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01M6xJuQgmRd19QozaQDD3tk

A maintained run now opens an issue on a repository whose tests fail,
on main or after one of its tasks: what failed, the commit, Go version,
command and shuffle seed to reproduce it, the change that broke it, the
commits left unpushed, and how to resolve it, for an agent to pick up.
A fingerprint of repository, task and failing tests, kept in a comment
at the top, stops a later run from filing the same failure twice while
the issue is open.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6xJuQgmRd19QozaQDD3tk
Issues are now filed through ghrepo's issue methods rather than a client
of devtool's own. Each carries the label devtool and one saying what it
is about: coverage, failing on main, dependency update breaks build or
tests, or devtool breaks build or tests, created where a repository
lacks it. Coverage below the floor gets an issue too. The comment that
identifies a failure no longer hashes the repository, which the issue
is on anyway, and a run that finds the issue open refreshes it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6xJuQgmRd19QozaQDD3tk
@MarkRosemaker MarkRosemaker changed the title File an issue when a repository's tests fail File labelled issues for failing tests and slipping coverage Nov 12, 2026
A broken build fails every package that imports the broken one, so the
issue now names the packages go test reports compile errors for, under
their "# package" header, and its title gives them by their path in the
module. lso's build failure, as Telegram reported it, is the test, and
a FAIL line's separator may be a space as well as a tab.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6xJuQgmRd19QozaQDD3tk
@MarkRosemaker
MarkRosemaker merged commit 621c026 into main Nov 12, 2026
1 check passed
@MarkRosemaker
MarkRosemaker deleted the feat/test-failure-issues branch November 12, 2026 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants