Skip to content

[deep-report] Thread context.Context through 8 public remote_fetch.go APIs (fix Ctrl-C cancellation) #42992

Description

@github-actions

Description

pkg/parser/remote_fetch.go exposes 8 public functions with no context.Context parameter; their auth-fallback paths hard-code context.Background() (verified: exactly 7 occurrences on main). Nine pkg/cli/ callers already hold a cobra cmd.Context() but cannot pass it, so Ctrl-C does not cancel in-flight HTTP requests.

Public APIs missing ctx (verified present): DownloadFileFromGitHub (876), DownloadFileFromGitHubForHost (885), ResolveRefToSHAForHost (893), ListWorkflowFiles (1030), ListWorkflowFilesForHost (1036), ListDirAllFilesForHost (1095), ListDirAllFilesRecursivelyForHost (1208), ListDirSubdirsForHost (1354).

Fix: add ctx context.Context to the 8 public APIs, propagate through the private chain, replace the 7 context.Background() fallback sites, update the 9 CLI callers to pass cmd.Context(), and add a linter rule to prevent regression.

Expected Impact

Restores request cancellation on Ctrl-C and proper deadline propagation for all remote workflow fetches; removes a latent hang/leak class.

Suggested Agent

Copilot SWE Agent (well-scoped Go refactor).

Estimated Effort

Medium (1-4 hours).

Data Source

DeepReport Intelligence Briefing 2026-07-02; Repository Quality Report #42975. Claim grep-verified on main.

Generated by 🔬 Deep Report · 266.6 AIC · ⌖ 17.9 AIC · ⊞ 10.2K ·

  • expires on Jul 4, 2026, 7:36 AM UTC-08:00

Metadata

Metadata

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions