Repository navigation
feat: add wait support for job start - #304
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Negative timeouts are accepted before job submission, causing a later ValueError that bypasses cancellation and leaves the remote job running.
1 open issue
What changed in this PR
Adds optional synchronous execution to job start, reusing the existing job run completion, failure, and timeout handling while keeping asynchronous execution as the default.
Changes:
- Adds
--wait/-w,--timeout, and--polling_interval, rejecting wait-only options before submission when--waitis absent. - Adds regression tests for waiting, failures, option validation, timeout forwarding, cancellation, and
job runcompatibility. - Updates command help, documentation, examples, and release notes.
| File | Description |
|---|---|
tests/test_utils/test_fab_cmd_job_utils.py |
Tests wait-option validation and run compatibility. |
tests/test_core/test_fab_jobs.py |
Adds command-level waiting and timeout regression tests. |
src/fabric_cli/utils/fab_cmd_job_utils.py |
Rejects start wait-options when waiting is disabled. |
src/fabric_cli/parsers/fab_jobs_parser.py |
Adds wait flags and help examples. |
src/fabric_cli/errors/common.py |
Adds a reusable wait-option validation message. |
src/fabric_cli/commands/jobs/fab_jobs.py |
Honors the selected execution mode for job start. |
docs/examples/job_examples.md |
Demonstrates starting a job with waiting enabled. |
docs/commands/jobs/index.md |
Documents the new start options. |
.changes/unreleased/added-20261026-191106.yaml |
Records the new job start functionality. |
Review effort: Balanced
Alon Yeshurun (ayeshurun)
previously approved these changes
Oct 28, 2026
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The timeout validation tests lack negative-timeout regression cases for both job commands asserting ERROR_INVALID_INPUT and no submission API call, plus coverage confirming zero is accepted.
2 open issues
Review effort: Balanced
Alon Yeshurun (ayeshurun)
approved these changes
Nov 1, 2026
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:
Add --wait (-w) to job start so users can wait for job completion with the same completion, failure, and timeout handling as job run.
Preserve asynchronous execution by default.
Support --timeout and --polling_interval when --wait is specified.
Reject timeout and polling options on job start without --wait, before submitting the job.
Reuse existing polling and cancel-on-timeout behavior.
Update command help, documentation, and changelog.
Add regression tests for waiting, failure propagation, timeout option forwarding, cancellation, and validation, while preserving job run behavior.
Context
Users can now choose synchronous or asynchronous execution through job start without switching commands.
Dependencies:
No new dependencies.