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
- Add
ctx context.Context as the first parameter to fetchJobDetailsWithCounts (line ~79)
- Replace
workflow.RunGHCombined("Fetching job details...", ...) with workflow.RunGHCombinedContext(ctx, "Fetching job details...", ...)
- Update the caller
launchJobDetailsAnalysis in audit.go to pass ctx
Files Affected
pkg/cli/logs_github_api.go — fetchJobDetailsWithCounts (line ~79)
pkg/cli/audit.go — launchJobDetailsAnalysis (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 · ◷
Description
fetchJobDetailsWithCountsinpkg/cli/logs_github_api.gocallsworkflow.RunGHCombined, which internally usescontext.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
ctx context.Contextas the first parameter tofetchJobDetailsWithCounts(line ~79)workflow.RunGHCombined("Fetching job details...", ...)withworkflow.RunGHCombinedContext(ctx, "Fetching job details...", ...)launchJobDetailsAnalysisinaudit.goto passctxFiles Affected
pkg/cli/logs_github_api.go—fetchJobDetailsWithCounts(line ~79)pkg/cli/audit.go—launchJobDetailsAnalysis(line ~716)Success Criteria
fetchJobDetailsWithCountsacceptsctxand usesRunGHCombinedContextlaunchJobDetailsAnalysispassesctxmake buildpasses with no new linter errorsSource
Extracted from Audit Goroutine Context Blindness discussion #46848
Priority
High — makes live GitHub API call cancellable