Skip to content

[Code Quality] Replace RunGHCombined with RunGHCombinedContext in fetchJobDetailsWithCounts #46941

Description

@github-actions

Description

fetchJobDetailsWithCounts in pkg/cli/logs_github_api.go calls workflow.RunGHCombined, which internally uses context.Background(). This makes the GitHub API call impossible to cancel via user interrupt, process signal, or deadline, causing the audit to hang indefinitely on slow responses.

Suggested Changes

  1. Add ctx context.Context as the first parameter to fetchJobDetailsWithCounts (line ~79)
  2. Replace workflow.RunGHCombined("Fetching job details...", ...) with workflow.RunGHCombinedContext(ctx, "Fetching job details...", ...)
  3. Update the caller launchJobDetailsAnalysis in audit.go to pass ctx

Files Affected

  • pkg/cli/logs_github_api.gofetchJobDetailsWithCounts (line ~79)
  • pkg/cli/audit.golaunchJobDetailsAnalysis (line ~716)

Success Criteria

  • fetchJobDetailsWithCounts accepts ctx and uses RunGHCombinedContext
  • Caller launchJobDetailsAnalysis passes ctx
  • make build passes with no new linter errors

Source

Extracted from Audit Goroutine Context Blindness discussion #46848

Priority

High — makes live GitHub API call cancellable

🔍 Task mining by Discussion Task Miner - Code Quality Improvement Agent · 46.7 AIC · ⌖ 7.94 AIC · ⊞ 7K ·

  • expires on Jul 21, 2026, 5:17 PM UTC-08:00

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions