Description
pkg/parser/remote_workflow_spec.go hard-codes context.Background() for three network calls (downloadFileFromGitHub / resolveRefToSHA at lines 91, 93, 156), even though these calls execute during the compilation pipeline where the caller holds a live, cancellable context. When a user presses Ctrl+C, compilation continues at these network steps until they time out.
A TODO comment at line 71 already acknowledges this gap.
Suggested Changes
- Pass a
context.Context parameter through downloadFileFromGitHub and resolveRefToSHA
- Replace
context.Background() at lines 91, 93, and 156 with the propagated context
- Update all callers that invoke these functions to pass their existing context
Files Affected
pkg/parser/remote_workflow_spec.go (lines 71, 91, 93, 156)
- Callers of
downloadFileFromGitHub / resolveRefToSHA in the parser package
Success Criteria
- No
context.Background() calls remain inside remote_workflow_spec.go (except legitimate entry-point anchors)
- Cancelling a compile via Ctrl+C also cancels in-flight remote workflow fetches
- All existing tests pass
Source
Extracted from [repository-quality] Repository Quality Improvement Report discussion #48389
Priority
High — remote fetches during compilation are fully uncancellable; a TODO already marks this as known debt
🔍 Task mining by Discussion Task Miner - Code Quality Improvement Agent · sonnet46 · 84.8 AIC · ⌖ 5.53 AIC · ⊞ 7.2K · ◷
Description
pkg/parser/remote_workflow_spec.gohard-codescontext.Background()for three network calls (downloadFileFromGitHub/resolveRefToSHAat lines 91, 93, 156), even though these calls execute during the compilation pipeline where the caller holds a live, cancellable context. When a user presses Ctrl+C, compilation continues at these network steps until they time out.A TODO comment at line 71 already acknowledges this gap.
Suggested Changes
context.Contextparameter throughdownloadFileFromGitHubandresolveRefToSHAcontext.Background()at lines 91, 93, and 156 with the propagated contextFiles Affected
pkg/parser/remote_workflow_spec.go(lines 71, 91, 93, 156)downloadFileFromGitHub/resolveRefToSHAin the parser packageSuccess Criteria
context.Background()calls remain insideremote_workflow_spec.go(except legitimate entry-point anchors)Source
Extracted from [repository-quality] Repository Quality Improvement Report discussion #48389
Priority
High — remote fetches during compilation are fully uncancellable; a TODO already marks this as known debt