An approval, ask or park can be resolved by an operator, a rule, a classifier or automatically, so the vocabulary stops naming a person: - step type human.approve -> workflow.approve - park class needs_human -> needs_decision (ParkNeedsDecision) - event kinds human_* -> operator_* - alert kind task.needs_human -> task.needs_decision - status grouping "needs you" -> "needs attention" 0061 rewrites the stored values, including the approval step type in the workflow-definitions resource and each task's pinned definition, with the digest recomputed so resumed tasks still match.
124 lines
3.2 KiB
TypeScript
124 lines
3.2 KiB
TypeScript
// The freeze-dried /api/task-meta catalog the dashboard renders before the
|
|
// served one arrives, or when archied is unreachable; task-meta.ts replaces it
|
|
// with the live catalog.
|
|
|
|
/** A lifecycle status as the server describes it. */
|
|
export interface StatusMeta {
|
|
id: string;
|
|
label: string;
|
|
kind: string;
|
|
needs_attention?: boolean;
|
|
}
|
|
|
|
/** An operator control as the server describes it. */
|
|
export interface ActionMeta {
|
|
id: string;
|
|
label: string;
|
|
kind: string;
|
|
confirm?: string;
|
|
}
|
|
|
|
/** A changes_captured file status as the server describes it. */
|
|
export interface ChangeStatusMeta {
|
|
id: string;
|
|
label: string;
|
|
}
|
|
|
|
/** A retry worktree mode as the server describes it. */
|
|
export interface RetryModeMeta {
|
|
id: string;
|
|
label: string;
|
|
description: string;
|
|
default?: boolean;
|
|
requires_branch?: boolean;
|
|
}
|
|
|
|
export const DEFAULT_STATUSES: StatusMeta[] = [
|
|
{ id: "queued", label: "Queued", kind: "idle" },
|
|
{ id: "running", label: "Running", kind: "info" },
|
|
{
|
|
id: "waiting_approval",
|
|
label: "Waiting for approval",
|
|
kind: "warn",
|
|
needs_attention: true,
|
|
},
|
|
{ id: "pr_open", label: "In review", kind: "ok" },
|
|
{ id: "merged", label: "Merged", kind: "ok" },
|
|
{ id: "completed", label: "Done", kind: "ok" },
|
|
{ id: "parked", label: "Parked", kind: "warn", needs_attention: true },
|
|
{ id: "dead", label: "Stopped: retry cap", kind: "danger" },
|
|
{ id: "rejected", label: "Rejected", kind: "danger" },
|
|
{ id: "closed_wont_do", label: "Won't do", kind: "idle" },
|
|
];
|
|
|
|
export const DEFAULT_ACTIONS: ActionMeta[] = [
|
|
{
|
|
id: "cancel",
|
|
label: "Cancel",
|
|
kind: "quiet",
|
|
confirm: `Cancel "{title}"? Closes the issue.`,
|
|
},
|
|
{
|
|
id: "stop",
|
|
label: "Stop",
|
|
kind: "primary",
|
|
confirm: `Stop "{title}"? Work stays parked.`,
|
|
},
|
|
{ id: "approve", label: "Approve", kind: "primary" },
|
|
{ id: "rereview", label: "Re-review", kind: "quiet" },
|
|
{
|
|
id: "reject",
|
|
label: "Reject",
|
|
kind: "quiet",
|
|
confirm: `Reject "{title}"? Closes the issue.`,
|
|
},
|
|
{ id: "retry", label: "Retry", kind: "primary" },
|
|
{
|
|
id: "abandon",
|
|
label: "Abandon",
|
|
kind: "quiet",
|
|
confirm: `Abandon "{title}"? The issue stays open.`,
|
|
},
|
|
{
|
|
id: "archive",
|
|
label: "Archive",
|
|
kind: "quiet",
|
|
confirm: `Archive the local record for "{title}"?`,
|
|
},
|
|
{
|
|
id: "merge",
|
|
label: "Merge",
|
|
kind: "primary",
|
|
confirm: `Merge the pull request for "{title}"?`,
|
|
},
|
|
{ id: "open_pr", label: "Open PR", kind: "link" },
|
|
{ id: "open_issue", label: "Open issue", kind: "link" },
|
|
];
|
|
|
|
export const DEFAULT_CHANGE_STATUSES: ChangeStatusMeta[] = [
|
|
{ id: "added", label: "Added" },
|
|
{ id: "modified", label: "Modified" },
|
|
{ id: "deleted", label: "Deleted" },
|
|
{ id: "renamed", label: "Renamed" },
|
|
{ id: "typechange", label: "Type changed" },
|
|
];
|
|
|
|
export const DEFAULT_RETRY_MODES: RetryModeMeta[] = [
|
|
{
|
|
id: "refresh_onto_base",
|
|
label: "Refresh onto base",
|
|
description:
|
|
"Retry from the current base; discards pushed commits.",
|
|
default: true,
|
|
},
|
|
{
|
|
id: "continue_pushed_work",
|
|
label: "Continue pushed work",
|
|
description:
|
|
"Resume the pushed branch.",
|
|
requires_branch: true,
|
|
},
|
|
];
|
|
|
|
export const DEFAULT_CONFIG_SCHEMA = "archie/task-config@1";
|