get_job_logs with failed_only misses failed jobs after the first 30 jobs of a run
維護者通常 4 天內回覆
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 74/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- go
研究方向
閱讀 pkg/github/actions.go 中的 handleFailedJobLogs,其中 ListWorkflowJobs 只被呼叫了一次且沒有傳 per_page;將其改為請求 per_page=100,並跟隨 NextPage 直到最後一頁,使 total_jobs 反映該 run 的完整作業數而非當前頁長度。在 pkg/github 中加入一個回歸測試,涵蓋作業超過一頁、失敗出現在前 30 個之後的 run(該 issue 引用 python/cpython 中的 run 31008458461 作為真實範例)。完成的標誌是:一個有 45 個作業、失敗在第 30 個作業之後的 run 能回傳這些失敗作業,並回傳 total_jobs: 45。
由索引模型根據 Issue 內容生成。
描述
Describe the bug
get_job_logs with failed_only: true lists the run's jobs with a single ListWorkflowJobs call and no per_page, so it only sees the API's default first page of 30 jobs. In a run with more jobs (a typical matrix build), a failure in job 31 or later is not found, and the tool answers "No failed jobs found in this workflow run". total_jobs in the result is also the page length (30), not the run's job count.
Affected version
v1.14.0 and main at 71ef8266 (handleFailedJobLogs in pkg/github/actions.go).
Steps to reproduce the behavior
- Run
github-mcp-server stdio --read-only --toolsets=actionswith a token. - Call
get_job_logswith{"owner":"python","repo":"cpython","run_id":31008458461,"failed_only":true}. That run has 45 jobs; its 2 failed jobs ("Docs / Check for removed HTML IDs / Check for removed HTML IDs" and "All required checks pass") are both after the first 30.
Expected vs actual behavior
Expected: logs (or log URLs) for the 2 failed jobs, with total_jobs: 45.
Actual (v1.14.0):
{"failed_jobs":0,"message":"No failed jobs found in this workflow run","run_id":31008458461,"total_jobs":30}
Only the first page of jobs is requested.
Logs
N/A
I have a small fix with a regression test ready and can open a PR: list the jobs with per_page=100 and follow NextPage until the last page.
- 主要語言
- Go
- 星號
- 33.4k
- 分支
- 5.1k
- 平均合併
- 2 天 9 小時
- 30 天內合併 PR
- 34
環境準備
- 提供 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
github/github-mcp-server 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 78/100
github/github-mcp-server#3475 ·
維護者通常 4 天內回覆
-
難度 2/5 1-3 小時 新手友好度 76/100
github/github-mcp-server#3450 ·
維護者通常 4 天內回覆
-
request ai review
難度 2/5 1-3 小時 新手友好度 74/100
github/github-mcp-server#3439 ·
維護者通常 4 天內回覆
-
create_or_update_file writes to the wrong file when the path contains # or ?可能已有人在做 @jayhemnani9910 於 6 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 84/100
github/github-mcp-server#3427 ·
維護者通常 4 天內回覆
-
pull_request_read drops merge_commit_sha可能已有人在做 @thejdubb02 於 34 天前認領。 未關閉bug
難度 2/5 1-3 小時 新手友好度 84/100
github/github-mcp-server#3235 · 1 則留言 ·
維護者通常 4 天內回覆
查看 github/github-mcp-server 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 63/100
維護者通常 1 天內回覆
-
product/backlog
難度 2/5 1-3 小時 新手友好度 75/100
TencentBlueKing/bk-nodemgr#3645 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 74/100
modelcontextprotocol/go-sdk#1387 ·
維護者通常 1 天內回覆
-
agent-butler-finding chore
難度 2/5 1-3 小時 新手友好度 78/100
jordansmall/spindrift#5128 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 84/100
維護者通常 2 天內回覆