fix(external-plugins): preserve cards during intake

Include submissions awaiting review or submitter fixes in the review board feed so refreshes preserve their existing state. Keep fast-track and approval gated on a ready intake state, and add regression coverage for card persistence across pending transitions.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 821f4796-505e-4fb8-96cf-0b5bbf80a636
This commit is contained in:
Aaron Powell
2026-10-13 13:01:19 +11:00
co-authored by Copilot App
parent a48dab5961
commit 666a521cd5
9 changed files with 131 additions and 32 deletions
@@ -29,7 +29,22 @@ function runGh(args, { input } = {}) {
});
}
export async function listReadyIssues(repo) {
export function mapBoardIssues(issues) {
const boardStates = new Set(["ready-for-review", "awaiting-review", "requires-submitter-fixes"]);
return issues
.filter((issue) => (issue.labels ?? []).some((label) => boardStates.has(label.name)))
.map((issue) => ({
number: issue.number,
title: issue.title,
author: issue.author?.login ?? "unknown",
createdAt: issue.createdAt,
updatedAt: issue.updatedAt,
url: issue.url,
labels: (issue.labels ?? []).map((label) => label.name),
}));
}
export async function listBoardIssues(repo) {
const out = await runGh([
"issue",
"list",
@@ -37,8 +52,6 @@ export async function listReadyIssues(repo) {
repo,
"--label",
"external-plugin",
"--label",
"ready-for-review",
"--state",
"open",
"--limit",
@@ -46,15 +59,7 @@ export async function listReadyIssues(repo) {
"--json",
"number,title,author,createdAt,updatedAt,labels,url",
]);
return JSON.parse(out).map((issue) => ({
number: issue.number,
title: issue.title,
author: issue.author?.login ?? "unknown",
createdAt: issue.createdAt,
updatedAt: issue.updatedAt,
url: issue.url,
labels: (issue.labels ?? []).map((label) => label.name),
}));
return mapBoardIssues(JSON.parse(out));
}
const FULL_JSON = ["-H", "Accept: application/vnd.github.full+json"];