Skip to content

pkg/cli: thread context through Docker availability checks#30606

Merged
pelikhan merged 4 commits into
mainfrom
copilot/fix-docker-subprocess-context
May 6, 2026
Merged

pkg/cli: thread context through Docker availability checks#30606
pelikhan merged 4 commits into
mainfrom
copilot/fix-docker-subprocess-context

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 6, 2026

The Docker availability/image-inspection helpers in pkg/cli/docker_images.go spawned subprocesses without a context, so callers could not cancel or time out docker info and docker image inspect. This updates those paths to respect caller-controlled cancellation.

  • Context-aware Docker checks

    • Added context.Context parameters to:
      • isDockerImageAvailableUnlocked
      • IsDockerImageAvailable
      • IsDockerAvailable
    • Replaced exec.Command(...) with exec.CommandContext(...) for:
      • docker image inspect <image>
      • docker info
  • Threaded existing caller context

    • Updated CheckAndPrepareDockerImages and StartDockerImageDownload call paths to pass the existing ctx through image-availability and Docker-daemon checks.
    • Keeps Docker probing behavior aligned with the same cancellation boundary already used for background pulls.
  • Tests updated for new signatures

    • Adjusted focused pkg/cli/docker_images_test.go call sites to pass an explicit context while preserving existing mocked behavior.
