Skip to content

fix(actions): check every job page in get_job_logs failed_only - #3430

Open
jayhemnani9910 wants to merge 1 commit into
github:mainfrom
jayhemnani9910:fix/job-logs-failed-only-pagination
Open

jayhemnani9910 wants to merge 1 commit into
github:mainfrom
jayhemnani9910:fix/job-logs-failed-only-pagination

Conversation

@jayhemnani9910

Copy link
Copy Markdown

Summary

get_job_logs with failed_only now reads every page of the run's jobs instead of only the first 30, so failed jobs later in large matrix runs are found.

Why

Fixes #3428

handleFailedJobLogs called ListWorkflowJobs once with no per_page, so the API returned only the first 30 jobs. A failure past that page was reported as "No failed jobs found", and total_jobs was 30.

Open PR #2674 renames handleFailedJobLogs and keeps the single-page call; whichever lands second needs a small rebase.

What changed

  • handleFailedJobLogs lists jobs with per_page=100 and follows NextPage.
  • total_jobs counts all listed jobs.
  • New subtest failed job on a later page in Test_ActionsGetJobLogs_FailedJobs: page 1 has 30 passing jobs and a next link, page 2 has the failed job. Without the change the result is failed_jobs: 0, total_jobs: 30; with it, 1 and 31.

MCP impact

  • No tool or API changes
  • Tool schema or behavior changed
    failed_only finds failures in runs with more than 30 jobs. No schema change.
  • New tool added

Prompts tested (tool changes only)

  • "Why did python/cpython run 31008458461 fail?" (failed_only: true; the run has 45 jobs and both failures are after the first 30). v1.14.0: No failed jobs found in this workflow run, total_jobs: 30. This branch: Retrieved logs for 2 failed jobs, total_jobs: 45.

Security / limits

  • No security or limits impact
  • Auth / permissions considered
  • Data exposure, filtering, or token/size limits considered
    One extra API call per 100 jobs; a run can have at most 256 matrix jobs per workflow, so this is a few calls at most.

Tool renaming

  • I am renaming tools as part of this PR (e.g. a part of a consolidation effort)
    • I have added the new tool aliases in deprecated_tool_aliases.go
  • I am not renaming tools as part of this PR

Lint & tests

  • Linted locally (golangci-lint v2.14.0, the version ./script/lint pins: 0 issues)
  • Tested locally with go test ./... (all packages ok)

Docs

  • Not needed
  • Updated (README / docs / examples)

Only the first 30 jobs of a run were listed, so in larger matrix runs a
failed job past that page was reported as "No failed jobs found".
Copilot AI balanced review requested due to automatic review settings October 6, 2026 12:42
@jayhemnani9910
jayhemnani9910 requested a review from a team as a code owner October 6, 2026 12:42

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

get_job_logs with failed_only misses failed jobs after the first 30 jobs of a run

2 participants