diff --git a/server/github/queries.ts b/server/github/queries.ts index e4b7fa7..75662bb 100644 --- a/server/github/queries.ts +++ b/server/github/queries.ts @@ -11,6 +11,7 @@ export const LIST_QUERY = /* GraphQL */ ` title url isDraft + mergeable updatedAt author { login } headRefName @@ -34,6 +35,7 @@ export interface ListPr { title: string; url: string; isDraft: boolean; + mergeable: 'MERGEABLE' | 'CONFLICTING' | 'UNKNOWN'; updatedAt: string; author: { login: string } | null; headRefName: string; diff --git a/server/poller.ts b/server/poller.ts index 4ab18c3..4fbee59 100644 --- a/server/poller.ts +++ b/server/poller.ts @@ -37,6 +37,7 @@ function signature(pr: ListPr): string { pr.reviews.totalCount, pr.latestReviews.nodes.map((r) => `${r.author?.login}:${r.state}`), pr.labels.nodes.map((l) => l.name).sort(), + pr.mergeable, ]), ) .digest('hex'); @@ -82,6 +83,7 @@ function buildSnapshot(config: AppConfig, pr: ListPr, detail: DetailPr | undefin url: pr.url, author: pr.author?.login ?? 'ghost', isDraft: pr.isDraft, + mergeable: pr.mergeable, branch: pr.headRefName, updatedAt: pr.updatedAt, labels, diff --git a/shared/types.ts b/shared/types.ts index 4adb25d..0324b79 100644 --- a/shared/types.ts +++ b/shared/types.ts @@ -34,6 +34,8 @@ export interface PrSnapshot { url: string; author: string; isDraft: boolean; + /** GitHub's merge-conflict state; UNKNOWN while GitHub is still computing it. */ + mergeable: 'MERGEABLE' | 'CONFLICTING' | 'UNKNOWN'; branch: string; updatedAt: string; labels: string[]; diff --git a/web/src/components/PrCard.tsx b/web/src/components/PrCard.tsx index 9155271..27bafcc 100644 --- a/web/src/components/PrCard.tsx +++ b/web/src/components/PrCard.tsx @@ -38,6 +38,7 @@ export default function PrCard({