Skip to content

[deep-report] Convert exec.Command to exec.CommandContext in pkg/cli/git.go and pr_command.go #66255

Description

@github-actions

Description

pkg/cli/git.go and pkg/cli/pr_command.go spawn subprocesses via exec.Command( (20 call sites each, confirmed via grep -c) instead of exec.CommandContext(. Ctrl-C and configured timeouts cannot stop these subprocesses — a hung git/gh call blocks the whole command tree. Context-aware variants already exist elsewhere in the codebase (RunGHContext), so this is plumbing, not new design.

Expected Impact

Git/PR CLI operations become cancellable and respect caller timeouts, closing the two highest-concentration violation sites of this pattern in the repo.

Suggested Fix

Thread a ctx context.Context parameter through the affected functions in both files, replace exec.Command with exec.CommandContext(ctx, ...), and update callers (ultimately from cmd.Context()).

Acceptance Criteria

  • No exec.Command( remains in pkg/cli/git.go or pkg/cli/pr_command.go
  • Callers pass their ctx; make test-unit passes
  • make fmt run after changes

Suggested Agent

Go-focused agent comfortable with pkg/cli subprocess helpers.

Estimated Effort

Medium (1-4 hours).

Data Source

Repository Quality: Context Propagation & Cancellation Hygiene — 2026-10-06 (#66149), Task 1 (High priority). Verified via grep -c "exec\.Command(" pkg/cli/git.go pkg/cli/pr_command.go = 20/20, zero CommandContext in either file.

Generated by 🔬 Deep Report · claude · agent · 421.8 AIC · ⌖ 9.14 AIC · ⊞ 7.1K · ◷

  • expires on Oct 8, 2026, 10:46 AM UTC-08:00

Activity

  1. github-actions commented on Oct 8, 2026

    @github-actions
    ContributorAuthor

    This issue was automatically closed because it expired on 2026-10-08T18:46:59.397Z.

    Closed by Workflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions