feat(job): show if a job is recverable
This commit is contained in:
@@ -550,6 +550,16 @@ export interface JobSummary {
|
|||||||
last_run_at?: string;
|
last_run_at?: string;
|
||||||
last_outcome?: JobOutcome;
|
last_outcome?: JobOutcome;
|
||||||
running: boolean;
|
running: boolean;
|
||||||
|
/**
|
||||||
|
* `true` iff the job persists runs + findings to
|
||||||
|
* `jobs.recoverable_runs`. Consumed by the admin panel to decide
|
||||||
|
* whether the row is expandable (drawer with run history +
|
||||||
|
* findings) and to gate the retention/purge action — replaces
|
||||||
|
* the pre-K3 name-based allowlist that missed newly-added
|
||||||
|
* recoverable tenants (`storage_rotate` shipped first without a
|
||||||
|
* row-expand until this flag was added).
|
||||||
|
*/
|
||||||
|
recoverable: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -461,22 +461,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function isRecoverable(job: JobSummary): boolean {
|
function isRecoverable(job: JobSummary): boolean {
|
||||||
// Heuristic: recoverable jobs are the ones that publish runs via
|
// Backend authoritative source: the `recoverable` flag on
|
||||||
// `jobs.recoverable_runs`. There's no direct flag on JobSummary
|
// `JobSummary` is set at registration time by
|
||||||
// (Part 1 handlers and Part 2 adapters share the same summary
|
// `RecoverableAdapter::is_recoverable() -> true`. Every tenant
|
||||||
// shape by design). Name-based recognition is fine for now — the
|
// registered via `register_recoverable_job` flips it
|
||||||
// admin panel is the only consumer; broader use would call for
|
// automatically. No name-based allowlists — a new recoverable
|
||||||
// a `recoverable: bool` field in JobSummary.
|
// tenant is expandable in the UI as soon as it's registered.
|
||||||
return name_is_recoverable(job.name);
|
return job.recoverable;
|
||||||
}
|
|
||||||
function name_is_recoverable(name: string): boolean {
|
|
||||||
// K3 storage-key-rotation adds `storage_rotate` to the recoverable
|
|
||||||
// tenant set. Same shape as `storage_migration` — walks blobs,
|
|
||||||
// records findings, supports resume from cursor — so it needs the
|
|
||||||
// same expand/runs/findings surface.
|
|
||||||
return (
|
|
||||||
name.endsWith('_consistency') || name === 'storage_migration' || name === 'storage_rotate'
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Consistency batch shortcut — top button. Only shown when the
|
// Consistency batch shortcut — top button. Only shown when the
|
||||||
|
|||||||
@@ -1205,7 +1205,7 @@
|
|||||||
"jobs": {
|
"jobs": {
|
||||||
"tab": "Jobs",
|
"tab": "Jobs",
|
||||||
"title": "Jobs",
|
"title": "Jobs",
|
||||||
"hint": "Fires periodic + on-demand jobs. Consistency checks are safe to run at any time — they are read-only.",
|
"hint": "This section concerns internal jobs: periodic + on-demand jobs. Consistency checks are safe to run at any time — they are read-only.",
|
||||||
"run_all_consistency": "Run all consistency checks",
|
"run_all_consistency": "Run all consistency checks",
|
||||||
"run_deep": "Run deep",
|
"run_deep": "Run deep",
|
||||||
"run_deep_hint": "Also runs slow variants (blob re-hash, bitrot detection).",
|
"run_deep_hint": "Also runs slow variants (blob re-hash, bitrot detection).",
|
||||||
|
|||||||
Reference in New Issue
Block a user