Report each failure against master and against the branch point - #1178
Merged
Conversation
cfsmp3
requested review from
canihavesomecoffee and
thealphadollar
as code owners
August 16, 2026 01:37
…oint A verdict says a test does not match the approved output. It does not say who made that true, and for a reviewer that is the only interesting part. The comment answered it by asking whether the test last passed in the newest master run, which charges a branch for everything master did while the branch was open -- a three-line change to file_functions.c was reported as breaking 45 tests it never touched. Each failure is now described against two references as well as the approved output: the tip of master, and the newest completed run for the closest ancestor commit the branch actually descends from. Where both sides fail, the recorded hashes separate "fails identically" -- unchanged behaviour measured against a baseline that has gone stale -- from "fails differently", where something moved even though the verdict did not. Pass and fail are untouched and still decided against the approved output alone. A comparison explains a failure; it never excuses one, because a baseline that stopped describing reality is a thing to fix rather than a thing to pass. A reference we have no run for is reported as such rather than as agreement. The verdict per test is taken from get_test_results, which already accounts for exit codes, absent outputs, and the alternative hashes an output may legitimately produce. Deciding that again here would have created a second definition of "passed", free to drift from the first.
cfsmp3
force-pushed
the
feat/pr-comment-three-way
branch
from
August 16, 2026 05:48
a1d717f to
2e7ddbb
Compare
|
canihavesomecoffee
approved these changes
Aug 17, 2026
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.



Builds on #1175. That PR makes the verdict trustworthy; this one makes it readable, which is the half a reviewer actually consumes.
What a reviewer needs that the verdict cannot give
A verdict says a test does not match the approved output. It cannot say who made that true — and that is the only part a reviewer needs.
The comment tried to answer it by checking whether each test last passed in the newest master run:
Two problems. The newest master run is not where the branch was cut from, so a branch is charged for everything master did while it was open. And the classification rests on a
last_passed_on_<platform>column, which the alternating baseline of #1173 keeps setting on runs that only "passed" by comparing against themselves.The result: ccextractor PR #2322, whose whole diff was in
file_buffer.h, was reported as breaking 45 tests — teletext, Options, DVB — that master fails too.What this does
Each failure is described against two references as well as the approved output:
Where both sides fail, the recorded hashes split the two cases that matter:
A reference with no completed run is reported as no reference, never as agreement.
The ancestor is resolved by walking back from the PR's base (
ANCESTOR_SEARCH_DEPTH = 50, one API page) to the newest completed run on the same platform. Any GitHub failure degrades to "no ancestor" — one missing comparison beats no comment.Pass/fail is untouched
Still decided against the approved output alone;
comment_prreturns SUCCESS/FAILURE from that and nothing else. A comparison explains a failure, it never excuses one — a baseline that stopped describing reality is a thing to fix, not a thing to pass.Notes
The per-test verdict is taken from
get_test_results, which already handles exit codes, absent outputs, and the alternative hashes an output may legitimately produce (multiple_files). Re-deriving it in the comparison would have created a second definition of "passed", free to drift from the first —test_the_platform_verdict_is_taken_as_givenpins that.Also removes a loop that shadowed
get_info_for_pr_comment's owntestparameter with each entry it iterated.Testing
720 tests, OK (18 new). isort, pycodestyle, pydocstyle, dodgy clean; mypy back to master's single pre-existing
yamlstub error.tests/test_ci/test_comparison.py— 14 tests over the pure logic, including the case this exists for: 45 tests failing identically to the reference must read as not this changetest_comment_pr_gives_the_report_a_repository_to_walk— I built the report before opening the GitHub client at first, which silently dropped the ancestor comparison in production while every test still passed, because the fixtures have no ancestor run either way. Verified this test fails when the hand-off is reverted.passedappeared somewhere in the comment, which the failure copy also contained — it would have held whatever the comment said. It now asserts the verdict and the returned status.Sequencing
Independent of #1175 textually, but they are worth landing together: while the baseline alternates, the per-test verdicts feeding these comparisons are themselves unstable, and a comparison built on unstable verdicts inherits the noise.