You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: propagate context through all CLI subprocess calls for Ctrl-C cancellation (#26372)
* fix: propagate context through all CLI subprocess calls for Ctrl-C cancellation
Thread context.Context through the full call chain in pkg/cli/ so that
Ctrl-C (via signal.NotifyContext in main.go) correctly terminates all
background gh CLI subprocesses and git operations.
Previously, many functions called workflow.RunGH / RunGHCombined (no
context) or exec.Command (no context), so Ctrl-C had no effect on
in-flight network operations like artifact downloads, log fetches, and
workflow file downloads.
Changes:
- pkg/workflow/github_cli.go: add RunGHCombinedContext
- pkg/cli/download_workflow.go: add ctx to downloadWorkflowContent,
downloadWorkflowContentViaGit, downloadWorkflowContentViaGitClone;
all exec.Command -> exec.CommandContext
- pkg/cli/update_workflows.go: pass ctx to all downloadWorkflowContent calls
- pkg/cli/update_actions.go: exec.Command(git ls-remote) -> exec.CommandContext
- pkg/cli/audit.go: add ctx to fetchWorkflowRunMetadata,
resolveWorkflowDisplayName, renderAuditReport
- pkg/cli/audit_comparison.go: add ctx to findPreviousSuccessfulWorkflowRuns,
buildAuditComparisonForRun
- pkg/cli/audit_diff.go: add ctx to loadRunSummaryForDiff
- pkg/cli/audit_diff_command.go: pass ctx to loadRunSummaryForDiff calls
- pkg/cli/logs_download.go: add ctx to downloadWorkflowRunLogs,
listRunArtifactNames, downloadArtifactsByName, retryCriticalArtifacts,
downloadRunArtifacts; use ExecGHContext / RunGHContext
- pkg/cli/logs_orchestrator.go: pass ctx to downloadRunArtifacts in pool
- pkg/cli/trial_runner.go: add ctx to getCurrentGitHubUsername
- All affected test files updated accordingly
* fix: update_integration_test.go missing ctx for getLatestBranchCommitSHA
* Update pkg/cli/update_actions.go
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* update
* fix: use RunGHCombinedContext in findPreviousSuccessfulWorkflowRuns
* fix: update_integration_test.go missing ctx for resolveLatestRef
* fix: update_integration_test.go missing ctx for resolveLatestRef (SHA case)
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
0 commit comments