Skip to content

Add chunk task status and chunk task watch for pipeline observability#435

Open
hidetaka-cci wants to merge 1 commit into
CircleCI-Public:mainfrom
hidetaka-cci:feat/task-status-watch
Open

Add chunk task status and chunk task watch for pipeline observability#435
hidetaka-cci wants to merge 1 commit into
CircleCI-Public:mainfrom
hidetaka-cci:feat/task-status-watch

Conversation

@hidetaka-cci

Copy link
Copy Markdown
Contributor
  • Add chunk task status <pipeline-id> to fetch and display pipeline/workflow/job state once.
  • Add chunk task watch <pipeline-id> to poll until workflows complete (--interval, --timeout).
  • Print a CircleCI web URL after chunk task run when pipeline metadata is available.
  • Extend the CircleCI client with GetPipeline, ListPipelineWorkflows, and ListWorkflowJobs.

Closes #

Motivation

Friction report 5-1 (task-run-status-observability.md): after chunk task run, users and agents had no CLI path to observe progress. The trigger path already authenticated to CircleCI; only status APIs and commands were missing.

Example

chunk task run --definition dev --prompt "Fix the flaky test"
# Run triggered: run-abc-123
# Pipeline:      pipeline-def-456
# URL:           https://app.circleci.com/pipelines/gh/org/repo/99/workflows/workflow-abc-789

chunk task status pipeline-def-456
# Pipeline:      pipeline-def-456
# Number:        99
# State:         created
# URL:           https://app.circleci.com/pipelines/gh/org/repo/99/workflows/workflow-abc-789
# Workflow:      chunk-task (running)

chunk task watch pipeline-def-456 --interval 5s --timeout 30m
# Polls until success or failure; exits non-zero on failure/timeout

Changes

Area Change
internal/circleci/client.go, types.go GetPipeline, ListPipelineWorkflows, ListWorkflowJobs
internal/task/status.go FetchStatus, WatchStatus, RunWebURL, terminal detection
internal/cmd/task.go task status, task watch; URL line on task run
internal/testing/fakes/circleci.go Fake pipeline/workflow/job handlers
docs/CLI.md Command tree + behavior notes
Tests internal/circleci/pipeline_test.go, internal/task/status_test.go, acceptance/task_test.go

Out of scope

  • chunk task logs
  • Resolving status from run ID (no public agents GET in client today)
  • TTY progress spinner or job log streaming

Test plan

  • go test -race ./internal/task/... ./internal/circleci/... ./acceptance/ -run 'TestFetchStatus|TestWatchStatus|TestPipelineWebURL|TestWorkflowTerminal|TestGetPipeline|TestListPipeline|TestTaskStatus|TestTaskWatch|TestTaskRunIncludesURL'
  • Unit: TestFetchStatus, TestFetchStatusNoWorkflows, TestWatchStatusSuccess, TestWatchStatusFailed, TestWatchStatusTimeout
  • Client: TestGetPipeline, TestListPipelineWorkflows, TestListWorkflowJobs
  • Acceptance: TestTaskStatus, TestTaskStatusJSON, TestTaskStatusMissingToken, TestTaskWatchSuccess, TestTaskWatchFailure, TestTaskRunIncludesURL

Users can now check pipeline progress from the CLI after task run, without opening the CircleCI web UI or calling the API manually.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant