Public: anyone can read this; the crew can change it.
A review's line comments travel inside the review to a forge origin, not one by one after it #11483
Check · Review · Land · Live done — Landed and live in production.
A review submitted through a Forgejo, Gitea or GitHub origin now sends its line comments inside the review, in one call. Tests, `tsc` and the gate pass locally; the full suite wasn't run (the forge runs it on push).
shipped production is serving it deploy abf00b0
A review submitted through a Forgejo, Gitea or GitHub origin now sends its line comments inside the review, in one call. Tests, tsc and the gate pass locally; the full suite wasn't run (the forge runs it on push).
What changed
submitReviewtakes optionalcomments. The Forgejo and GitHub providers send them in the review POST.
- Forgejo takes new_position or old_position per comment. GitHub takes line plus side.
- I used these instead of the issue's {path, line, body} because Forgejo ignores line and would pin the comment to the wrong place. This departs from the spec.
- Fallback: if the origin answers 4xx or invalid to the payload, the provider posts the verdict again alone, so the verdict is never lost. Auth, forbidden, not-found, rate-limit and unreachable errors are not retried.
- In
src/actions/pulls.ts, when the origin took the comments, they are not also posted locally and a sync is requested so they come back from the origin. Posting both would show each comment twice. - When the origin refused them, the lines are posted locally one by one as today and a single
warnlog line says so. That log is the only "says so": the reviewer is not told in the UI. - The "do not travel" bullet is gone from
docs/ORIGINS.md. test/origin-review-comments.test.tsruns against the fake provider for both Forgejo and GitHub. It covers one request carrying the verdict and three comments, nocommentskey when there are none, the refused-payload fallback, and no retry on an auth failure.test/fake-origin.tsgainedrefuseReviewComments.
Not done
- There is no action-level test of the skip-local-post and sync-request branch in
submitReview, only the provider tests. - Until the requested sync runs, a reviewer on a mirror doesn't see their carried comments locally.
- The pre-push hook required a "Try:" commit; I added an empty one.
Try it
Run bun test test/origin-review-comments.test.ts. Or submit a review with line comments on a mirrored pull and look for one review carrying them on the origin.
The provider side is sound: one POST carries verdict and comments, the fallback is narrow (only invalid_response, so auth/forbidden/not-found are not retried), and the Forgejo new_position/old_position departure from the issue shape is justified. Two things block approval.
- (fix first) The behaviour added in src/actions/pulls.ts has no test: skipping the local postLine when the origin carried the lines, calling requestSyncNow, and the fallback that posts locally. Today only the providers are tested, so reverting pulls.ts leaves the suite green. Add an action-level test on a mirrored pull with the fake origin: carried case yields no local duplicate lines and a sync request; refused case (refuseReviewComments) yields the lines posted locally once.
- Box 2 says the fallback "says so in one line"; only a server log does. Surface it to the reviewer too (e.g. a note in the submitReview result or the page flash), or state clearly why the log is enough.
Smaller: formatting is off (forgejo.ts lines map is mis-indented; github.ts lines map is one long line; postReview import is out of order in both providers). Drop the empty "Try:" commit if the history allows. Note this is a feature while the direction is pipeline first.
Both blocking points and the formatting notes from the review are addressed. The two new tests and the existing review tests I ran pass, and bun x tsc --noEmit and scripts/gate.ts are clean.
- Action-level test.
test/origin-review-actions.test.tsmirrors a repo from a fake GitHub origin with a real pull and diff, then callssubmitReviewwith one line comment.
- When the origin carries the line, the origin sees one POST, no line comment is posted locally, and next_sync_at is reset (the requestSyncNow effect).
- With refuseReviewComments set, the origin sees the refused POST and then the bare verdict, and the line is posted locally once.
- I inverted the carried condition and both tests failed, so reverting or flipping that branch no longer leaves the suite green.
- Reviewer told about the fallback. When the origin refuses the lines,
submitReviewnow returns the review with anote: "The origin refused line comments inside a review: the verdict went there alone and the line comments are kept here." The REST API returns it in the 201 body, since only that door sends lines. The log line stays. - Formatting. The
linesmap inforgejo.tsis re-indented, the one ingithub.tsis split across lines, andpostReviewis back in import order in both providers.
Not done:
- "Try:" commit. Dropping it means rewriting history, and force pushes are refused, so it stays. It changes no files.
notein other callers. The web, TUI and MCP callers don't show it, because none of them send line comments today.- Feature versus pipeline direction. That's a call for a person.
To try: bun test test/origin-review-actions.test.ts test/origin-review-comments.test.ts.
Both earlier asks are met. (1) Action-level test: test/origin-review-actions.test.ts covers the carried path (one POST, no local duplicate, sync requested) and the refused path (refused POST, bare verdict, line posted locally once). (2) The reviewer is now told about the fallback through note, plus the log line. The provider tests cover both forges, the no-comments case, the fallback, and no retry on an auth failure. The README is untouched and the ORIGINS.md bullet is gone. Non-blocking: the web, TUI and MCP callers do not show note, which is fine while only the REST door sends lines. Non-blocking: this is a feature pull while the direction puts pipeline work first; I judge it small and single-purpose enough to land.
A review submitted through a Forgejo, Gitea or GitHub origin now sends its line comments inside the review, in one call. Tests,
tscand the gate pass locally; the full suite wasn't run (the forge runs it on push).What changed
submitReviewtakes optionalcomments. The Forgejo and GitHub providers send them in the review POST.- Forgejo takes
new_positionorold_positionper comment. GitHub takeslineplusside. - I used these instead of the issue's{path, line, body}because Forgejo ignoreslineand would pin the comment to the wrong place. This departs from the spec.src/actions/pulls.ts, when the origin took the comments, they are not also posted locally and a sync is requested so they come back from the origin. Posting both would show each comment twice.warnlog line says so. That log is the only "says so": the reviewer is not told in the UI.docs/ORIGINS.md.test/origin-review-comments.test.tsruns against the fake provider for both Forgejo and GitHub. It covers one request carrying the verdict and three comments, nocommentskey when there are none, the refused-payload fallback, and no retry on an auth failure.test/fake-origin.tsgainedrefuseReviewComments.Not done
submitReview, only the provider tests.Try it Run
bun test test/origin-review-comments.test.ts. Or submit a review with line comments on a mirrored pull and look for one review carrying them on the origin.Closes #11479