Skip to content

Add --follow flag to depot ci run#522

Merged
kylegalbraith merged 1 commit into
mainfrom
add-follow-flag-ci-run
Jun 28, 2026
Merged

Add --follow flag to depot ci run#522
kylegalbraith merged 1 commit into
mainfrom
add-follow-flag-ci-run

Conversation

@claude

@claude claude Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Before / After

Before — to follow the logs of a run you triggered from the CLI, you had to scrape the Run: ID out of depot ci run's output and feed it into depot ci logs <id> --follow yourself, e.g.:

depot ci run --job build | awk '/^Run: /{print $2}' | xargs -I{} depot ci logs {} --follow

Afterdepot ci run ... --follow (or -f) streams the run's logs directly, as soon as the run starts:

depot ci run --job build --follow

How

Added --follow/-f to ci run. The follow streaming flow from ci logs (resolve target → follow-retry → reporter → stream) was extracted into a shared followRunLogs helper in the same ci package, and ci run calls it with resp.RunId after the run is triggered. The flag is mutually exclusive with --ssh/--ssh-after-step (guarded early with a clear error). The existing ci logs --follow behavior is unchanged. Build, vet, and tests pass.

Testing

go build ./..., go vet ./pkg/cmd/ci/..., and go test ./pkg/cmd/ci/... all pass.


Generated by Claude Code


Note

Low Risk
CLI-only refactor reusing existing log streaming; no auth or API contract changes beyond a new flag and validation.

Overview
depot ci run now accepts --follow / -f so a triggered workflow can stream live logs in the same terminal without copying the run ID into depot ci logs … --follow.

After the run starts, ci run calls shared helpers followRunLogs / followRunLogsWithReporter in the ci package. Those helpers encapsulate resolve log target → follow retry while jobs spin up → streamLogsWithFollowUX. depot ci logs <run-id> --follow uses the same path when run status is already loaded, so follow behavior stays aligned.

--follow cannot be used with --ssh or --ssh-after-step. With a single --job, that job is selected for logs; with multiple or all jobs, resolution auto-picks or prompts like ci logs.

Reviewed by Cursor Bugbot for commit 2d19f0c. Bugbot is set up for automated code reviews on this repo. Configure here.

Adds --follow/-f to `depot ci run`, which streams the triggered run's
logs once it starts, reusing the same streaming path as `ci logs
--follow` via a shared followRunLogs helper. The flag is mutually
exclusive with --ssh/--ssh-after-step.
@kylegalbraith kylegalbraith marked this pull request as ready for review June 27, 2026 18:32

@121watts 121watts 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.

Looks good to me. No blocking findings from the review pass

watts[bot]

@kylegalbraith kylegalbraith merged commit 26ccf98 into main Jun 28, 2026
11 checks passed
@kylegalbraith kylegalbraith deleted the add-follow-flag-ci-run branch June 28, 2026 09:27
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.

3 participants