feat(workflows): make shell step timeout configurable (#3327)
Summary
Closes #3327. The workflow shell step hardcoded a 300-second subprocess timeout with no way to override it, so any command that legitimately runs longer than five minutes — a full build, a MegaLinter/golangci-lint aggregator, an integration-test target — was killed with TimeoutExpired and failed the entire run. There was no YAML knob to raise the limit, which made shell steps unusable as a probe/gate over real project QA commands.
Changes
- Add an optional
timeoutfield (seconds) to the shell step, read viaconfig.get("timeout", 300)and threaded intosubprocess.run. Defaults to 300 so existing workflows are unaffected. - The timeout failure message now reports the configured value instead of a hardcoded 300.
validaterejects atimeoutthat is not a positive number.boolis rejected explicitly — it is anintsubclass, buttimeout: trueis a config error, not a duration.
- id: qa
type: shell
timeout: 1800 # seconds; optional, default 300
run: make code-qa
Acceptance criteria (from the issue)
- [x] A
timeout:value overrides the 300s default and is honored bysubprocess.run. - [x] Omitting
timeout:preserves current behavior (300s). - [x]
validaterejects a non-positive or non-numerictimeout. - [x] A test asserts the configured value is threaded through.
Testing
Seven new tests under TestShellStep:
- configured
timeoutis passed tosubprocess.run - default 300 preserved when omitted
- timeout error message reflects the configured value
validaterejects non-positive (0,-30) and non-numeric ("30",True) valuesvalidateaccepts positiveint/float
pytest tests/test_workflows.py::TestShellStep → 13 passed. Confirmed the behavior-changing tests fail without the source change (test-the-test via git stash).
🤖 Generated with Claude Code
Please address Copilot feedback
Thank you!