fix: accept latest sentinel report option (#930)
Co-authored-by: Codex <codex@noreply.local>
This commit is contained in:
@@ -60,7 +60,7 @@ export function parseNodeWebProbeSentinelOptions(args: string[]): NodeWebProbeSe
|
||||
"--run-id",
|
||||
"--trace-id",
|
||||
"--sample-seq",
|
||||
]), new Set(["--dry-run", "--confirm", "--wait", "--quick-verify", "--raw"]));
|
||||
]), new Set(["--dry-run", "--confirm", "--wait", "--quick-verify", "--raw", "--latest"]));
|
||||
const node = requiredOption(args, "--node");
|
||||
assertNodeId(node);
|
||||
const lane = requiredOption(args, "--lane");
|
||||
@@ -105,6 +105,9 @@ export function parseNodeWebProbeSentinelOptions(args: string[]): NodeWebProbeSe
|
||||
sentinel = { kind: "validate", action: "validate", node, lane, dryRun, confirm, wait: args.includes("--wait"), timeoutSeconds, quickVerify: args.includes("--quick-verify") };
|
||||
} else {
|
||||
const view = parseWebProbeSentinelReportView(optionValue(args, "--view") ?? "summary");
|
||||
const latest = args.includes("--latest");
|
||||
const runId = optionValue(args, "--run") ?? optionValue(args, "--run-id") ?? null;
|
||||
if (latest && runId !== null) throw new Error("web-probe sentinel report accepts --latest or --run/--run-id, not both");
|
||||
const sampleSeqRaw = optionValue(args, "--sample-seq") ?? null;
|
||||
const sampleSeq = sampleSeqRaw === null ? null : Number(sampleSeqRaw);
|
||||
if (sampleSeq !== null && (!Number.isInteger(sampleSeq) || sampleSeq < 1)) throw new Error("web-probe sentinel report --sample-seq must be a positive integer");
|
||||
@@ -114,7 +117,8 @@ export function parseNodeWebProbeSentinelOptions(args: string[]): NodeWebProbeSe
|
||||
node,
|
||||
lane,
|
||||
view,
|
||||
runId: optionValue(args, "--run") ?? optionValue(args, "--run-id") ?? null,
|
||||
runId,
|
||||
latest,
|
||||
traceId: optionValue(args, "--trace-id") ?? null,
|
||||
sampleSeq,
|
||||
raw: args.includes("--raw"),
|
||||
|
||||
Reference in New Issue
Block a user