Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/command-inventory.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ enabled: run `brigade extras on` once, or set `BRIGADE_EXTRAS=1`.
- `brigade route`: 1 command path(s)
- `brigade run`: 1 command path(s)
- `brigade runbook` (extras): 5 command path(s)
- `brigade runs`: 8 command path(s)
- `brigade runs`: 9 command path(s)
- `brigade scrub`: 1 command path(s)
- `brigade search`: 6 command path(s)
- `brigade security`: 15 command path(s)
Expand Down Expand Up @@ -443,6 +443,7 @@ enabled: run `brigade extras on` once, or set `BRIGADE_EXTRAS=1`.
- `brigade runs latest`
- `brigade runs list`
- `brigade runs recover`
- `brigade runs redact`
- `brigade runs resume`
- `brigade runs show`
- `brigade runs steer`
Expand Down
47 changes: 47 additions & 0 deletions src/brigade/cli/runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,42 @@ def register(sub: argparse._SubParsersAction) -> None:
default=None,
help="Explicit runs directory for run ids. Defaults to .brigade/runs under --cwd.",
)
p_runs_redact = runs_sub.add_parser(
"redact",
help="Run the explicit operator procedure for lifecycle journal redaction.",
)
p_runs_redact.add_argument("run", help="Run directory path, run id under --runs-dir, or 'latest'.")
p_runs_redact.add_argument(
"--cwd",
type=Path,
default=Path("."),
help="Workspace whose default .brigade/runs directory should be used for run ids.",
)
p_runs_redact.add_argument(
"--runs-dir",
type=Path,
default=None,
help="Explicit runs directory for run ids. Defaults to .brigade/runs under --cwd.",
)
p_runs_redact.add_argument("--from-sequence", dest="sequence_start", type=int, default=None)
p_runs_redact.add_argument("--to-sequence", dest="sequence_end", type=int, default=None)
p_runs_redact.add_argument(
"--reason",
default=None,
help="Closed incident reason code; never include the private value.",
)
p_runs_redact.add_argument(
"--cleanup-quarantine",
dest="cleanup_operation",
default=None,
metavar="OPERATION_ID",
help="Explicitly remove a previously verified quarantine.",
)
p_runs_redact.add_argument(
"--operator-confirm",
action="store_true",
help="Confirm this operator-only incident procedure.",
)
p_runs_resume = runs_sub.add_parser(
"resume", help="Re-attach interrupted app-server workers from a run and re-synthesize."
)
Expand Down Expand Up @@ -148,6 +184,17 @@ def dispatch(args) -> int:
return _control_request(args.run, cwd=args.cwd, runs_dir=args.runs_dir, payload=payload)
if args.runs_command == "recover":
return runs_cmd.recover(args.run, cwd=args.cwd, runs_dir=args.runs_dir)
if args.runs_command == "redact":
return runs_cmd.redact(
args.run,
cwd=args.cwd,
runs_dir=args.runs_dir,
sequence_start=args.sequence_start,
sequence_end=args.sequence_end,
reason=args.reason,
operator_confirmed=args.operator_confirm,
cleanup_operation=args.cleanup_operation,
)
if args.runs_command == "resume":
return runs_cmd.resume(args.run_dir)
args._brigade_parser.error(f"unknown runs command: {args.runs_command}")
Expand Down
Loading
Loading