Skip to content

Fix logs workflow resolution in large repositories - #59502

Merged
pelikhan merged 3 commits into
mainfrom
copilot/logs-command-investigation
Sep 8, 2026
Merged

pelikhan merged 3 commits into
mainfrom
copilot/logs-command-investigation

Conversation

Copilot AI commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

gh aw logs incorrectly reported remote workflows as missing when repositories contained more than 50 workflows. Remote discovery inherited gh workflow list’s default result limit, truncating the resolver’s workflow map.

Changes

  • Request up to 1,000 workflows during remote discovery:
    gh workflow list --all --limit 1000
  • Add regression coverage verifying that discovery overrides the GitHub CLI default limit.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • github.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "github.com"

See Network Configuration for more information.

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 27.1 AIC · ⌖ 8.66 AIC · ⊞ 8.9K · ◷
Comment /souschef to run again

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI requested a review from pelikhan September 8, 2026 17:18
@pelikhan
pelikhan marked this pull request as ready for review September 8, 2026 17:22
Copilot AI balanced review requested due to automatic review settings September 8, 2026 17:22
@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Lean already. Ship.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • ab.chatgpt.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "ab.chatgpt.com"

See Network Configuration for more information.

Generated by Ponytail Reviewer for #59502

@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.

No ADR enforcement needed: PR does not have the implementation label and has ≤100 new lines of code in business logic directories.

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

No PR review comments were emitted because the diff only adds a gh workflow list limit override and matching regression coverage, and I found no actionable review findings.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • github.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "github.com"

See Network Configuration for more information.

🔎 Code quality review by PR Code Quality Reviewer

Copilot AI 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.

🟢 Approval recommended

The focused change correctly addresses the default-limit truncation and includes adequate regression coverage.

Pull request overview

Fixes remote workflow discovery truncation in repositories with more than 50 workflows.

Changes:

  • Raises the gh workflow list limit to 1,000.
  • Adds regression coverage for the explicit limit.
  • Documents existing large-function lint exceptions.
File summaries
File Description
pkg/cli/workflows.go Expands remote workflow discovery.
pkg/cli/workflows_test.go Verifies the new CLI arguments.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Comment Memory

reviewed_at: 2026-09-08T17:26:53Z
review_event: COMMENT
top_themes:
  - remote workflow discovery now overrides gh CLI's default 50-item cap
  - regression coverage verifies the limit argument is passed to gh workflow list
files_reviewed:
  - pkg/cli/workflows.go
  - pkg/cli/workflows_test.go
comment_count: 0

Note

This comment is managed by comment memory.

It stores persistent context for this thread in the code block at the top of this comment.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • github.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "github.com"

See Network Configuration for more information.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 23 AIC · ⌖ 7.29 AIC · ⊞ 21.8K · ◷
Comment /review to run again

@github-actions github-actions Bot 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.

Skills-Based Review 🧠

Applied /diagnosing-bugs — small, well-tested fix for the immediate 50-workflow truncation bug, with one comment requesting changes.

📋 Key Themes & Highlights

Key Themes

  • Fix addresses reported symptom, not the general class of bug: raising --limit from 50 (gh CLI default) to 1000 fixes the reported case but a repo with >1000 workflows would hit the identical silent-truncation bug. True pagination (as done elsewhere in this file for run listing) would close the issue for good.

Positive Highlights

  • ✅ Root cause correctly diagnosed and documented in the PR description (gh CLI's default --limit 50).
  • ✅ Regression test added (TestFetchGitHubWorkflows_RequestsAllWorkflows) using a fake gh shim to assert the CLI args, following the existing test patterns in this file (TestFetchGitHubWorkflows_ContextCancellation).
  • ✅ Minimal, surgical diff — no unrelated behavior changes.

Note: skill selection used the fallback heuristic (pr-triage was not invoked in this run) — classified as a bug fix based on PR title/description and diff shape.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · 26.8 AIC · ⌖ 14.7 AIC · ⊞ 10.3K
Comment /matt to run again

Comment thread pkg/cli/workflows.go Outdated
}

args := []string{"workflow", "list", "--all", "--json", "id,name,path,state"}
args := []string{"workflow", "list", "--all", "--limit", "1000", "--json", "id,name,path,state"}

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.

[/diagnosing-bugs] Good root-cause fix for the 50-workflow truncation, but this trades one hardcoded ceiling for another: repos with >1000 workflows will still silently truncate the map with no error or warning surfaced to the user. Root cause is gh workflow list's default limit — the more robust fix is to paginate (loop with --limit/cursor until fewer results than requested are returned, as listWorkflowRunsWithPagination already does elsewhere in this package) or at minimum log a warning when len(workflows) == 1000 since that's a strong signal of further truncation.

💡 Why this matters

The original bug report was about silent truncation causing incorrect "missing workflow" diagnostics. Raising the ceiling from 50 to 1000 fixes today's reported case but reintroduces the exact same failure mode for any repo that crosses the new threshold — and by then the regression test here (TestFetchGitHubWorkflows_RequestsAllWorkflows) only asserts the --limit 1000 flag is present, not that discovery is actually complete for large workflow counts.

@copilot please address this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated fetchGitHubWorkflows to use the paginated Actions workflows API (gh api --paginate --slurp with 100-item pages), so discovery no longer has a 1,000-workflow ceiling. The regression test now returns two API pages and verifies both workflows are included.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator
pr-sous-chef

@copilot Please address the remaining blocking review feedback on PR #59502.

  • Resolve the open review thread from github-actions: Fix logs workflow resolution in large repositories #59502 (comment)
  • The current fix raises the workflow list limit to 1000, but the review notes that repos above that threshold will still silently truncate results.
  • Update the implementation to paginate workflow discovery completely, or at minimum eliminate silent truncation and add coverage for the large-workflow-count case.
  • After the fix, refresh the branch if helpful and run the pr-finisher skill with a concise maintainer-facing handoff.

Generated by PR Sous Chef: https://github.com/github/gh-aw/actions/runs/34264957843

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • github.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "github.com"

See Network Configuration for more information.

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 27.1 AIC · ⌖ 8.66 AIC · ⊞ 8.9K · ◷
Comment /souschef to run again

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Copilot AI requested a review from gh-aw-bot September 8, 2026 19:09
@pelikhan
pelikhan merged commit d8c0c4a into main Sep 8, 2026
32 checks passed
@pelikhan
pelikhan deleted the copilot/logs-command-investigation branch September 8, 2026 20:29
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.88.8

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.

4 participants