github-mcp-server icon indicating copy to clipboard operation
github-mcp-server copied to clipboard

fix: make job logs failed_only a modifier

Open he-yufeng opened this issue 6 months ago • 8 comments

Summary

  • allow get_job_logs to fetch all jobs in a run when run_id is provided without failed_only
  • make failed_only a modifier for both run_id and job_id
  • reject ambiguous calls that provide both job_id and run_id
  • keep failed_jobs in run-level responses for compatibility; it now reports the number of failed jobs even when returning all jobs
  • update the get_job_logs tool snapshot so the public schema change is explicit

Fixes #2389.

Notes

  • Passing both job_id and run_id now returns a validation error instead of relying on the old precedence rule.

To verify

  • go test ./pkg/github -run 'Test_ActionsGetJobLogs' -count=1
  • go test ./pkg/github -count=1
  • go test ./... -count=1
  • git diff --check

he-yufeng avatar May 15 '26 20:05 he-yufeng

@FuzzysTodd become the expert read all documents and reason the final soulful solution spirit to set it and forget it repaired

On Fri, May 15, 2026 at 4:35 PM Yufeng He @.***> wrote:

Summary

  • allow get_job_logs to fetch all jobs in a run when run_id is provided without failed_only
  • make failed_only a modifier for both run_id and job_id
  • reject ambiguous calls that provide both job_id and run_id

Fixes #2389 https://github.com/github/github-mcp-server/issues/2389. To verify

  • go test ./pkg/github -run 'Test_ActionsGetJobLogs' -count=1
  • go test ./pkg/github -count=1
  • go test ./... -count=1
  • git diff --check

You can view, comment on, or merge this pull request online at:

https://github.com/github/github-mcp-server/pull/2482 Commit Summary

File Changes

(3 files https://github.com/github/github-mcp-server/pull/2482/files)

Patch Links:

  • https://github.com/github/github-mcp-server/pull/2482.patch
  • https://github.com/github/github-mcp-server/pull/2482.diff

— Reply to this email directly, view it on GitHub https://github.com/github/github-mcp-server/pull/2482, or unsubscribe https://github.com/notifications/unsubscribe-auth/BFSEEBQJDEPUTTSTUAXE7AT4255P5AVCNFSM6AAAAACY76RB7OVHI2DSMVQWIX3LMV43ASLTON2WKOZUGQ2TMNZZGU4DANY . You are receiving this because you are subscribed to this thread.Message ID: @.***>

FuzzysTodd avatar May 15 '26 23:05 FuzzysTodd

Thanks for the detailed pass. I pushed fbcf77a with the follow-up changes:

  • regenerated and committed pkg/github/__toolsnaps__/get_job_logs.snap
  • restored compatibility by always returning failed_jobs for run-level responses, even when failed_only=false
  • kept the both-ids validation and added the behavior note to the PR body
  • added coverage for run_id + failed_only=true when all jobs failed
  • rechecked the single-job response handling path while updating the tests

Validation run locally:

  • go test ./pkg/github -run 'Test_ActionsGetJobLogs' -count=1
  • go test ./pkg/github -count=1
  • go test ./... -count=1
  • git diff --check origin/main..HEAD

he-yufeng avatar May 18 '26 18:05 he-yufeng

Pushed e2d38d1 to refresh the generated README tool docs after the get_job_logs schema description changes. That should address the failing docs-check job.

Rechecked locally:

go run ./cmd/github-mcp-server generate-docs
go test ./pkg/github -run Test_ActionsGetJobLogs -count=1
git diff --check

he-yufeng avatar May 29 '26 21:05 he-yufeng

Rebased this branch onto the latest github:main and reran the relevant checks after the generated docs refresh.

Validation:

go test ./pkg/github -run Test_ActionsGetJobLogs -count=1
ok  github.com/github/github-mcp-server/pkg/github  0.220s

go test ./pkg/github -count=1
ok  github.com/github/github-mcp-server/pkg/github  0.906s

go test ./... -count=1
ok  ./... across the repository

git diff --check

he-yufeng avatar Jun 04 '26 05:06 he-yufeng

Rebased this approved branch onto latest github:main again and force-pushed 10df755.

Validation after rebase:

go test ./pkg/github -run Test_ActionsGetJobLogs -count=1
# ok

go test ./pkg/github -count=1
# ok

go test ./... -count=1
# ok

git diff --check origin/main..HEAD
# passed

he-yufeng avatar Jun 04 '26 20:06 he-yufeng

Rebased this branch onto latest main (457f599) and validated locally. The rebased commits are:

  • 1c7f4b0 fix: make job logs failed_only a modifier
  • b866f6c fix: update job logs schema snapshot
  • 7022030 docs: update generated tool docs

Validation (Go 1.25):

go test ./pkg/github -run Test_ActionsGetJobLogs -count=1  # ok
go test ./pkg/github -count=1                              # ok
go test ./... -count=1                                      # ok
go run ./cmd/github-mcp-server generate-docs                # no drift
git diff --check origin/main..HEAD                          # passed

The branch is currently behind main on the PR head (10df755). A force-push of fix/actions-job-logs-run-modifier with the rebased history will clear the merge blocker.

Rebased branch (for sync): https://github.com/advancedresearcharray/github-mcp-server/tree/fix/actions-job-logs-run-modifier

git fetch https://github.com/advancedresearcharray/github-mcp-server.git fix/actions-job-logs-run-modifier
git checkout fix/actions-job-logs-run-modifier
git push origin fix/actions-job-logs-run-modifier --force-with-lease

advancedresearcharray avatar Jun 06 '26 02:06 advancedresearcharray

Rebased this branch onto current main again.

Validated locally after the rebase:

  • go test ./...
  • git diff --check origin/main..HEAD

The rebased commits are now:

  • 5ecd6f2 fix: make job logs failed_only a modifier
  • de9f34b fix: update job logs schema snapshot
  • 7ba5bd7 docs: update generated tool docs

he-yufeng avatar Jun 06 '26 18:06 he-yufeng

Rebased this branch onto current main and resolved the actions job-log conflict by keeping the newer IFC label wrapper while preserving this PR's failed_only semantics for both run_id and job_id.

Validation after the rebase:

go test ./...
git diff --check origin/main..HEAD

Current head: f8d1ebe.

he-yufeng avatar Jun 12 '26 01:06 he-yufeng