Add gh run watch integration for immediate CI notification #260
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
Replaces polling-based CI status checking with
gh run watchfor immediate notification when workflow runs complete. This reduces CI feedback latency from the poll interval (default 10 minutes) to immediate notification.Before: Poll every 10 minutes, check if runs complete, fetch results
After: Watch runs directly with
gh run watch, fetch results exactly once when doneChanges
New Components
internal/db/scheduler.go): New scheduled task type for watching workflow runsinternal/control/): Handler that:gh run watch <run-id> --exit-statuswhich blocks until completionwatch_run_<id>) to prevent duplicate watchersModified Components
Documentation & Tooling
How It Works
Issues Resolved
Testing
handler_watch_run_test.go:All tests passing:
Notes
gh run watchreplaces polling only for CI/workflow runs. Periodic polling is still needed for:🤖 Generated with Claude Code