Skip to content

feat(workflows): make shell step timeout configurable#3404

Merged
mnriem merged 3 commits into
github:mainfrom
marcelsafin:fix/3327-shell-timeout
Jul 9, 2026
Merged

feat(workflows): make shell step timeout configurable#3404
mnriem merged 3 commits into
github:mainfrom
marcelsafin:fix/3327-shell-timeout

Conversation

@marcelsafin

Copy link
Copy Markdown
Contributor

Description

Fixes #3327

The shell step hardcoded timeout=300 in its subprocess.run call, so any workflow gate longer than 5 minutes (full builds, linter aggregators, integration tests) died with TimeoutExpired regardless of whether the command would pass.

The step now reads an optional timeout field (seconds), defaulting to 300 for backward compatibility:

- id: qa
  type: shell
  timeout: 1800
  run: make code-qa

validate rejects non-integer, boolean, zero, negative, and null values, and the timeout error message reports the configured value instead of a hardcoded 300.

Testing

  • Tested locally with uv run specify --help
  • Ran existing tests with uv sync && uv run pytest (3819 passed)
  • Tested with a sample project (if applicable)

Six new tests in TestShellStep: override reaches subprocess.run, default stays 300, timeout error reports the configured value, validation rejects bad values (including True and YAML-null), and accepts a positive integer.

AI Disclosure

  • I did not use AI assistance for this contribution
  • I did use AI assistance (describe below)

Written with GitHub Copilot CLI; I reviewed the diff and test results.

The shell step hardcoded a 300s subprocess timeout, killing any
legitimate long-running QA command. Read an optional timeout field
(seconds, positive integer, default 300) and validate it.

Fixes github#3327

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 8, 2026 08:38
@marcelsafin marcelsafin requested a review from mnriem as a code owner July 8, 2026 08:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes the workflow shell step’s execution timeout configurable via an optional timeout (seconds) field, defaulting to 300 seconds for backward compatibility, and updates validation and error reporting accordingly.

Changes:

  • Thread a per-step timeout value through ShellStep.execute() (default 300s) and report the configured timeout in TimeoutExpired errors.
  • Add ShellStep.validate() checks to reject invalid timeout values (non-int, bool, <= 0, null).
  • Add tests covering override/default behavior, timeout error messaging, and validation acceptance/rejection.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/specify_cli/workflows/steps/shell/__init__.py Reads timeout from step config, passes it to subprocess.run, updates timeout error text, and validates timeout values.
tests/test_workflows.py Adds TestShellStep coverage for configurable timeouts, defaults, error messaging, and validation rules.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/specify_cli/workflows/steps/shell/__init__.py
Comment thread tests/test_workflows.py
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 8, 2026 08:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread src/specify_cli/workflows/steps/shell/__init__.py
The engine does not auto-validate step config, so a string or null
timeout would reach subprocess.run() and crash the run with a
TypeError. Fall back to the 300s default for malformed values,
mirroring how the engine treats unvalidated continue_on_error.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 8, 2026 08:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review details

  • Files reviewed: 2/2 changed files
  • Comments generated: 0 new
  • Review effort level: Low

@mnriem mnriem merged commit eedf73f into github:main Jul 9, 2026
12 checks passed
@mnriem

mnriem commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Thank you!

kanfil added a commit to tikalk/agentic-sdlc-spec-kit that referenced this pull request Jul 11, 2026
Upstream merge (30 commits, 3 releases 0.12.9-0.12.11):
- invoke_separator parse-success fix (github#3304)
- Windows Store python3 stub skip + _interpreter_runs() probe (github#3385)
- SKILL.md frontmatter control char escape via yaml_quote() (github#3399)
- chained expression filters left-to-right refactor (github#3339)
- refresh_shared_templates preserves recovered files (github#3378)
- Goose yaml skill placeholder resolution (github#3374)
- bundled version pin enforcement (github#3377)
- integration test home isolation (github#3144)
- py: script type in command templates (github#3403)
- configurable shell step timeout (github#3404)
- find plans in nested spec directories (github#3405)
- plan.md phase numbering fix (github#3416)
- PowerShell -Number 0 honor via ContainsKey (github#3412)
- workflow.yml non-string scalar validation (github#3421)
- plan-template.md self-referencing path fix (github#3417)
- pre-commit config + trailing whitespace cleanup (github#3430)
- malformed URL error handling (github#3433/github#3435/github#3437)
- agent-context nested plan.md discovery (github#3301)
- community catalog additions (EARS, Figma) (github#3407/github#3408)

9 conflicts resolved: pyproject.toml, integrations/base.py, agents.py,
forge/__init__.py, hermes/__init__.py, create-new-feature-branch.ps1,
test_git_extension.py, test_base.py, test_integration_devin.py.

Template-to-preset alignment: added py: script lines to 6 preset commands,
removed stale Phase 1 agent context line from plan preset, fixed phase
numbering. Pre-merge fix: wrapped bare make_typer import with fallback.

Assisted-by: opencode (model: glm-5.2, autonomous)
kanfil added a commit to tikalk/agentic-sdlc-spec-kit that referenced this pull request Jul 11, 2026
Upstream merge (30 commits, 3 releases 0.12.9-0.12.11):
- invoke_separator parse-success fix (github#3304)
- Windows Store python3 stub skip + _interpreter_runs() probe (github#3385)
- SKILL.md frontmatter control char escape via yaml_quote() (github#3399)
- chained expression filters left-to-right refactor (github#3339)
- refresh_shared_templates preserves recovered files (github#3378)
- Goose yaml skill placeholder resolution (github#3374)
- bundled version pin enforcement (github#3377)
- integration test home isolation (github#3144)
- py: script type in command templates (github#3403)
- configurable shell step timeout (github#3404)
- find plans in nested spec directories (github#3405)
- plan.md phase numbering fix (github#3416)
- PowerShell -Number 0 honor via ContainsKey (github#3412)
- workflow.yml non-string scalar validation (github#3421)
- plan-template.md self-referencing path fix (github#3417)
- pre-commit config + trailing whitespace cleanup (github#3430)
- malformed URL error handling (github#3433/github#3435/github#3437)
- agent-context nested plan.md discovery (github#3301)
- community catalog additions (EARS, Figma) (github#3407/github#3408)

9 conflicts resolved: pyproject.toml, integrations/base.py, agents.py,
forge/__init__.py, hermes/__init__.py, create-new-feature-branch.ps1,
test_git_extension.py, test_base.py, test_integration_devin.py.

Template-to-preset alignment: added py: script lines to 6 preset commands,
removed stale Phase 1 agent context line from plan preset, fixed phase
numbering. Pre-merge fix: wrapped bare make_typer import with fallback.

Assisted-by: opencode (model: glm-5.2, autonomous)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Make the shell step's execution timeout configurable (currently hardcoded to 300s)

3 participants