func IsDockerAvailable(ctx context.Context) bool {
	cmd := exec.CommandContext(ctx, "docker", "info")
	cmd.Stdout = nil
	cmd.Stderr = nil
	return cmd.Run() == nil
}

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh gh repo view --json owner,name --jq .owner.login &#43; &#34;/&#34; &#43; .name ache/uv/0.11.10/x86_64/node (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw **/*.json --ignore-path /bin/sh -c te &#39;scripts/**/*.js&#39; --ignore-path .prettierignore --log-level=error (http block)
  • https://api.github.com/orgs/test-owner/actions/secrets
    • Triggering command: /usr/bin/gh gh api /orgs/test-owner/actions/secrets --jq .secrets[].name th .prettierignore --log-level=e!../../../pkg/workflow/js/**/*.json .cfg modules/@npmcli/run-script/lib/node-gyp-bin/sh pull.rebase (http block)
  • https://api.github.com/repos/actions/ai-inference/git/ref/tags/v1
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq [.object.sha, .object.type] | @tsv --show-toplevel /opt/hostedtoolcache/go/1.25.8/xrepos/{owner}/{repo}/actions/runs/3/artifacts /usr/bin/git runs/20260506-12git 64/pkg/tool/linurev-parse epo.git git rev-�� --show-toplevel /opt/hostedtoolcache/go/1.25.8/x--name-only /usr/bin/git ithub-script/gitgh -buildtags ache/node/24.14./repos/actions/github-script/git/ref/tags/v9 git (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v3
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq [.object.sha, .object.type] | @tsv ithub-script/git/ref/tags/v9 remote2 (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v5
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq [.object.sha, .object.type] | @tsv QPzV/y7s_mTHMdIWBJz1SQPzV --write e/git **/*.ts **/*.json --ignore-path e/git -c mplied x_amd64/vet 1/x64/bin/node nore --log-levelinfocmp set in/dist/gh-gpgsixterm-color 1/x64/bin/node (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq [.object.sha, .object.type] | @tsv ithub-script/git/ref/tags/v9 gh bject.type] | @tsv repos/{owner}/{rgit --jq /opt/hostedtoolc--show-toplevel git rev-�� --show-toplevel node /usr/bin/git ithub-script/gitgit ache/go/1.25.8/xrev-parse bject.type] | @t--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq [.object.sha, .object.type] | @tsv --show-toplevel infocmp /usr/bin/infocmp xterm-color bash /usr/bin/git infocmp -1 xterm-color git /usr/bin/git --show-toplevel sh /usr/bin/gh git (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv 1958-14442/test-40432338 config ache/node/24.14.1/x64/bin/node remote.origin.urgit -nolocalimports -importcfg /usr/lib/git-core/git t-15�� k/gh-aw/gh-aw/.github/workflows/architecture-guardian.md --auto /usr/bin/git --detach --local ache/go/1.25.8/x--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv github.repository rev-parse /opt/hostedtoolcache/node/24.14.1/x64/bin/node w/js/**/*.json&#39; git user.email x_amd64/link node /tmp�� /tmp/TestHashConsistency_WithImports1060738789/001/main.md x_amd64/link /opt/hostedtoolcache/node/24.14.1/x64/bin/node --local core.hooksPath ode_modules/.bin--show-toplevel node (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv /tmp/gh-aw-test-runs/20260506-121958-14442/test-3066123578/.github/workflows l /usr/bin/git remote.origin.urgit (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v8
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq [.object.sha, .object.type] | @tsv xterm-color git /usr/bin/git --get remote.origin.urrev-parse /usr/bin/git git rev-�� --show-toplevel git /usr/bin/infocmp user.email test@example.comrev-parse /usr/bin/git infocmp (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v9
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq [.object.sha, .object.type] | @tsv --local --get odules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/node (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq [.object.sha, .object.type] | @tsv -c=4 -nolocalimports -importcfg /tmp/go-build2737831933/b392/importcfg -pack /home/REDACTED/work/gh-aw/gh-aw/internal/tools/generate-action-metadata/main.go 64/pkg/tool/linux_amd64/vet /pre�� stall-gh-aw.sh to actions/setup-!../../../pkg/workflow/js/**/*.json .cfg /sh pull.rebase (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq [.object.sha, .object.type] | @tsv get .cfg 64/pkg/tool/linux_amd64/vet credential.usernsh (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v9.0.0
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9.0.0 --jq [.object.sha, .object.type] | @tsv --local --get _modules/.bin/node (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9.0.0 --jq [.object.sha, .object.type] | @tsv get .cfg /node credential.helpesh (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9.0.0 --jq [.object.sha, .object.type] | @tsv ./cmd/gh-aw .cfg odules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/sh credential.usernsh (http block)
  • https://api.github.com/repos/actions/setup-go/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv --show-toplevel ache/go/1.25.8/x-buildtags /usr/bin/gh 7831933/b439/_pkgh x_amd64/vet e/git gh api /repos/actions/github-script/git/ref/tags/v9 --jq /usr/bin/git mplied scripts/**/*.js 1/x64/bin/node git (http block)
  • https://api.github.com/repos/actions/setup-node/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv user.email test@example.com /usr/bin/git Gitbranch_with_hgit Gitbranch_with_hrev-parse x_amd64/compile git log --oneline resolved$ /usr/bin/git -bool -buildtags de_modules/.bin/--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv --show-toplevel ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet /usr/bin/git 40432338 x_amd64/vet /home/node_modul/repos/actions/github-script/git/ref/tags/v9 git rev-�� --show-toplevel node /usr/bin/git &#39;/tmp/TestParsegit &#39;/tmp/TestParserev-parse 1/x64/bin/node git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv --show-toplevel git /usr/bin/git --git-dir ache/go/1.25.8/xrev-parse /usr/bin/git git rev-�� /ref/tags/v9 git sv git git om/owner/repo.gixterm-color gh (http block)
  • https://api.github.com/repos/actions/setup-node/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv /tmp/gh-aw-test-runs/20260506-121958-14442/test-source-field-variant-36663794 show ache/node/24.14.1/x64/bin/node -c=4 -nolocalimports -importcfg /bin/sh t-39�� k/gh-aw/gh-aw/.github/workflows/artifacts-summary.md git-receive-pack &#39;/tmp/TestParseDefaultBranchFromLsRemoteWithRealGitbranch_with_-test.run=^Test ache/node/24.14.1/x64/bin/node aw/actions-lock.git --local it/copilot-hooks--show-toplevel ache/node/24.14.1/x64/bin/node (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv /tmp/gh-aw-test-runs/20260506-121958-14442/test---workflow remote e/git w/js/**/*.json&#39; git 2882336/b259/vetrev-parse 1/x64/bin/bash e/git api /repos/actions/github-script/git/ref/tags/v9.0.0 --jq /usr/bin/git --local core.hooksPath es/.bin/sh git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv /tmp/gh-aw-test-runs/20260506-121958-14442/test-3066123578 show /usr/bin/git json&#39; --ignore-pgit (http block)
  • https://api.github.com/repos/actions/upload-artifact/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv nux-x86_64 ache/go/1.25.8/xorigin /usr/bin/git --tags (http block)
  • https://api.github.com/repos/aws-actions/configure-aws-credentials/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/aws-actions/configure-aws-credentials/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv --show-toplevel git /usr/bin/git /tmp/TestGuardPogit remote /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel ache/go/1.25.8/xauth /usr/bin/infocmpstatus git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/aws-actions/configure-aws-credentials/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv --show-toplevel git /usr/bin/git /tmp/TestGuardPogh config /usr/bin/gh git rev-�� /ref/tags/v9 gh sv /ref/tags/v9 --jq sv infocmp (http block)
  • https://api.github.com/repos/azure/login/git/ref/tags/v2
    • Triggering command: /usr/bin/gh gh api /repos/azure/login/git/ref/tags/v2 --jq [.object.sha, .object.type] | @tsv --show-toplevel git /usr/bin/git ithub-script/gitgit ache/go/1.25.8/xrev-parse bject.type] | @t--show-toplevel git rev-�� --show-toplevel git /usr/bin/git /tmp/gh-aw-test-infocmp remote /usr/bin/infocmpxterm-color git (http block)
  • https://api.github.com/repos/docker/login-action/git/ref/tags/v3
    • Triggering command: /usr/bin/gh gh api /repos/docker/login-action/git/ref/tags/v3 --jq [.object.sha, .object.type] | @tsv --show-toplevel node /usr/bin/git ithub-script/gitgit ache/go/1.25.8/xrev-parse bject.type] | @t--show-toplevel git rev-�� --show-toplevel /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linuowner/test-repo /usr/bin/infocmp /tmp/go-build273infocmp -trimpath om/owner/repo.gixterm-color infocmp (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v0.1.2
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v0.1.2 --jq [.object.sha, .object.type] | @tsv /repos/actions/github-script/git/ref/tags/v9 --jq /usr/bin/git 8994736/.github/infocmp stmain.go /home/REDACTED/worxterm-color git rev-�� --show-toplevel sh /usr/bin/git /ref/tags/v9 x_amd64/vet 1/x64/bin/node git (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v1.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.0.0 --jq [.object.sha, .object.type] | @tsv --show-toplevel /opt/hostedtoolcconfig /usr/bin/infocmp th .prettierignogit /tmp/go-build129rev-parse nfig/composer/ve--show-toplevel infocmp -1 xterm-color /opt/hostedtoolcconfig /usr/bin/git ub/workflows /tmp/go-build129rev-parse n-dir/node git (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v1.2.3
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.2.3 --jq [.object.sha, .object.type] | @tsv 1958-14442/test-843501055 ache/go/1.25.8/x64/pkg/tool/linu--write /usr/bin/git -unreachable=falgit /tmp/go-build129rev-parse nch,headSha,disp--show-toplevel ortcfg -C g/workflow/features_import_test.go g/workflow/import_schema_test.go /usr/bin/git remote.origin.urgit /tmp/go-build129rev-parse son git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --limit 100 --created &gt;=2026-04-29 (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --limit 100 --created &gt;=2026-04-06 -ifaceassert -nilfunc git 8d51�� 24436360.go -tests 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --limit 100 --created &gt;=2026-02-05 -ifaceassert -nilfunc sh -c itbranch_with_hyphen3580397969/0-errorsas itbranch_with_hyphen3580397969/0-ifaceassert 64/pkg/tool/linux_amd64/vet (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/1/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/1/artifacts --jq .artifacts[].name (http block)
    • Triggering command: /usr/bin/gh gh run download 1 --dir test-logs/run-1 (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12345/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/12345/artifacts --jq .artifacts[].name (http block)
    • Triggering command: /usr/bin/gh gh run download 12345 --dir test-logs/run-12345 80 64/pkg/tool/linux_amd64/compile ignore !.git --with-filename 64/pkg/tool/linux_amd64/compile -c g_.a (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/1234567890
    • Triggering command: /usr/bin/gh gh api repos/{owner}/{repo}/actions/runs/1234567890 --jq {databaseId: .id, number: .run_number, url: .html_url, status: .status, conclusion: .conclusion, workflowName: .name, workflowPath: .path, createdAt: .created_at, startedAt: .run_started_at, updatedAt: .updated_at, event: .event, headBranch: .head_branch, 227865002/001&#39; 227865002/001&#39; ode_modules/.bin/node core.hooksPath (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12346/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/12346/artifacts --jq .artifacts[].name (http block)
    • Triggering command: /usr/bin/gh gh run download 12346 --dir test-logs/run-12346 40 64/pkg/tool/linux_amd64/vet ignore !.git --with-filename 64/pkg/tool/linux_amd64/vet -c rite &#39;**/*.cjs&#39; &#39;**/*.ts&#39; &#39;**/*.json&#39; --ignore-p--log-target (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/2/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/2/artifacts --jq .artifacts[].name (http block)
    • Triggering command: /usr/bin/gh gh run download 2 --dir test-logs/run-2 (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/3/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/3/artifacts --jq .artifacts[].name (http block)
    • Triggering command: /usr/bin/gh gh run download 3 --dir test-logs/run-3 (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/4/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/4/artifacts --jq .artifacts[].name (http block)
    • Triggering command: /usr/bin/gh gh run download 4 --dir test-logs/run-4 (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/5/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/5/artifacts --jq .artifacts[].name (http block)
    • Triggering command: /usr/bin/gh gh run download 5 --dir test-logs/run-5 (http block)
  • https://api.github.com/repos/github/gh-aw/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path th .prettierignore --log-level=e!../../../pkg/workflow/js/**/*.json --local (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 100 (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 6 erignore _TOKEN&#34;; }; f x_amd64/compile ache�� npx prettier --write &#39;**/*.cjs&#39; -p (http block)
  • https://api.github.com/repos/github/gh-aw/contents/.github/workflows/shared/reporting.md
    • Triggering command: /tmp/go-build2737831933/b404/cli.test /tmp/go-build2737831933/b404/cli.test -test.testlogfile=/tmp/go-build2737831933/b404/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true http.https://gitnode (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v0.47.4
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v0.47.4 --jq [.object.sha, .object.type] | @tsv --show-toplevel git /usr/bin/git s/test.md remote /usr/bin/git git rev-�� --show-toplevel /usr/bin/git /usr/bin/infocmp -v ache/go/1.25.8/xrev-parse /usr/bin/git infocmp (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq [.object.sha, .object.type] | @tsv sRemoteWithRealGitmain_branch1227865002/001 sRemoteWithRealGitmain_branch1227865002/002/workowner/repo k/node_modules/.bin/sh (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.2.3
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.2.3 --jq [.object.sha, .object.type] | @tsv .js&#39; --ignore-path .prettierignore --log-level=e!../../../pkg/workflow/js/**/*.json --merged=2eeda31db94b2072e7ebf35714b022255408c1c--ignore-path es/.bin/sh (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v2.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq [.object.sha, .object.type] | @tsv 7865002/001 7865002/002/workowner/repo tions/node_modules/.bin/node (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq [.object.sha, .object.type] | @tsv .js&#39; --ignore-path .prettierignore --log-level=error (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq [.object.sha, .object.type] | @tsv path .prettierignore --log-level--ignore-path c tions/node_modules/.bin/node - (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v3.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v3.0.0 --jq [.object.sha, .object.type] | @tsv .js&#39; --ignore-path .prettierignore --log-level=error c bin/node - (http block)
  • https://api.github.com/repos/google-github-actions/auth/git/ref/tags/v2
    • Triggering command: /usr/bin/gh gh api /repos/google-github-actions/auth/git/ref/tags/v2 --jq [.object.sha, .object.type] | @tsv --show-toplevel git /usr/bin/git /tmp/TestGuardPogit rev-parse /usr/bin/gh git rev-�� --show-toplevel gh /usr/bin/git /repos/actions/ggit --jq /opt/hostedtoolc--show-toplevel git (http block)
  • https://api.github.com/repos/nonexistent/action/git/ref/tags/v999.999.999
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq [.object.sha, .object.type] | @tsv ace-editor.md (http block)
  • https://api.github.com/repos/nonexistent/repo/actions/runs/12345
    • Triggering command: /usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion pkg/workflow/secgit til pkg/workflow/ser--show-toplevel node k/gh�� pC4FS5t0C --write e_modules/.bin/sh --ignore-path .prettierignore erignore ortcfg (http block)
  • https://api.github.com/repos/owner/repo/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo es/.bin/node core.hooksPath (http block)
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet core.hooksPath (http block)
    • Triggering command: /usr/bin/gh gh workflow list --repo owner/repo --json name,path,state g_.a (http block)
  • https://api.github.com/repos/test-owner/test-repo/actions/secrets
    • Triggering command: /usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name th .prettierignore --log-level=e!../../../pkg/workflow/js/**/*.json --local ache/go/1.25.8/x64/pkg/tool/linu../../../.prettierignore pull.rebase (http block)
  • https://api.github.com/repos/test/repo
    • Triggering command: /usr/bin/gh gh api /repos/test/repo --jq .default_branch te &#39;scripts/**/*.js&#39; --ignore-path .prettierignore --log-level=error format:pkg-json k/gh-aw/node_modules/.bin/node tierignore (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI and others added 2 commits May 6, 2026 12:16
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/e3b78557-2b5f-45ba-aca4-3e2ad4b7c5a1

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/e3b78557-2b5f-45ba-aca4-3e2ad4b7c5a1

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix docker subprocess calls by adding context support pkg/cli: thread context through Docker availability checks May 6, 2026
Copilot AI requested a review from pelikhan May 6, 2026 12:27
@pelikhan pelikhan marked this pull request as ready for review May 6, 2026 12:33
Copilot AI review requested due to automatic review settings May 6, 2026 12:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Thread context.Context through Docker availability and image inspection helpers so callers can cancel/time out docker info and docker image inspect.

Changes:

  • Added context.Context parameters to Docker availability/image inspection helpers.
  • Replaced exec.Command(...) with exec.CommandContext(...) for Docker probing commands.
  • Updated unit tests to pass explicit contexts with the new function signatures.
Show a summary per file
File Description
pkg/cli/docker_images.go Threads context.Context through Docker probing paths and switches subprocess execution to exec.CommandContext.
pkg/cli/docker_images_test.go Updates call sites to use the new context-aware helper signatures.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comments suppressed due to low confidence (1)

pkg/cli/docker_images.go:103

  • exec.CommandContext will panic on a nil ctx. Either guard against nil (e.g., default to context.Background()) or clearly document the non-nil requirement for callers of this exported helper.
// IsDockerAvailable checks if the Docker daemon is running and accessible
func IsDockerAvailable(ctx context.Context) bool {
	pullState.mu.RLock()
	if pullState.mockAvailableInUse {
		available := pullState.mockDockerAvailable
		pullState.mu.RUnlock()
		dockerImagesLog.Printf("Mock: Docker available: %v", available)
		return available
	}
	pullState.mu.RUnlock()

	cmd := exec.CommandContext(ctx, "docker", "info")
	cmd.Stdout = nil
	cmd.Stderr = nil
	err := cmd.Run()
  • Files reviewed: 2/2 changed files
  • Comments generated: 1

Comment thread pkg/cli/docker_images.go
Comment on lines 55 to 66
@@ -62,7 +62,7 @@ func isDockerImageAvailableUnlocked(image string) bool {

// For non-mock mode, we need to execute docker command
// This is safe to do under lock since it's just a subprocess call
cmd := exec.Command("docker", "image", "inspect", image)
cmd := exec.CommandContext(ctx, "docker", "image", "inspect", image)
// Suppress output - we only care about exit code
@pelikhan
Copy link
Copy Markdown
Collaborator

pelikhan commented May 6, 2026

@copilot review all comments

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/bad569da-f037-4d84-8a74-89af58b5b747

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan pelikhan merged commit 50f54ee into main May 6, 2026
@pelikhan pelikhan deleted the copilot/fix-docker-subprocess-context branch May 6, 2026 13:05
Copilot stopped work on behalf of pelikhan due to an error May 6, 2026 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pkg/cli: docker subprocess calls missing context (exec.Command → exec.CommandContext)

3 participants