feat(workflows): make shell step timeout configurable (#3327)#3328
Open
Noor-ul-ain001 wants to merge 1 commit into
Open
feat(workflows): make shell step timeout configurable (#3327)#3328Noor-ul-ain001 wants to merge 1 commit into
Noor-ul-ain001 wants to merge 1 commit into
Conversation
The `shell` step hardcoded a 300s subprocess timeout, so any command that legitimately runs longer than five minutes (a full build, a linter aggregator, an integration-test target) was killed with TimeoutExpired and failed the whole run, with no YAML knob to raise the limit. Add an optional `timeout` field (seconds) that defaults to 300 for backward compatibility and is threaded through to `subprocess.run`. The timeout failure message now reports the configured value instead of a hardcoded 300. `validate` rejects a `timeout` that is not a positive number (bool is rejected explicitly, since it is an int subclass but a config error rather than a duration). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #3327. The workflow
shellstep 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 withTimeoutExpiredand failed the entire run. There was no YAML knob to raise the limit, which madeshellsteps unusable as a probe/gate over real project QA commands.Changes
timeoutfield (seconds) to the shell step, read viaconfig.get("timeout", 300)and threaded intosubprocess.run. Defaults to 300 so existing workflows are unaffected.validaterejects atimeoutthat is not a positive number.boolis rejected explicitly — it is anintsubclass, buttimeout: trueis a config error, not a duration.Acceptance criteria (from the issue)
timeout:value overrides the 300s default and is honored bysubprocess.run.timeout:preserves current behavior (300s).validaterejects a non-positive or non-numerictimeout.Testing
Seven new tests under
TestShellStep:timeoutis passed tosubprocess.runvalidaterejects non-positive (0,-30) and non-numeric ("30",True) valuesvalidateaccepts positiveint/floatpytest tests/test_workflows.py::TestShellStep→ 13 passed. Confirmed the behavior-changing tests fail without the source change (test-the-test viagit stash).🤖 Generated with Claude Code