Skip to content

Fold timeout and retry policy into std_run #88

Description

@codeforester

Summary

Enhance std_run so it remains the single blessed command runner for simple execution, timeout-only execution, retry-only execution, and timeout+retry execution.

Desired API

std_run [--no-exit] [--quiet] [--timeout N] [--max-attempts N] [--retry-delay N] [--] command [args...]

Semantics

  • Existing std_run command ... behavior remains unchanged.
  • --timeout N applies a per-attempt timeout and returns/preserves status 124 on timeout.
  • --max-attempts N is total attempts, defaulting to 1.
  • --retry-delay N sleeps between failed attempts, defaulting to 0 seconds.
  • Retry is opt-in only when --max-attempts is greater than 1.
  • Dry-run mode logs the execution policy and never runs or loops.
  • -- ends std_run option parsing so command arguments can begin with option-looking tokens.
  • Keep std_run_with_timeout as a compatibility wrapper, but deprecate it in docs after verifying Base does not use it.

Validation

  • Add BATS coverage for timeout-only, retry-only, timeout+retry, invalid option values, dry-run output, and compatibility wrapper behavior.
  • Verify the Base repo has no std_run_with_timeout call sites before documenting deprecation.
  • Run the full validation suite.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or product improvement

Type

No type
No fields configured for issues without a type.

Projects

Status
Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions