Factory acceptance phase and issue restart
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3f39f4bd65
commit
e09e295f60
8 files changed
+246
-8
No files matched your search
@@ -57,6 +57,7 @@ interface Issue {
|
||||
state: string;
|
||||
note: string;
|
||||
pr_url: string;
|
||||
branch: string;
|
||||
rounds: number;
|
||||
created_at: number;
|
||||
updated_at: number;
|
||||
@@ -98,8 +99,8 @@ const COLUMNS: { id: string; states: string[] }[] = [
|
||||
{ id: "review", states: ["new", "review"] },
|
||||
{ id: "question", states: ["question"] },
|
||||
{ id: "approved", states: ["approved"] },
|
||||
{ id: "build", states: ["building", "built"] },
|
||||
{ id: "qa", states: ["qa"] },
|
||||
{ id: "build", states: ["building", "rework"] },
|
||||
{ id: "qa", states: ["qa", "testing"] },
|
||||
{ id: "done", states: ["done"] },
|
||||
{ id: "failed", states: ["failed", "rejected"] },
|
||||
];
|
||||
@@ -217,6 +218,21 @@ function FactoryOverview({ onSettings }: { onSettings: () => void }) {
|
||||
}
|
||||
};
|
||||
|
||||
const restart = async (to: "new" | "approved" | "qa") => {
|
||||
if (!selected) return;
|
||||
setBusy(true);
|
||||
try {
|
||||
await post("/factory/issues/restart", { repo: selected.repo, number: selected.number, to });
|
||||
toast(t("factory.restarted"));
|
||||
await reload();
|
||||
} catch (e: any) {
|
||||
toast(e.message);
|
||||
} finally {
|
||||
setBusy(false);
|
||||
}
|
||||
};
|
||||
const phaseRunning = !!selected && ["review", "building", "testing"].includes(selected.state);
|
||||
|
||||
return (
|
||||
<>
|
||||
{!data.area && <div className="notice err">{t("factory.noArea")}</div>}
|
||||
@@ -316,6 +332,20 @@ function FactoryOverview({ onSettings }: { onSettings: () => void }) {
|
||||
<div className="row">
|
||||
<h3 style={{ margin: 0 }}>{selected ? `${repoName(selected.repo)} #${selected.number} – ${selected.title}` : t("factory.latestRuns")}</h3>
|
||||
<span className="spacer" />
|
||||
{selected && !phaseRunning && (
|
||||
<>
|
||||
<span className="hint">{t("factory.restartAt")}</span>
|
||||
<button className="small" onClick={() => restart("new")} disabled={busy}>
|
||||
{t("factory.col.review")}
|
||||
</button>
|
||||
<button className="small" onClick={() => restart("approved")} disabled={busy}>
|
||||
{t("factory.col.build")}
|
||||
</button>
|
||||
<button className="small" onClick={() => restart("qa")} disabled={busy || !selected.branch}>
|
||||
{t("factory.col.qa")}
|
||||
</button>
|
||||
</>
|
||||
)}
|
||||
{selected && (
|
||||
<>
|
||||
<a className="small ghost button-link" href={issueUrl(selected.repo, selected.number)} target="_blank" rel="noreferrer">
|
||||
|
||||
Reference in new issue
Block a user