fix(workflow:watch): increase poll interval to 10s and add 30min default timeout#2809
fix(workflow:watch): increase poll interval to 10s and add 30min default timeout#2809
Conversation
50e9cbe to
cc3d691
Compare
|
The failing checks ( |
cc3d691 to
fe7ceac
Compare
- Replace fixed 5s interval with two-phase polling: 10s for first 30 polls (~5 min warmup), then 30s steady-state - Replace --checks with --timeout (minutes); default 15 min, 0 = unlimited - Emit a warning on timeout explaining how to override - Extract sleep() to a protected method for testability - Add unit tests covering interval switching, timeout, and unlimited mode Prevents runaway API call volumes when workflow:watch is left running unattended in CI/CD pipelines with no timeout.
fe7ceac to
47c7503
Compare
|
I noticed I'm wondering if we should consider this a breaking change though? I'm not sure how widely A few options we could consider:
|
| * | ||
| * @command workflow:watch | ||
| * | ||
| * @option integer $checks Times to query |
There was a problem hiding this comment.
Can't remove the "checks" option, as that would be a breaking change.
There was a problem hiding this comment.
I agree with the change in principle. This is actually a good example of something that would go on a 5.x branch.
greg-1-anderson
left a comment
There was a problem hiding this comment.
We need to ensure that existing CI scripts that call Terminus with existing options e.g. --checks should continue to work, even if the removed option is ignored. Maybe convert "checks" into an roughly equivalent timeout period?
|
Agree, @JGrubb if We could also flag |
|
Whether it's part of this PR or another one, the tests will need to work again for terminus to release again. Working backwards from there, there's little reason to merge a PR while the tests are failing if you can't release the changes anyway until the tests are working. |
Summary
terminus workflow:watchpreviously polled at a fixed 5-second interval with no default timeout, which could result in extremely high API call volumes when left running unattended in CI/CD pipelines.Changes
Two-phase polling
Replaces the fixed 5s interval with a simple two-phase schedule:
--timeoutreplaces--checksThe new
--timeoutoption accepts a duration in minutes (default: 15). The command exits with a warning when the timeout is reached. Pass--timeout=0for unlimited (previous default behavior).Unit tests
Added
tests/Unit/Commands/Workflow/WatchCommandTest.phpcovering:--timeout=0never triggers the timeout guard