From fd6273300a4754efb5e36e1403df56081ae451e8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 21 Oct 2025 00:51:09 +0000 Subject: [PATCH 1/3] Initial plan From a7d4162aab736ce4d64d2f09e948b70004decbfe Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 21 Oct 2025 00:58:51 +0000 Subject: [PATCH 2/3] Update spinner message to show download progress (downloaded / count) Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- pkg/cli/logs.go | 9 ++++++--- pkg/cli/logs_test.go | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pkg/cli/logs.go b/pkg/cli/logs.go index 8200bafcb36..e57620c740e 100644 --- a/pkg/cli/logs.go +++ b/pkg/cli/logs.go @@ -450,7 +450,7 @@ func DownloadWorkflowLogs(workflowName string, count int, startDate, endDate, ou } } - runs, totalFetched, err := listWorkflowRunsWithPagination(workflowName, batchSize, startDate, endDate, beforeDate, branch, beforeRunID, afterRunID, verbose) + runs, totalFetched, err := listWorkflowRunsWithPagination(workflowName, batchSize, startDate, endDate, beforeDate, branch, beforeRunID, afterRunID, len(processedRuns), count, verbose) if err != nil { return err } @@ -789,7 +789,9 @@ func downloadRunArtifactsConcurrent(runs []WorkflowRun, outputDir string, verbos // // The limit parameter specifies the batch size for the GitHub API call (how many runs to fetch in this request), // not the total number of matching runs the user wants to find. -func listWorkflowRunsWithPagination(workflowName string, limit int, startDate, endDate, beforeDate, branch string, beforeRunID, afterRunID int64, verbose bool) ([]WorkflowRun, int, error) { +// +// The processedCount and targetCount parameters are used to display progress in the spinner message. +func listWorkflowRunsWithPagination(workflowName string, limit int, startDate, endDate, beforeDate, branch string, beforeRunID, afterRunID int64, processedCount, targetCount int, verbose bool) ([]WorkflowRun, int, error) { args := []string{"run", "list", "--json", "databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle"} // Add filters @@ -819,7 +821,8 @@ func listWorkflowRunsWithPagination(workflowName string, limit int, startDate, e } // Start spinner for network operation - spinner := console.NewSpinner("Fetching workflow runs from GitHub...") + spinnerMsg := fmt.Sprintf("Fetching workflow runs from GitHub... (%d / %d)", processedCount, targetCount) + spinner := console.NewSpinner(spinnerMsg) if !verbose { spinner.Start() } diff --git a/pkg/cli/logs_test.go b/pkg/cli/logs_test.go index 55c5a4cd396..e2c2fbe52bd 100644 --- a/pkg/cli/logs_test.go +++ b/pkg/cli/logs_test.go @@ -361,7 +361,7 @@ func TestListWorkflowRunsWithPagination(t *testing.T) { // This should fail with authentication error (if not authenticated) // or succeed with empty results (if authenticated but no workflows match) - runs, _, err := listWorkflowRunsWithPagination("nonexistent-workflow", 5, "", "", "2024-01-01T00:00:00Z", "", 0, 0, false) + runs, _, err := listWorkflowRunsWithPagination("nonexistent-workflow", 5, "", "", "2024-01-01T00:00:00Z", "", 0, 0, 0, 5, false) if err != nil { // If there's an error, it should be an authentication error or workflow not found From 4a03f0c5e69cf9fa2afc22aa2bddb0680fcb8109 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 21 Oct 2025 01:07:59 +0000 Subject: [PATCH 3/3] Add changeset for progress indicator improvement --- .changeset/patch-progress-indicator-workflow-runs.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/patch-progress-indicator-workflow-runs.md diff --git a/.changeset/patch-progress-indicator-workflow-runs.md b/.changeset/patch-progress-indicator-workflow-runs.md new file mode 100644 index 00000000000..9148c462534 --- /dev/null +++ b/.changeset/patch-progress-indicator-workflow-runs.md @@ -0,0 +1,5 @@ +--- +"gh-aw": patch +--- + +Add progress indicator to workflow runs fetching spinner