Repository navigation
Reply in own open threads to repeats and skip inline on a moved head - #51
Conversation
There was a problem hiding this comment.
This change replies in the App's own open thread when a finding repeats there, and on a moved head it posts no inline comments, gives no approval, and withdraws an approval that raced a push. Nothing blocks: typecheck and tests pass, and I kept all three of gpt-6.1-sol's findings as suggestions (proximity mixing coordinate systems, resolving threads after a withdrawal, a failed withdrawal only logging), plus one of mine on the greedy proximity matching that ignores supersedes_thread_ids.
Non-blocking
- Replies can land in outdated threads, because the proximity pass matches on
originalLinewhenlineis null. GitHub collapses outdated threads, so a repeated finding replied there is easy to miss, and it no longer appears among the unplaced findings in the review body.
Seidroid Review · the review wrote approve · run
|
@seidroid review |
There was a problem hiding this comment.
This change has publish reply inside seidroid's own open thread when a finding repeats there, keep findings off the code and withhold approval once the head has moved, and dismiss an approval if the head moves while it is posted. All four earlier threads are fixed in the code as their replies say, and tsc and npm test pass; I kept gpt-6.1-sol's proximity-only matching point as a non-blocking suggestion, and no other reading contributed.
Seidroid Review · the review wrote approve · run
| const superseded = new Set(findings.flatMap((f) => f.supersedes)); | ||
| pass((f, id, th) => (f.supersedes.includes(id) ? near(f, th) : Infinity)); | ||
| pass((f, id, th) => (!superseded.has(id) && th.detail !== "" && th.detail === f.detail ? 0 : Infinity)); | ||
| pass((f, id, th) => (superseded.has(id) ? Infinity : near(f, th))); |
There was a problem hiding this comment.
suggestion — (From gpt-6.1-sol, confirmed.) This last pass merges findings by distance alone. A different finding within three lines of an open thread, with no supersedes, becomes a reply in that thread instead of opening its own. When the review later marks the original thread addressed, resolving it also hides the newer finding, which is still open. The pass is also greedy in finding order, so an unrelated finding listed first can claim the thread before the one that actually restates it. Consider matching only on supersedes or the same detail, or at least picking the nearest pair rather than the first finding.
There was a problem hiding this comment.
Partly fixed in c109d0f. Each pass now pairs the closest finding and thread first, so finding order can't claim a thread. The proximity pass also requires the same severity, so a nit can't merge into a blocker's thread. I kept proximity matching: the spec asks for same path and nearby line, because a restated finding is often reworded, which is what caused the duplicate thread this fixes. A finding replied into a thread stays visible there and in the check-run history, so a later review that marks the thread addressed is judging the restated text too.
When two reviews of the same commit overlap, the second one opens a fresh thread for a finding the first already opened, even when it can see that thread in its history. And when the head moves while a review runs, it still posts its inline comments and its approval on the commit it read, with nothing saying the pull request has moved on.
Before opening a thread, publish now looks for an open, current thread that seidroid itself started on the same file: one the finding says it supersedes within three lines, then one with the same finding text, then the nearest within three lines on the same side with the same severity, pairing the closest finding and thread first. If it finds one, it replies in that thread and leaves it open instead of resolving it. A superseded thread further away keeps the old behaviour of a new thread plus resolving the old one, and outdated threads are never replied in, since GitHub collapses them. Threads from people or other bots are never touched, and shadow mode is unchanged.
At publish time it also compares the reviewed commit with the pull request's head. If they differ, the review goes up as a comment on the reviewed commit with a note naming both commits and every finding in its body: no inline comments, no thread replies or resolutions, no approval. Blockers still request changes, so a real problem is never dropped. A clean review of an old commit only comments, because an approval counts toward merging whatever commit it names. If the head moves, or cannot be read, while an approval is being posted, the approval is dismissed straight away and no threads are resolved; if GitHub refuses the dismissal the run fails rather than leaving it standing quietly.