Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(github): pr comment threading (#5468)

Will Hutchinsona74ad3364408
diff --git a/apps/web/src/features/block-pr/component/GithubMessageView.tsx b/apps/web/src/features/block-pr/component/GithubMessageView.tsx
index 7c11321588..a792f9c461 100644
--- a/apps/web/src/features/block-pr/component/GithubMessageView.tsx
+++ b/apps/web/src/features/block-pr/component/GithubMessageView.tsx
@@ -1,9 +1,11 @@
import { Message } from '@channel/Message/Message';
import type { MessageData } from '@channel/Message/types';
import { Thread } from '@channel/Thread/Thread';
+import { ThreadRail } from '@channel/Thread/ThreadRail';
import MacroLogo from '@icon/macro-logo.svg';
import type { GithubPullRequestComment } from '@service-storage/generated/schemas';
import type { ApiChannelMessage } from '@service-storage/generated/schemas/apiChannelMessage';
+import { Key } from '@solid-primitives/keyed';
import { createResizeObserver } from '@solid-primitives/resize-observer';
import { Button, cn } from '@ui';
import { createSignal, onMount, Show } from 'solid-js';
@@ -50,6 +52,25 @@ function sourceLabel(source: string): string | null {
}
}
+/**
+ * Header badge text: the file/line anchor of a review comment when the
+ * metadata carries one, else a generic source label. Falls back to the line
+ * the comment was originally left on when later commits outdated it.
+ */
+function commentBadge(
+ comment: GithubPullRequestComment
+): { label: string; isAnchor: boolean } | null {
+ if (comment.source === 'review_comment' && comment.path) {
+ const line = comment.line ?? comment.originalLine;
+ return {
+ label: line != null ? `${comment.path}:${line}` : comment.path,
+ isAnchor: true,
+ };
+ }
+ const label = sourceLabel(comment.source);
+ return label === null ? null : { label, isAnchor: false };
+}
+
/**
* Fudge a GitHub comment into the channel message shape: GitHub authors ride
* the bot-sender path, which carries an explicit display name through
@@ -77,7 +98,8 @@ function toMessageData(comment: GithubPullRequestComment): MessageData {
}
function toThreadRowMessage(
- comment: GithubPullRequestComment
+ comment: GithubPullRequestComment,
+ replies: GithubPullRequestComment[]
): ApiChannelMessage {
const message = toMessageData(comment);
const login = comment.authorLogin ?? 'github';
@@ -91,22 +113,23 @@ function toThreadRowMessage(
avatar_url: githubAvatarUrl(login),
},
thread: {
- reply_count: 0,
- latest_reply_at: null,
+ reply_count: replies.length,
+ latest_reply_at: replies.at(-1)?.createdAt ?? null,
preview: [],
},
};
}
/**
- * A read-only GitHub comment rendered with the channel message components,
- * collapsed to a preview when long (bot comments tend to be walls of text).
+ * The message proper: avatar, header, and collapsible markdown body. Replies
+ * skip the source pill — the thread rail already marks them as part of the
+ * root's review thread.
*/
-export function GithubMessageView(props: {
+function GithubCommentMessage(props: {
comment: GithubPullRequestComment;
+ isReply?: boolean;
}) {
const messageData = () => toMessageData(props.comment);
- const threadRowMessage = () => toThreadRowMessage(props.comment);
const login = () => props.comment.authorLogin ?? 'github';
const [expanded, setExpanded] = createSignal(false);
@@ -126,63 +149,101 @@ export function GithubMessageView(props: {
});
return (
- <Thread.Row message={threadRowMessage()}>
- <Message.Root message={messageData()}>
- <Message.Layout class="pt-(--regular-message-padding-t)">
- <Message.Slot placement="icon">
- <GithubAvatar login={login()} />
- </Message.Slot>
- <Message.Slot
- placement="header"
- class="flex items-center gap-1 min-w-0 w-full"
+ <Message.Root message={messageData()}>
+ <Message.Layout class="pt-(--regular-message-padding-t)">
+ <Message.Slot placement="icon">
+ <GithubAvatar login={login()} />
+ </Message.Slot>
+ <Message.Slot
+ placement="header"
+ class="flex items-center gap-1 min-w-0 w-full"
+ >
+ <Message.SenderName />
+ <Show when={!props.isReply && commentBadge(props.comment)}>
+ {(badge) => (
+ <span
+ class={cn(
+ 'inline-flex min-w-0 items-center truncate rounded-sm bg-hover px-2 py-0.5 text-xs font-medium leading-none text-ink-muted',
+ badge().isAnchor && 'font-mono'
+ )}
+ title={badge().isAnchor ? badge().label : undefined}
+ >
+ {badge().label}
+ </span>
+ )}
+ </Show>
+ <div class="grow shrink-0 min-w-0 flex items-center gap-1.5 justify-end">
+ <Message.Timestamp class="ml-auto shrink-0" format="dateAndTime" />
+ </div>
+ </Message.Slot>
+ <Message.Slot placement="content" class="ph-no-capture">
+ <div
+ ref={contentRef}
+ class={cn('relative', truncated() && 'overflow-hidden')}
+ style={
+ truncated()
+ ? {
+ 'max-height': `${PREVIEW_MAX_HEIGHT}px`,
+ 'mask-image':
+ 'linear-gradient(to bottom, black calc(100% - 32px), transparent 100%)',
+ '-webkit-mask-image':
+ 'linear-gradient(to bottom, black calc(100% - 32px), transparent 100%)',
+ }
+ : undefined
+ }
>
- <Message.SenderName />
- <Show when={sourceLabel(props.comment.source)}>
- {(label) => (
- <span class="inline-flex shrink-0 items-center rounded-sm bg-hover px-2 py-0.5 text-xs font-medium leading-none text-ink-muted">
- {label()}
- </span>
- )}
- </Show>
- <div class="grow shrink-0 min-w-0 flex items-center gap-1.5 justify-end">
- <Message.Timestamp
- class="ml-auto shrink-0"
- format="dateAndTime"
- />
- </div>
- </Message.Slot>
- <Message.Slot placement="content" class="ph-no-capture">
- <div
- ref={contentRef}
- class={cn('relative', truncated() && 'overflow-hidden')}
- style={
- truncated()
- ? {
- 'max-height': `${PREVIEW_MAX_HEIGHT}px`,
- 'mask-image':
- 'linear-gradient(to bottom, black calc(100% - 32px), transparent 100%)',
- '-webkit-mask-image':
- 'linear-gradient(to bottom, black calc(100% - 32px), transparent 100%)',
- }
- : undefined
- }
+ <Message.Content class="overflow-x-auto" />
+ </div>
+ <Show when={overflowing()}>
+ <Button
+ type="button"
+ variant="ghost"
+ size="sm"
+ class="mt-2"
+ onClick={() => setExpanded(!expanded())}
>
- <Message.Content class="overflow-x-auto" />
- </div>
- <Show when={overflowing()}>
- <Button
- type="button"
- variant="ghost"
- size="sm"
- class="mt-2"
- onClick={() => setExpanded(!expanded())}
- >
- {expanded() ? 'Show less' : 'Show more'}
- </Button>
- </Show>
- </Message.Slot>
- </Message.Layout>
- </Message.Root>
+ {expanded() ? 'Show less' : 'Show more'}
+ </Button>
+ </Show>
+ </Message.Slot>
+ </Message.Layout>
+ </Message.Root>
+ );
+}
+
+/**
+ * A read-only GitHub comment rendered with the channel message components,
+ * collapsed to a preview when long (bot comments tend to be walls of text).
+ * Review-thread replies render indented under the root along the thread
+ * rail, mirroring Macro discussion threads.
+ */
+export function GithubMessageView(props: {
+ comment: GithubPullRequestComment;
+ replies?: GithubPullRequestComment[];
+}) {
+ const replies = () => props.replies ?? [];
+
+ return (
+ <Thread.Row message={toThreadRowMessage(props.comment, replies())}>
+ <GithubCommentMessage comment={props.comment} />
+ <Show when={replies().length > 0}>
+ <div class="relative w-full">
+ <Thread.ReplyRailDecorations
+ isReplying={() => false}
+ firstThreadReplyNewMessage={false}
+ />
+ <Thread.RepliesContainer>
+ <Key each={replies()} by="id">
+ {(reply) => (
+ <div class="relative">
+ <ThreadRail />
+ <GithubCommentMessage comment={reply()} isReply />
+ </div>
+ )}
+ </Key>
+ </Thread.RepliesContainer>
+ </div>
+ </Show>
</Thread.Row>
);
}
diff --git a/apps/web/src/features/block-pr/component/PrTimeline.tsx b/apps/web/src/features/block-pr/component/PrTimeline.tsx
index 9db377ff59..ecb5c1a0d3 100644
--- a/apps/web/src/features/block-pr/component/PrTimeline.tsx
+++ b/apps/web/src/features/block-pr/component/PrTimeline.tsx
@@ -29,11 +29,6 @@ export function PrTimeline(props: {
const [isExpanded, setIsExpanded] = createSignal(true);
const [hideBots, setHideBots] = createSignal(false);
- const visibleGithubItems = createMemo(() =>
- hideBots()
- ? props.githubItems.filter((item) => !isGithubBotLogin(item.authorLogin))
- : props.githubItems
- );
const botCount = createMemo(
() =>
props.githubItems.filter((item) => isGithubBotLogin(item.authorLogin))
@@ -41,7 +36,9 @@ export function PrTimeline(props: {
);
const entries = createMemo(() =>
- buildTimeline(visibleGithubItems(), props.source.threads())
+ buildTimeline(props.githubItems, props.source.threads(), {
+ hideBots: hideBots(),
+ })
);
let composerHandle: { clear: () => void } | undefined;
@@ -90,7 +87,10 @@ export function PrTimeline(props: {
<Switch>
<Match when={entry.kind === 'github-comment' && entry}>
{(commentEntry) => (
- <GithubMessageView comment={commentEntry().item} />
+ <GithubMessageView
+ comment={commentEntry().item}
+ replies={commentEntry().replies}
+ />
)}
</Match>
<Match when={entry.kind === 'macro-thread' && entry}>
diff --git a/apps/web/src/features/block-pr/data/timeline.test.ts b/apps/web/src/features/block-pr/data/timeline.test.ts
new file mode 100644
index 0000000000..ffed167e13
--- /dev/null
+++ b/apps/web/src/features/block-pr/data/timeline.test.ts
@@ -0,0 +1,290 @@
+import type {
+ DiscussionComment,
+ DiscussionThread,
+} from '@core/comments/discussion';
+import type { GithubPullRequestComment } from '@service-storage/generated/schemas';
+import { describe, expect, it } from 'vitest';
+
+import { buildTimeline, type TimelineEntry } from './timeline';
+
+/** ISO timestamp at the given minute of a fixed hour. */
+function at(minute: number): string {
+ return `2026-08-01T10:${String(minute).padStart(2, '0')}:00Z`;
+}
+
+function comment(
+ id: number,
+ overrides: Partial<GithubPullRequestComment> = {}
+): GithubPullRequestComment {
+ return {
+ id,
+ body: `Comment ${id}`,
+ source: 'issue_comment',
+ authorLogin: 'octocat',
+ createdAt: at(0),
+ ...overrides,
+ };
+}
+
+function reviewComment(
+ id: number,
+ minute: number,
+ overrides: Partial<GithubPullRequestComment> = {}
+): GithubPullRequestComment {
+ return comment(id, {
+ source: 'review_comment',
+ createdAt: at(minute),
+ ...overrides,
+ });
+}
+
+function macroThread(id: string, createdAt: string): DiscussionThread {
+ const first: DiscussionComment = {
+ id: `${id}-c1`,
+ threadId: id,
+ authorId: 'user-1',
+ text: 'Macro comment',
+ createdAt,
+ updatedAt: createdAt,
+ deletedAt: null,
+ };
+ return { id, resolved: false, comments: [first] };
+}
+
+function githubEntries(entries: TimelineEntry[]) {
+ return entries.filter((entry) => entry.kind === 'github-comment');
+}
+
+describe('buildTimeline', () => {
+ it('keeps unrelated comments as standalone entries in timestamp order', () => {
+ const entries = buildTimeline(
+ [comment(2, { createdAt: at(5) }), comment(1, { createdAt: at(1) })],
+ []
+ );
+
+ expect(
+ entries.map((entry) => entry.kind === 'github-comment' && entry.item.id)
+ ).toEqual([1, 2]);
+ expect(githubEntries(entries).map((entry) => entry.replies)).toEqual([
+ [],
+ [],
+ ]);
+ });
+
+ it('groups review-comment replies under their thread root, oldest first', () => {
+ const entries = buildTimeline(
+ [
+ reviewComment(1, 0),
+ reviewComment(3, 2, { inReplyToId: 1 }),
+ reviewComment(2, 1, { inReplyToId: 1 }),
+ comment(4, { createdAt: at(3) }),
+ ],
+ []
+ );
+
+ expect(entries).toHaveLength(2);
+ const [thread, standalone] = githubEntries(entries);
+ expect(thread?.item.id).toBe(1);
+ expect(thread?.replies.map((reply) => reply.id)).toEqual([2, 3]);
+ expect(standalone?.item.id).toBe(4);
+ expect(standalone?.replies).toEqual([]);
+ });
+
+ it('sorts a thread by its root timestamp, not its latest reply', () => {
+ const entries = buildTimeline(
+ [
+ reviewComment(1, 0),
+ reviewComment(2, 10, { inReplyToId: 1 }),
+ comment(3, { createdAt: at(5) }),
+ ],
+ []
+ );
+
+ expect(githubEntries(entries).map((entry) => entry.item.id)).toEqual([
+ 1, 3,
+ ]);
+ });
+
+ it('resolves reply-to-reply chains to the same root', () => {
+ const entries = buildTimeline(
+ [
+ reviewComment(1, 0),
+ reviewComment(2, 1, { inReplyToId: 1 }),
+ reviewComment(3, 2, { inReplyToId: 2 }),
+ ],
+ []
+ );
+
+ expect(entries).toHaveLength(1);
+ const [thread] = githubEntries(entries);
+ expect(thread?.item.id).toBe(1);
+ expect(thread?.replies.map((reply) => reply.id)).toEqual([2, 3]);
+ });
+
+ it('treats a reply whose parent is missing as its own root', () => {
+ const entries = buildTimeline(
+ [reviewComment(2, 1, { inReplyToId: 999 })],
+ []
+ );
+
+ expect(entries).toHaveLength(1);
+ const [entry] = githubEntries(entries);
+ expect(entry?.item.id).toBe(2);
+ expect(entry?.replies).toEqual([]);
+ });
+
+ it('promotes the earliest reply when the root body cleans to empty', () => {
+ const entries = buildTimeline(
+ [
+ reviewComment(1, 0, { body: '<!-- marker only -->' }),
+ reviewComment(2, 1, { inReplyToId: 1 }),
+ reviewComment(3, 2, { inReplyToId: 1 }),
+ ],
+ []
+ );
+
+ expect(entries).toHaveLength(1);
+ const [thread] = githubEntries(entries);
+ expect(thread?.item.id).toBe(2);
+ expect(thread?.replies.map((reply) => reply.id)).toEqual([3]);
+ });
+
+ it('drops comments whose body cleans to empty', () => {
+ const entries = buildTimeline(
+ [comment(1, { body: '<!-- marker only -->' })],
+ []
+ );
+
+ expect(entries).toEqual([]);
+ });
+
+ it('cleans markdown in replies as well as roots', () => {
+ const entries = buildTimeline(
+ [
+ reviewComment(1, 0),
+ reviewComment(2, 1, {
+ inReplyToId: 1,
+ body: '<details><summary>Say more</summary>hidden</details>',
+ }),
+ ],
+ []
+ );
+
+ const [thread] = githubEntries(entries);
+ expect(thread?.replies[0]?.body).toBe('**Say more**\n\nhidden');
+ });
+
+ it('merges macro threads by their first comment timestamp', () => {
+ const entries = buildTimeline(
+ [comment(1, { createdAt: at(0) }), comment(2, { createdAt: at(4) })],
+ [macroThread('t1', at(2))]
+ );
+
+ expect(entries.map((entry) => entry.kind)).toEqual([
+ 'github-comment',
+ 'macro-thread',
+ 'github-comment',
+ ]);
+ });
+
+ describe('hideBots', () => {
+ const bot = { authorLogin: 'coderabbitai[bot]' };
+
+ it('drops standalone bot comments and all-bot threads', () => {
+ const entries = buildTimeline(
+ [
+ comment(1, bot),
+ reviewComment(2, 1, bot),
+ reviewComment(3, 2, { inReplyToId: 2, ...bot }),
+ comment(4, { createdAt: at(3) }),
+ ],
+ [],
+ { hideBots: true }
+ );
+
+ expect(githubEntries(entries).map((entry) => entry.item.id)).toEqual([4]);
+ });
+
+ it('keeps a bot-rooted thread intact when a human replied', () => {
+ const entries = buildTimeline(
+ [
+ reviewComment(1, 0, bot),
+ reviewComment(2, 1, { inReplyToId: 1 }),
+ comment(3, { ...bot, createdAt: at(2) }),
+ ],
+ [],
+ { hideBots: true }
+ );
+
+ expect(entries).toHaveLength(1);
+ const [thread] = githubEntries(entries);
+ expect(thread?.item.id).toBe(1);
+ expect(thread?.item.authorLogin).toBe('coderabbitai[bot]');
+ expect(thread?.replies.map((reply) => reply.id)).toEqual([2]);
+ });
+
+ it('keeps everything when disabled', () => {
+ const entries = buildTimeline(
+ [comment(1, bot), comment(2, { createdAt: at(1) })],
+ [],
+ { hideBots: false }
+ );
+
+ expect(githubEntries(entries)).toHaveLength(2);
+ });
+ });
+
+ describe('review adjacency', () => {
+ it('anchors review-comment threads directly after their review summary', () => {
+ const entries = buildTimeline(
+ [
+ comment(3, { createdAt: at(4) }),
+ reviewComment(1, 4, { pullRequestReviewId: 100 }),
+ comment(100, {
+ source: 'review',
+ createdAt: at(5),
+ body: 'LGTM with nits',
+ }),
+ ],
+ []
+ );
+
+ expect(githubEntries(entries).map((entry) => entry.item.id)).toEqual([
+ 3, 100, 1,
+ ]);
+ });
+
+ it('keeps threads in place when their review has no summary entry', () => {
+ const entries = buildTimeline(
+ [
+ reviewComment(1, 0, { pullRequestReviewId: 999 }),
+ comment(2, { createdAt: at(1) }),
+ ],
+ []
+ );
+
+ expect(githubEntries(entries).map((entry) => entry.item.id)).toEqual([
+ 1, 2,
+ ]);
+ });
+
+ it('orders sibling threads of one review by creation time', () => {
+ const entries = buildTimeline(
+ [
+ reviewComment(11, 3, { pullRequestReviewId: 100 }),
+ reviewComment(10, 2, { pullRequestReviewId: 100 }),
+ comment(100, {
+ source: 'review',
+ createdAt: at(5),
+ body: 'Summary',
+ }),
+ ],
+ []
+ );
+
+ expect(githubEntries(entries).map((entry) => entry.item.id)).toEqual([
+ 100, 10, 11,
+ ]);
+ });
+ });
+});
diff --git a/apps/web/src/features/block-pr/data/timeline.ts b/apps/web/src/features/block-pr/data/timeline.ts
index 2d8202c8fd..f1ed23e0d2 100644
--- a/apps/web/src/features/block-pr/data/timeline.ts
+++ b/apps/web/src/features/block-pr/data/timeline.ts
@@ -1,10 +1,16 @@
import type { DiscussionThread } from '@core/comments/discussion';
import type { GithubPullRequestComment } from '@service-storage/generated/schemas';
-import { cleanGithubMarkdown } from '../util/githubMarkdown';
+import { cleanGithubMarkdown, isGithubBotLogin } from '../util/githubMarkdown';
export type TimelineEntry =
- | { kind: 'github-comment'; ts: number; item: GithubPullRequestComment }
+ | {
+ kind: 'github-comment';
+ ts: number;
+ item: GithubPullRequestComment;
+ /** Review-thread replies to `item`, oldest first. */
+ replies: GithubPullRequestComment[];
+ }
| { kind: 'macro-thread'; ts: number; thread: DiscussionThread };
function timestamp(value: string | null | undefined): number {
@@ -13,28 +19,103 @@ function timestamp(value: string | null | undefined): number {
return Number.isNaN(parsed) ? 0 : parsed;
}
+/**
+ * The id of the comment's review-thread root, found by following reply
+ * pointers. GitHub review threads are single-level (every reply points at the
+ * root), but the walk also tolerates reply-to-reply chains and stops at
+ * comments whose parent is missing from the list.
+ */
+function threadRootId(
+ comment: GithubPullRequestComment,
+ byId: Map<number, GithubPullRequestComment>
+): number {
+ let current = comment;
+ const seen = new Set([current.id]);
+ while (current.inReplyToId != null) {
+ const parent = byId.get(current.inReplyToId);
+ if (!parent || seen.has(parent.id)) break;
+ seen.add(parent.id);
+ current = parent;
+ }
+ return current.id;
+}
+
/**
* Merge GitHub comments (issue comments, review comments, and reviews, as the
* enrich endpoint returns them) with Macro discussion threads into a single
- * timestamp-ordered timeline. Empty bodies (e.g. approve-only reviews) are
- * dropped.
+ * timestamp-ordered timeline. Review comments that reply to another comment
+ * are grouped under their thread root, which carries the group's timestamp.
+ * Empty bodies (e.g. approve-only reviews) are dropped; when a thread root's
+ * body cleans to empty its earliest reply takes its place.
*/
export function buildTimeline(
githubItems: GithubPullRequestComment[],
- macroThreads: DiscussionThread[]
+ macroThreads: DiscussionThread[],
+ options: { hideBots?: boolean } = {}
): TimelineEntry[] {
const entries: TimelineEntry[] = [];
+ // Group before any filtering so a dropped root (empty body, hidden bot)
+ // cannot orphan its replies.
+ const byId = new Map(githubItems.map((item) => [item.id, item] as const));
+ const groups = new Map<number, GithubPullRequestComment[]>();
for (const item of githubItems) {
- const body = cleanGithubMarkdown(item.body);
- if (!body) continue;
+ const rootId = threadRootId(item, byId);
+ const group = groups.get(rootId);
+ if (group) group.push(item);
+ else groups.set(rootId, [item]);
+ }
+
+ for (const group of groups.values()) {
+ // Hiding bots drops all-bot groups only: a thread with any human comment
+ // keeps its bot comments (usually the root) so the replies keep context.
+ if (
+ options.hideBots &&
+ group.every((item) => isGithubBotLogin(item.authorLogin))
+ ) {
+ continue;
+ }
+ const [root, ...replies] = group
+ .map((item) => ({ ...item, body: cleanGithubMarkdown(item.body) }))
+ .filter((item) => item.body)
+ .sort((a, b) => timestamp(a.createdAt) - timestamp(b.createdAt));
+ if (!root) continue;
entries.push({
kind: 'github-comment',
- ts: timestamp(item.createdAt),
- item: { ...item, body },
+ ts: timestamp(root.createdAt),
+ item: root,
+ replies,
});
}
+ // A thread submitted as part of a review sorts directly under that
+ // review's summary comment rather than by its own creation time (GitHub
+ // stamps the comments when the review is drafted, so they would otherwise
+ // land before the summary they belong to).
+ const reviewTs = new Map<number, number>();
+ for (const entry of entries) {
+ if (entry.kind === 'github-comment' && entry.item.source === 'review') {
+ reviewTs.set(entry.item.id, entry.ts);
+ }
+ }
+ type GithubEntry = Extract<TimelineEntry, { kind: 'github-comment' }>;
+ const anchored: { entry: GithubEntry; anchor: number }[] = [];
+ for (const entry of entries) {
+ if (entry.kind !== 'github-comment') continue;
+ const anchor =
+ entry.item.pullRequestReviewId != null
+ ? reviewTs.get(entry.item.pullRequestReviewId)
+ : undefined;
+ if (anchor !== undefined) anchored.push({ entry, anchor });
+ }
+ // Snap in creation order so sibling threads of one review keep their
+ // relative order.
+ anchored.sort((a, b) => a.entry.ts - b.entry.ts);
+ let anchorOffset = 0;
+ for (const { entry, anchor } of anchored) {
+ entry.ts = anchor + ++anchorOffset;
+ }
+
for (const thread of macroThreads) {
entries.push({
kind: 'macro-thread',
diff --git a/apps/web/src/lib/service-clients/service-auth/generated/schemas/githubPullRequestComment.ts b/apps/web/src/lib/service-clients/service-auth/generated/schemas/githubPullRequestComment.ts
index 3398439214..f4260d454b 100644
--- a/apps/web/src/lib/service-clients/service-auth/generated/schemas/githubPullRequestComment.ts
+++ b/apps/web/src/lib/service-clients/service-auth/generated/schemas/githubPullRequestComment.ts
@@ -8,6 +8,11 @@ import type { GithubPullRequestCommentAuthorAssociation } from './githubPullRequ
import type { GithubPullRequestCommentAuthorId } from './githubPullRequestCommentAuthorId';
import type { GithubPullRequestCommentAuthorLogin } from './githubPullRequestCommentAuthorLogin';
import type { GithubPullRequestCommentCreatedAt } from './githubPullRequestCommentCreatedAt';
+import type { GithubPullRequestCommentInReplyToId } from './githubPullRequestCommentInReplyToId';
+import type { GithubPullRequestCommentLine } from './githubPullRequestCommentLine';
+import type { GithubPullRequestCommentOriginalLine } from './githubPullRequestCommentOriginalLine';
+import type { GithubPullRequestCommentPath } from './githubPullRequestCommentPath';
+import type { GithubPullRequestCommentPullRequestReviewId } from './githubPullRequestCommentPullRequestReviewId';
import type { GithubPullRequestCommentUpdatedAt } from './githubPullRequestCommentUpdatedAt';
import type { GithubPullRequestCommentUrl } from './githubPullRequestCommentUrl';
@@ -33,6 +38,33 @@ export interface GithubPullRequestComment {
* @minimum 0
*/
id: number;
+ /**
+ * The id of the comment this one replies to, when it is part of a review
+thread. Only ever present on `review_comment` sources.
+ * @minimum 0
+ */
+ inReplyToId?: GithubPullRequestCommentInReplyToId;
+ /**
+ * The line in the current diff the comment is anchored to. Cleared by
+GitHub when later commits outdate the comment's diff.
+ * @minimum 0
+ */
+ line?: GithubPullRequestCommentLine;
+ /**
+ * The line the comment was originally anchored to, kept even when the
+diff has since changed.
+ * @minimum 0
+ */
+ originalLine?: GithubPullRequestCommentOriginalLine;
+ /** The repository-relative file path the review comment is anchored to.
+Only ever present on `review_comment` sources. */
+ path?: GithubPullRequestCommentPath;
+ /**
+ * The id of the pull request review this comment was submitted with.
+Only ever present on `review_comment` sources.
+ * @minimum 0
+ */
+ pullRequestReviewId?: GithubPullRequestCommentPullRequestReviewId;
/** The GitHub source for the comment, such as `issue_comment` or `review_comment`. */
source: string;
/** When the comment or review was last updated. */
diff --git a/apps/web/src/lib/service-clients/service-auth/generated/schemas/githubPullRequestCommentInReplyToId.ts b/apps/web/src/lib/service-clients/service-auth/generated/schemas/githubPullRequestCommentInReplyToId.ts
new file mode 100644
index 0000000000..284f7f5a15
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-auth/generated/schemas/githubPullRequestCommentInReplyToId.ts
@@ -0,0 +1,13 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * authentication_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+/**
+ * The id of the comment this one replies to, when it is part of a review
+thread. Only ever present on `review_comment` sources.
+ * @minimum 0
+ */
+export type GithubPullRequestCommentInReplyToId = number | null;
diff --git a/apps/web/src/lib/service-clients/service-auth/generated/schemas/githubPullRequestCommentLine.ts b/apps/web/src/lib/service-clients/service-auth/generated/schemas/githubPullRequestCommentLine.ts
new file mode 100644
index 0000000000..663ca90728
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-auth/generated/schemas/githubPullRequestCommentLine.ts
@@ -0,0 +1,13 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * authentication_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+/**
+ * The line in the current diff the comment is anchored to. Cleared by
+GitHub when later commits outdate the comment's diff.
+ * @minimum 0
+ */
+export type GithubPullRequestCommentLine = number | null;
diff --git a/apps/web/src/lib/service-clients/service-auth/generated/schemas/githubPullRequestCommentOriginalLine.ts b/apps/web/src/lib/service-clients/service-auth/generated/schemas/githubPullRequestCommentOriginalLine.ts
new file mode 100644
index 0000000000..280ce396b0
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-auth/generated/schemas/githubPullRequestCommentOriginalLine.ts
@@ -0,0 +1,13 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * authentication_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+/**
+ * The line the comment was originally anchored to, kept even when the
+diff has since changed.
+ * @minimum 0
+ */
+export type GithubPullRequestCommentOriginalLine = number | null;
diff --git a/apps/web/src/lib/service-clients/service-auth/generated/schemas/githubPullRequestCommentPath.ts b/apps/web/src/lib/service-clients/service-auth/generated/schemas/githubPullRequestCommentPath.ts
new file mode 100644
index 0000000000..67a9fdbda4
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-auth/generated/schemas/githubPullRequestCommentPath.ts
@@ -0,0 +1,12 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * authentication_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+/**
+ * The repository-relative file path the review comment is anchored to.
+Only ever present on `review_comment` sources.
+ */
+export type GithubPullRequestCommentPath = string | null;
diff --git a/apps/web/src/lib/service-clients/service-auth/generated/schemas/githubPullRequestCommentPullRequestReviewId.ts b/apps/web/src/lib/service-clients/service-auth/generated/schemas/githubPullRequestCommentPullRequestReviewId.ts
new file mode 100644
index 0000000000..6a4e254996
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-auth/generated/schemas/githubPullRequestCommentPullRequestReviewId.ts
@@ -0,0 +1,13 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * authentication_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+/**
+ * The id of the pull request review this comment was submitted with.
+Only ever present on `review_comment` sources.
+ * @minimum 0
+ */
+export type GithubPullRequestCommentPullRequestReviewId = number | null;
diff --git a/apps/web/src/lib/service-clients/service-auth/generated/schemas/index.ts b/apps/web/src/lib/service-clients/service-auth/generated/schemas/index.ts
index c09974de78..885702e958 100644
--- a/apps/web/src/lib/service-clients/service-auth/generated/schemas/index.ts
+++ b/apps/web/src/lib/service-clients/service-auth/generated/schemas/index.ts
@@ -55,6 +55,11 @@ export * from './githubPullRequestCommentAuthorAssociation';
export * from './githubPullRequestCommentAuthorId';
export * from './githubPullRequestCommentAuthorLogin';
export * from './githubPullRequestCommentCreatedAt';
+export * from './githubPullRequestCommentInReplyToId';
+export * from './githubPullRequestCommentLine';
+export * from './githubPullRequestCommentOriginalLine';
+export * from './githubPullRequestCommentPath';
+export * from './githubPullRequestCommentPullRequestReviewId';
export * from './githubPullRequestCommentUpdatedAt';
export * from './githubPullRequestCommentUrl';
export * from './githubPullRequestRef';
diff --git a/apps/web/src/lib/service-clients/service-auth/openapi.json b/apps/web/src/lib/service-clients/service-auth/openapi.json
index 4a957eb9b2..7e0f962549 100644
--- a/apps/web/src/lib/service-clients/service-auth/openapi.json
+++ b/apps/web/src/lib/service-clients/service-auth/openapi.json
@@ -3930,6 +3930,34 @@
"description": "The unique GitHub identifier for the comment or review.",
"minimum": 0
},
+ "inReplyToId": {
+ "type": ["integer", "null"],
+ "format": "int64",
+ "description": "The id of the comment this one replies to, when it is part of a review\nthread. Only ever present on `review_comment` sources.",
+ "minimum": 0
+ },
+ "line": {
+ "type": ["integer", "null"],
+ "format": "int64",
+ "description": "The line in the current diff the comment is anchored to. Cleared by\nGitHub when later commits outdate the comment's diff.",
+ "minimum": 0
+ },
+ "originalLine": {
+ "type": ["integer", "null"],
+ "format": "int64",
+ "description": "The line the comment was originally anchored to, kept even when the\ndiff has since changed.",
+ "minimum": 0
+ },
+ "path": {
+ "type": ["string", "null"],
+ "description": "The repository-relative file path the review comment is anchored to.\nOnly ever present on `review_comment` sources."
+ },
+ "pullRequestReviewId": {
+ "type": ["integer", "null"],
+ "format": "int64",
+ "description": "The id of the pull request review this comment was submitted with.\nOnly ever present on `review_comment` sources.",
+ "minimum": 0
+ },
"source": {
"type": "string",
"description": "The GitHub source for the comment, such as `issue_comment` or `review_comment`."
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/githubPullRequestComment.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/githubPullRequestComment.ts
index 3d3e9ea483..2a15de66c8 100644
--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/githubPullRequestComment.ts
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/githubPullRequestComment.ts
@@ -7,6 +7,11 @@
import type { GithubPullRequestCommentAuthorAssociation } from './githubPullRequestCommentAuthorAssociation';
import type { GithubPullRequestCommentAuthorLogin } from './githubPullRequestCommentAuthorLogin';
import type { GithubPullRequestCommentCreatedAt } from './githubPullRequestCommentCreatedAt';
+import type { GithubPullRequestCommentInReplyToId } from './githubPullRequestCommentInReplyToId';
+import type { GithubPullRequestCommentLine } from './githubPullRequestCommentLine';
+import type { GithubPullRequestCommentOriginalLine } from './githubPullRequestCommentOriginalLine';
+import type { GithubPullRequestCommentPath } from './githubPullRequestCommentPath';
+import type { GithubPullRequestCommentPullRequestReviewId } from './githubPullRequestCommentPullRequestReviewId';
import type { GithubPullRequestCommentUpdatedAt } from './githubPullRequestCommentUpdatedAt';
import type { GithubPullRequestCommentUrl } from './githubPullRequestCommentUrl';
@@ -27,6 +32,33 @@ export interface GithubPullRequestComment {
* @minimum 0
*/
id: number;
+ /**
+ * The id of the comment this one replies to, when it is part of a review
+thread. Only ever present on `review_comment` sources.
+ * @minimum 0
+ */
+ inReplyToId?: GithubPullRequestCommentInReplyToId;
+ /**
+ * The line in the current diff the comment is anchored to. Cleared by
+GitHub when later commits outdate the comment's diff.
+ * @minimum 0
+ */
+ line?: GithubPullRequestCommentLine;
+ /**
+ * The line the comment was originally anchored to, kept even when the
+diff has since changed.
+ * @minimum 0
+ */
+ originalLine?: GithubPullRequestCommentOriginalLine;
+ /** The repository-relative file path the review comment is anchored to.
+Only ever present on `review_comment` sources. */
+ path?: GithubPullRequestCommentPath;
+ /**
+ * The id of the pull request review this comment was submitted with.
+Only ever present on `review_comment` sources.
+ * @minimum 0
+ */
+ pullRequestReviewId?: GithubPullRequestCommentPullRequestReviewId;
/** The GitHub source for the comment, such as `issue_comment` or `review_comment`. */
source: string;
/** When the comment or review was last updated. */
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/githubPullRequestCommentInReplyToId.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/githubPullRequestCommentInReplyToId.ts
new file mode 100644
index 0000000000..a4c3ce6e9c
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/githubPullRequestCommentInReplyToId.ts
@@ -0,0 +1,13 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+/**
+ * The id of the comment this one replies to, when it is part of a review
+thread. Only ever present on `review_comment` sources.
+ * @minimum 0
+ */
+export type GithubPullRequestCommentInReplyToId = number | null;
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/githubPullRequestCommentLine.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/githubPullRequestCommentLine.ts
new file mode 100644
index 0000000000..6765fb8d6e
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/githubPullRequestCommentLine.ts
@@ -0,0 +1,13 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+/**
+ * The line in the current diff the comment is anchored to. Cleared by
+GitHub when later commits outdate the comment's diff.
+ * @minimum 0
+ */
+export type GithubPullRequestCommentLine = number | null;
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/githubPullRequestCommentOriginalLine.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/githubPullRequestCommentOriginalLine.ts
new file mode 100644
index 0000000000..13ac25256b
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/githubPullRequestCommentOriginalLine.ts
@@ -0,0 +1,13 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+/**
+ * The line the comment was originally anchored to, kept even when the
+diff has since changed.
+ * @minimum 0
+ */
+export type GithubPullRequestCommentOriginalLine = number | null;
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/githubPullRequestCommentPath.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/githubPullRequestCommentPath.ts
new file mode 100644
index 0000000000..f5de7516b7
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/githubPullRequestCommentPath.ts
@@ -0,0 +1,12 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+/**
+ * The repository-relative file path the review comment is anchored to.
+Only ever present on `review_comment` sources.
+ */
+export type GithubPullRequestCommentPath = string | null;
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/githubPullRequestCommentPullRequestReviewId.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/githubPullRequestCommentPullRequestReviewId.ts
new file mode 100644
index 0000000000..4afd2c0190
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/githubPullRequestCommentPullRequestReviewId.ts
@@ -0,0 +1,13 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+/**
+ * The id of the pull request review this comment was submitted with.
+Only ever present on `review_comment` sources.
+ * @minimum 0
+ */
+export type GithubPullRequestCommentPullRequestReviewId = number | null;
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/index.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/index.ts
index aa90fb479d..09556711a3 100644
--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/index.ts
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/index.ts
@@ -664,6 +664,11 @@ export * from './githubPullRequestComment';
export * from './githubPullRequestCommentAuthorAssociation';
export * from './githubPullRequestCommentAuthorLogin';
export * from './githubPullRequestCommentCreatedAt';
+export * from './githubPullRequestCommentInReplyToId';
+export * from './githubPullRequestCommentLine';
+export * from './githubPullRequestCommentOriginalLine';
+export * from './githubPullRequestCommentPath';
+export * from './githubPullRequestCommentPullRequestReviewId';
export * from './githubPullRequestComments';
export * from './githubPullRequestCommentUpdatedAt';
export * from './githubPullRequestCommentUrl';
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/zod.ts b/apps/web/src/lib/service-clients/service-storage/generated/zod.ts
index baa3b2e19f..e3f34f2376 100644
--- a/apps/web/src/lib/service-clients/service-storage/generated/zod.ts
+++ b/apps/web/src/lib/service-clients/service-storage/generated/zod.ts
@@ -6395,6 +6395,14 @@ export const getDocumentGithubPullRequestsResponsePullRequestsItemChecksItemIdMi
export const getDocumentGithubPullRequestsResponsePullRequestsItemCommentsItemIdMin = 0;
+export const getDocumentGithubPullRequestsResponsePullRequestsItemCommentsItemInReplyToIdMin = 0;
+
+export const getDocumentGithubPullRequestsResponsePullRequestsItemCommentsItemLineMin = 0;
+
+export const getDocumentGithubPullRequestsResponsePullRequestsItemCommentsItemOriginalLineMin = 0;
+
+export const getDocumentGithubPullRequestsResponsePullRequestsItemCommentsItemPullRequestReviewIdMin = 0;
+
export const getDocumentGithubPullRequestsResponsePullRequestsItemDeletionsMin = 0;
export const getDocumentGithubPullRequestsResponsePullRequestsItemNumberMin = 0;
@@ -6494,6 +6502,48 @@ export const getDocumentGithubPullRequestsResponse = zod
.describe(
'The unique GitHub identifier for the comment or review.'
),
+ inReplyToId: zod
+ .number()
+ .min(
+ getDocumentGithubPullRequestsResponsePullRequestsItemCommentsItemInReplyToIdMin
+ )
+ .nullish()
+ .describe(
+ 'The id of the comment this one replies to, when it is part of a review\nthread. Only ever present on `review_comment` sources.'
+ ),
+ line: zod
+ .number()
+ .min(
+ getDocumentGithubPullRequestsResponsePullRequestsItemCommentsItemLineMin
+ )
+ .nullish()
+ .describe(
+ "The line in the current diff the comment is anchored to. Cleared by\nGitHub when later commits outdate the comment's diff."
+ ),
+ originalLine: zod
+ .number()
+ .min(
+ getDocumentGithubPullRequestsResponsePullRequestsItemCommentsItemOriginalLineMin
+ )
+ .nullish()
+ .describe(
+ 'The line the comment was originally anchored to, kept even when the\ndiff has since changed.'
+ ),
+ path: zod
+ .string()
+ .nullish()
+ .describe(
+ 'The repository-relative file path the review comment is anchored to.\nOnly ever present on `review_comment` sources.'
+ ),
+ pullRequestReviewId: zod
+ .number()
+ .min(
+ getDocumentGithubPullRequestsResponsePullRequestsItemCommentsItemPullRequestReviewIdMin
+ )
+ .nullish()
+ .describe(
+ 'The id of the pull request review this comment was submitted with.\nOnly ever present on `review_comment` sources.'
+ ),
source: zod
.string()
.describe(
diff --git a/apps/web/src/lib/service-clients/service-storage/openapi.json b/apps/web/src/lib/service-clients/service-storage/openapi.json
index f8db98f506..6abf51f2fb 100644
--- a/apps/web/src/lib/service-clients/service-storage/openapi.json
+++ b/apps/web/src/lib/service-clients/service-storage/openapi.json
@@ -18536,6 +18536,34 @@
"description": "The unique GitHub identifier for the comment or review.",
"minimum": 0
},
+ "inReplyToId": {
+ "type": ["integer", "null"],
+ "format": "int64",
+ "description": "The id of the comment this one replies to, when it is part of a review\nthread. Only ever present on `review_comment` sources.",
+ "minimum": 0
+ },
+ "line": {
+ "type": ["integer", "null"],
+ "format": "int64",
+ "description": "The line in the current diff the comment is anchored to. Cleared by\nGitHub when later commits outdate the comment's diff.",
+ "minimum": 0
+ },
+ "originalLine": {
+ "type": ["integer", "null"],
+ "format": "int64",
+ "description": "The line the comment was originally anchored to, kept even when the\ndiff has since changed.",
+ "minimum": 0
+ },
+ "path": {
+ "type": ["string", "null"],
+ "description": "The repository-relative file path the review comment is anchored to.\nOnly ever present on `review_comment` sources."
+ },
+ "pullRequestReviewId": {
+ "type": ["integer", "null"],
+ "format": "int64",
+ "description": "The id of the pull request review this comment was submitted with.\nOnly ever present on `review_comment` sources.",
+ "minimum": 0
+ },
"source": {
"type": "string",
"description": "The GitHub source for the comment, such as `issue_comment` or `review_comment`."
diff --git a/crates/documents/src/domain/models.rs b/crates/documents/src/domain/models.rs
index 037987a8eb..fbc6761890 100644
--- a/crates/documents/src/domain/models.rs
+++ b/crates/documents/src/domain/models.rs
@@ -135,6 +135,26 @@ pub struct GithubPullRequestComment {
pub updated_at: Option<DateTime<Utc>>,
/// The GitHub source for the comment, such as `issue_comment` or `review_comment`.
pub source: String,
+ /// The id of the comment this one replies to, when it is part of a review
+ /// thread. Only ever present on `review_comment` sources.
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ pub in_reply_to_id: Option<u64>,
+ /// The id of the pull request review this comment was submitted with.
+ /// Only ever present on `review_comment` sources.
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ pub pull_request_review_id: Option<u64>,
+ /// The repository-relative file path the review comment is anchored to.
+ /// Only ever present on `review_comment` sources.
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ pub path: Option<String>,
+ /// The line in the current diff the comment is anchored to. Cleared by
+ /// GitHub when later commits outdate the comment's diff.
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ pub line: Option<u64>,
+ /// The line the comment was originally anchored to, kept even when the
+ /// diff has since changed.
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ pub original_line: Option<u64>,
}
/// A check run associated with a GitHub pull request.
diff --git a/crates/github/src/domain/models/pull_request.rs b/crates/github/src/domain/models/pull_request.rs
index eb64a9c8e9..e647b5af39 100644
--- a/crates/github/src/domain/models/pull_request.rs
+++ b/crates/github/src/domain/models/pull_request.rs
@@ -113,6 +113,26 @@ pub struct GithubPullRequestComment {
pub updated_at: Option<chrono::DateTime<chrono::Utc>>,
/// The GitHub source for the comment, such as `issue_comment` or `review_comment`.
pub source: String,
+ /// The id of the comment this one replies to, when it is part of a review
+ /// thread. Only ever present on `review_comment` sources.
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ pub in_reply_to_id: Option<u64>,
+ /// The id of the pull request review this comment was submitted with.
+ /// Only ever present on `review_comment` sources.
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ pub pull_request_review_id: Option<u64>,
+ /// The repository-relative file path the review comment is anchored to.
+ /// Only ever present on `review_comment` sources.
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ pub path: Option<String>,
+ /// The line in the current diff the comment is anchored to. Cleared by
+ /// GitHub when later commits outdate the comment's diff.
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ pub line: Option<u64>,
+ /// The line the comment was originally anchored to, kept even when the
+ /// diff has since changed.
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ pub original_line: Option<u64>,
}
/// A check run associated with a GitHub pull request.
diff --git a/crates/github/src/domain/models/test.rs b/crates/github/src/domain/models/test.rs
index 22b091c52c..1b432f3a7f 100644
--- a/crates/github/src/domain/models/test.rs
+++ b/crates/github/src/domain/models/test.rs
@@ -54,6 +54,11 @@ fn pull_request_comment() -> GithubPullRequestComment {
created_at: Some(utc_datetime("2026-05-25T18:54:21Z")),
updated_at: Some(utc_datetime("2026-05-25T19:00:00Z")),
source: "issue_comment".to_string(),
+ in_reply_to_id: None,
+ pull_request_review_id: None,
+ path: None,
+ line: None,
+ original_line: None,
}
}
diff --git a/crates/github/src/domain/service/sync/test.rs b/crates/github/src/domain/service/sync/test.rs
index 8c1d77ec4a..fe86a062e0 100644
--- a/crates/github/src/domain/service/sync/test.rs
+++ b/crates/github/src/domain/service/sync/test.rs
@@ -1438,6 +1438,11 @@ fn pull_request_comment(id: u64, body: &str, source: &str) -> GithubPullRequestC
created_at: None,
updated_at: None,
source: source.to_string(),
+ in_reply_to_id: None,
+ pull_request_review_id: None,
+ path: None,
+ line: None,
+ original_line: None,
}
}
diff --git a/crates/github/src/outbound/pull_request_metadata.rs b/crates/github/src/outbound/pull_request_metadata.rs
index e73ee3f4c1..b024d3d86d 100644
--- a/crates/github/src/outbound/pull_request_metadata.rs
+++ b/crates/github/src/outbound/pull_request_metadata.rs
@@ -224,6 +224,13 @@ struct GithubCommentResponse {
html_url: Option<String>,
created_at: Option<chrono::DateTime<chrono::Utc>>,
updated_at: Option<chrono::DateTime<chrono::Utc>>,
+ // Review-thread linkage and diff anchor; GitHub only returns these for
+ // review comments.
+ in_reply_to_id: Option<u64>,
+ pull_request_review_id: Option<u64>,
+ path: Option<String>,
+ line: Option<u64>,
+ original_line: Option<u64>,
}
#[derive(Debug, serde::Deserialize)]
@@ -594,6 +601,11 @@ impl GithubCommentResponse {
created_at: self.created_at,
updated_at: self.updated_at,
source: source.to_string(),
+ in_reply_to_id: self.in_reply_to_id,
+ pull_request_review_id: self.pull_request_review_id,
+ path: self.path,
+ line: self.line,
+ original_line: self.original_line,
}
}
}
@@ -616,6 +628,11 @@ impl GithubReviewResponse {
created_at: self.submitted_at,
updated_at: None,
source: "review".to_string(),
+ in_reply_to_id: None,
+ pull_request_review_id: None,
+ path: None,
+ line: None,
+ original_line: None,
})
}
}
diff --git a/packages/sdk/generated/auth/types.gen.ts b/packages/sdk/generated/auth/types.gen.ts
index 639711cd15..0d1e27e1df 100644
--- a/packages/sdk/generated/auth/types.gen.ts
+++ b/packages/sdk/generated/auth/types.gen.ts
@@ -368,6 +368,31 @@ export type GithubPullRequestComment = {
* The unique GitHub identifier for the comment or review.
*/
id: number;
+ /**
+ * The id of the comment this one replies to, when it is part of a review
+ * thread. Only ever present on `review_comment` sources.
+ */
+ inReplyToId?: number | null;
+ /**
+ * The line in the current diff the comment is anchored to. Cleared by
+ * GitHub when later commits outdate the comment's diff.
+ */
+ line?: number | null;
+ /**
+ * The line the comment was originally anchored to, kept even when the
+ * diff has since changed.
+ */
+ originalLine?: number | null;
+ /**
+ * The repository-relative file path the review comment is anchored to.
+ * Only ever present on `review_comment` sources.
+ */
+ path?: string | null;
+ /**
+ * The id of the pull request review this comment was submitted with.
+ * Only ever present on `review_comment` sources.
+ */
+ pullRequestReviewId?: number | null;
/**
* The GitHub source for the comment, such as `issue_comment` or `review_comment`.
*/
diff --git a/packages/sdk/generated/storage/types.gen.ts b/packages/sdk/generated/storage/types.gen.ts
index 47aef0d2f6..a945b295e0 100644
--- a/packages/sdk/generated/storage/types.gen.ts
+++ b/packages/sdk/generated/storage/types.gen.ts
@@ -5102,6 +5102,31 @@ export type GithubPullRequestComment = {
* The unique GitHub identifier for the comment or review.
*/
id: number;
+ /**
+ * The id of the comment this one replies to, when it is part of a review
+ * thread. Only ever present on `review_comment` sources.
+ */
+ inReplyToId?: number | null;
+ /**
+ * The line in the current diff the comment is anchored to. Cleared by
+ * GitHub when later commits outdate the comment's diff.
+ */
+ line?: number | null;
+ /**
+ * The line the comment was originally anchored to, kept even when the
+ * diff has since changed.
+ */
+ originalLine?: number | null;
+ /**
+ * The repository-relative file path the review comment is anchored to.
+ * Only ever present on `review_comment` sources.
+ */
+ path?: string | null;
+ /**
+ * The id of the pull request review this comment was submitted with.
+ * Only ever present on `review_comment` sources.
+ */
+ pullRequestReviewId?: number | null;
/**
* The GitHub source for the comment, such as `issue_comment` or `review_comment`.
*/
diff --git a/packages/sdk/specs/auth.json b/packages/sdk/specs/auth.json
index 4a957eb9b2..7e0f962549 100644
--- a/packages/sdk/specs/auth.json
+++ b/packages/sdk/specs/auth.json
@@ -3930,6 +3930,34 @@
"description": "The unique GitHub identifier for the comment or review.",
"minimum": 0
},
+ "inReplyToId": {
+ "type": ["integer", "null"],
+ "format": "int64",
+ "description": "The id of the comment this one replies to, when it is part of a review\nthread. Only ever present on `review_comment` sources.",
+ "minimum": 0
+ },
+ "line": {
+ "type": ["integer", "null"],
+ "format": "int64",
+ "description": "The line in the current diff the comment is anchored to. Cleared by\nGitHub when later commits outdate the comment's diff.",
+ "minimum": 0
+ },
+ "originalLine": {
+ "type": ["integer", "null"],
+ "format": "int64",
+ "description": "The line the comment was originally anchored to, kept even when the\ndiff has since changed.",
+ "minimum": 0
+ },
+ "path": {
+ "type": ["string", "null"],
+ "description": "The repository-relative file path the review comment is anchored to.\nOnly ever present on `review_comment` sources."
+ },
+ "pullRequestReviewId": {
+ "type": ["integer", "null"],
+ "format": "int64",
+ "description": "The id of the pull request review this comment was submitted with.\nOnly ever present on `review_comment` sources.",
+ "minimum": 0
+ },
"source": {
"type": "string",
"description": "The GitHub source for the comment, such as `issue_comment` or `review_comment`."
diff --git a/packages/sdk/specs/storage.json b/packages/sdk/specs/storage.json
index f8db98f506..6abf51f2fb 100644
--- a/packages/sdk/specs/storage.json
+++ b/packages/sdk/specs/storage.json
@@ -18536,6 +18536,34 @@
"description": "The unique GitHub identifier for the comment or review.",
"minimum": 0
},
+ "inReplyToId": {
+ "type": ["integer", "null"],
+ "format": "int64",
+ "description": "The id of the comment this one replies to, when it is part of a review\nthread. Only ever present on `review_comment` sources.",
+ "minimum": 0
+ },
+ "line": {
+ "type": ["integer", "null"],
+ "format": "int64",
+ "description": "The line in the current diff the comment is anchored to. Cleared by\nGitHub when later commits outdate the comment's diff.",
+ "minimum": 0
+ },
+ "originalLine": {
+ "type": ["integer", "null"],
+ "format": "int64",
+ "description": "The line the comment was originally anchored to, kept even when the\ndiff has since changed.",
+ "minimum": 0
+ },
+ "path": {
+ "type": ["string", "null"],
+ "description": "The repository-relative file path the review comment is anchored to.\nOnly ever present on `review_comment` sources."
+ },
+ "pullRequestReviewId": {
+ "type": ["integer", "null"],
+ "format": "int64",
+ "description": "The id of the pull request review this comment was submitted with.\nOnly ever present on `review_comment` sources.",
+ "minimum": 0
+ },
"source": {
"type": "string",
"description": "The GitHub source for the comment, such as `issue_comment` or `review_comment`."