Skip to content

refactor: replace map-to-sorted-slice boilerplate with slices.Sorted(maps.Keys(...))#28502

Merged
pelikhan merged 2 commits intomainfrom
copilot/refactor-map-to-sorted-slice-pattern
Apr 25, 2026
Merged

refactor: replace map-to-sorted-slice boilerplate with slices.Sorted(maps.Keys(...))#28502
pelikhan merged 2 commits intomainfrom
copilot/refactor-map-to-sorted-slice-pattern

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 25, 2026

pkg/workflow/domains.go repeated the same 4-line collect-and-sort idiom 8 times, and map_helpers.go had an equivalent pattern in sortedMapKeys. The rest of the codebase already uses the idiomatic one-liner.

Changes

  • pkg/workflow/domains.go — added "maps" and "slices" imports; replaced all 8 occurrences of the verbose pattern across getEcosystemDomains, getDomainsFromRuntimes, GetAllowedDomains, mergeDomainsWithNetworkToolsAndRuntimes, GetBlockedDomains, mergeAPITargetDomains, expandAllowedDomains, and computeExpandedAllowedDomainsForSanitization. "sort" is retained — two non-map usages remain (copying a slice at line 310, filtered key collection at line 529).

  • pkg/workflow/map_helpers.go — replaced "sort" with "maps" + "slices"; collapsed sortedMapKeys body to a single expression.

// Before (4 lines repeated 8×):
result := make([]string, 0, len(domainMap))
for d := range domainMap {
    result = append(result, d)
}
sort.Strings(result)

// After:
result := slices.Sorted(maps.Keys(domainMap))

No functional change — both approaches produce identical sorted, deduplicated output.

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 + "/" + .name .cfg GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linu-trimpath (http block)
    • Triggering command: /usr/bin/gh gh repo view owner/repo env 1004877/b475/_pkg_.a .cfg ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet GOINSECURE b/gh-aw/tmp GOMODCACHE ache/go/1.25.8/xremote.origin.url (http block)
    • Triggering command: /usr/bin/gh gh repo view owner/repo env 1004877/b001/_pkg_.a 77fi/6ZT9wch_PpgFfi6x77fi ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet GOINSECURE b/gh-aw/actions/rev-parse GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (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 -json cii.go x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /orgs/test-owner/actions/secrets --jq .secrets[].name -json GO111MODULE /node GOINSECURE GOMOD GOMODCACHE go /pre�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (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 64/pkg/tool/linuother /usr/bin/git ut102343455/001 vNkW/MmwpPo_3e3trev-parse At,event,headBra--show-toplevel git rev-�� --show-toplevel 64/pkg/tool/linux_amd64/compile /usr/bin/git 025/001/stabilitnode --merged=4ffa6f8/opt/hostedtoolcache/node/24.14.1/x64/bin/npm .cfg git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq [.object.sha, .object.type] | @tsv --show-toplevel go /usr/bin/git */*.ts' '**/*.jsgit GO111MODULE ache/go/1.25.8/x--show-toplevel git rev-�� --show-toplevel go /usr/bin/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 /tmp/go-build3361004877/b456/timeutil.test -importcfg /usr/bin/git -s -w -buildmode=exe git remo�� add origin /usr/bin/git -json i.go x_amd64/vet git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq [.object.sha, .object.type] | @tsv /repos/actions/github-script/git/ref/tags/v9 --jq /usr/bin/git 0 -j ACCEPT git init�� GOMODCACHE go /usr/bin/git -json GO111MODULE 64/bin/go git (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 se 1004877/b242/vetnonexistent-workflow-ci-test-67890 64/pkg/tool/linu--limit -p net/url -lang=go1.25 64/pkg/tool/linux_amd64/vet -o /tmp/go-build4128171528/b001/_pkg_.a -trimpath tutil.test -p main -lang=go1.25 tutil.test (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq [.object.sha, .object.type] | @tsv --show-toplevel 9Ym34G_sfJyM6o-Ioz/mT-tLcfK0hMgkrev-parse /usr/bin/git 8171528/b223/imptr -trimpath 64/pkg/tool/linu: git rev-�� --show-toplevel 64/pkg/tool/linu12345 /usr/bin/git g_.a -trimpath 1004877/b167/vet--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 /bin/sh /usr/bin/git git-receive-packgit git-receive-packrev-parse ache/node/24.14.--show-toplevel git rev-�� --show-toplevel git /usr/bin/git k/gh-aw/gh-aw/.ggit config clusion,workflow--show-toplevel 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 k/gh-aw/gh-aw/.github/workflows/ai-moderator.md config /usr/bin/infocmp remote.origin.urgit GO111MODULE x_amd64/compile infocmp -1 xterm-color x_amd64/compile /usr/bin/git -json GO111MODULE x_amd64/vet git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv origin l /usr/bin/git -json GO111MODULE 64/bin/go git -C runs/20260425-213529-58958/test-4127627469 config /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet s/test.md GO111MODULE 64/bin/go /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (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 --show-toplevel ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile /usr/bin/git st-70808793 /tmp/go-build336/tmp/gh-aw-test-runs/20260425-213152-36199/test-patch-priority-73222�� flow.lock.yml git rev-�� --show-toplevel /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linuremote.origin.url /usr/bin/git -unreachable=falgit /tmp/go-build336rev-parse /opt/hostedtoolc--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq [.object.sha, .object.type] | @tsv --get-regexp ^remote\..*\.gh-resolved$ /usr/bin/git 3529-58958/test-bash GO111MODULE /opt/hostedtoolcache/go/1.25.8/x--show-toplevel git rev-�� --show-toplevel go /usr/bin/git -json GO111MODULE e/git-upload-pac--show-toplevel git (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 -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json exer.go x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq [.object.sha, .object.type] | @tsv -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq [.object.sha, .object.type] | @tsv -json GO111MODULE x_amd64/asm GOINSECURE GOMOD GOMODCACHE x_amd64/asm env -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (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 RIQEcng/1ndInNVrremote.origin.url /usr/bin/gh 8171528/b154/_pkgit .cfg 64/pkg/tool/linu--show-toplevel gh api --paginate repos/{owner}/{repo}/actions/runs/5/artifacts /usr/bin/gh .artifacts[].namgit .cfg aw.test gh (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv --show-toplevel go /usr/bin/git or.md GO111MODULE h git rev-�� --git-dir go /usr/bin/git '**/*.ts' '**/*.git GO111MODULE ache/go/1.25.8/x--show-toplevel 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 /tmp/TestGuardPolicyMinIntegrityOnlymin-integrity_with_repos=public_2393698725/0-s rev-parse /opt/hostedtoolcache/node/24.14.1/x64/bin/node -json r/common.go x_amd64/compile node /tmp�� ansitiveImports1780585160/001 l /usr/bin/git -json GO111MODULE x_amd64/vet 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 64/pkg/tool/linuTest User /usr/bin/gh hub/workflows om/segmentio/asmrev-parse 64/pkg/tool/linu--show-toplevel gh api --paginate repos/{owner}/{repo}/actions/runs/3/artifacts /usr/bin/gh .artifacts[].namgit GO111MODULE 64/pkg/tool/linu--show-toplevel gh (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv --objects (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 se 1004877/b113/vet.cfg /usr/bin/git -json GO111MODULE x_amd64/compile git conf�� s/test.md Test User /usr/bin/git 1 GO111MODULE ache/go/1.25.8/x--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv y go /usr/local/bin/iptables -json GO111MODULE 64/bin/go iptables -w -t security /usr/bin/git -nxv GO111MODULE 64/bin/go git (http block)
  • https://api.github.com/repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b
    • Triggering command: /usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq [.object.sha, .object.type] | @tsv user.email ings.cjs odules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/git 983e9ff8..full-m/opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/compile ings.cjs n-dir/node forks.js rev-�� HEAD st/suppress-warnmain _modules/.bin/gi-lang=go1.25 -M full mode test odules/npm/node_--require st/dist/workers//home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/node_modules/vitest/suppress-warnings.cjs (http block)
    • Triggering command: /usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq [.object.sha, .object.type] | @tsv . tions/setup/js/node_modules/vite--stdout $name) { hasDiscussionsEnabled } } /tmp/bare-incremgit gin/full-mode-brcommit cal/bin/git git init�� -q (http block)
    • Triggering command: /usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq [.object.sha, .object.type] | @tsv . tions/setup/js/node_modules/vite--stdout bin/git /tmp/bare-increm/opt/hostedtoolcache/node/24.14.1/x64/bin/node . ode-gyp-bin/git HBvalqg/8ozp-azd/home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/node_modules/vitest/suppress-warnings.cjs init�� -q st/suppress-warn--conditions k/node_modules/.development -m ode_modules/viteapi it st/dist/workers/-f (http block)
  • https://api.github.com/repos/github/gh-aw
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw --jq .default_branch .go test@example.com ules/.bin/go k/_temp/uv-pythogit git e6 git bran�� -cwd.go main repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } --is-ancestor k/gh-aw/gh-aw/ac-C odules/npm/node_/home/REDACTED/work/gh-aw/gh-aw/.github/workflows git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw --jq .default_branch . /opt/hostedtoolcache/node/24.14.owner=github me: String!) { repository(owne-f --require /home/REDACTED/wor-C n-dir/git /opt/hostedtoolcshow --ex�� k/gh-aw/gh-aw/.github/workflows /home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/node_modules/vitest/suppress-warnings.cjs 1/x64/bin/node node --conditions development go (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 --show-toplevel 64/pkg/tool/linux_amd64/vet /usr/bin/infocmp dfWiE9R6S .cfg 64/pkg/tool/linu--show-toplevel infocmp -1 xterm-color 64/pkg/tool/linux_amd64/vet /usr/bin/infocmp 1720849999/.githgit .cfg 64/pkg/tool/linu--show-toplevel infocmp (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v0.1.2 --jq [.object.sha, .object.type] | @tsv --show-toplevel x_amd64/vet /usr/bin/git report.md GO111MODULE 1/x64/bin/npm git rev-�� --show-toplevel go /usr/bin/git -json GO111MODULE h 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 /tmp/gh-aw-test-runs/20260425-213135-33549/test-2973757929/.github/workflows rev-parse /usr/bin/git -json GO111MODULE x_amd64/compile git rev-�� --show-toplevel x_amd64/compile 0"}} 01 GO111MODULE x_amd64/vet git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.0.0 --jq [.object.sha, .object.type] | @tsv run --auto /usr/bin/git --detach GO111MODULE 64/bin/go git -C /tmp/gh-aw-test-runs/20260425-213529-58958/test-122506678/.github/workflows rev-parse /usr/bin/git ath ../../../.prgit GO111MODULE 64/bin/go 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 --show-toplevel x_amd64/compile /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/link 3796054830/001' 3796054830/001' x_amd64/compile /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/link -o /tmp/go-build3361004877/b447/stringutil.test -importcfg rue,"errors":[],"warnings":[]}] -s -w -buildmode=exe git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.2.3 --jq [.object.sha, .object.type] | @tsv git-upload-pack '/tmp/TestParseDefaultBranchFromLsRemoteWithRealremote.origin.url git-upload-pack '/tmp/TestParseDefaultBranchFromLsRemoteWithRealGitmain_branch1422548265/001' /usr/bin/git .github/workflowgit GO111MODULE 64/bin/go git -C /tmp/gh-aw-test-runs/20260425-213529-58958/test-2077411763/.github/workflows rev-parse /usr/bin/git ath ../../../.prgit GO111MODULE 64/bin/go git (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 I_fS/lEXOLD1Q0N_qtyQmI_fS x_amd64/compile GOINSECURE ntio/asm/ascii GOMODCACHE x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh run download 1 --dir test-logs/run-1 l_test.go 64/pkg/tool/linux_amd64/compile GOINSECURE fips140/ed25519 GOMODCACHE 64/pkg/tool/linux_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/1/artifacts --jq .artifacts[].name GO111MODULE /opt/hostedtoolcache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE /opt/hostedtoolcache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (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 .cfg x_amd64/compile GOINSECURE /go-yaml/lexer GOMODCACHE x_amd64/compile env WTp5/H9VjfFv7QroIIAr-WTp5 GO111MODULE ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh run download 12345 --dir test-logs/run-12345 .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE 8171528/b133/ GOMODCACHE 64/pkg/tool/linux_amd64/vet env 8171528/b059/importcfg .cfg ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet GOINSECURE 8171528/b133/ariremote ache/go/1.25.8/x64/src/math/big/--get ache/go/1.25.8/x64/pkg/tool/linuremote.origin.url (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/12345/artifacts --jq .artifacts[].name DefaultBranchFromLsRemoteWithRealGitbranch_with_hyphen2965577155/001' ache/go/1.25.8/x64/bin/node GOINSECURE GOMOD erignore go m/_n�� -json GO111MODULE ache/node/24.14.1/x64/bin/node GOINSECURE GOMOD GOMODCACHE go (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 .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE /go-yaml/printerrev-parse GOMODCACHE 64/pkg/tool/linux_amd64/vet env m_exec.js from: $(go env GOROOT)/lib/wasm/wasm_e-p GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh run download 12346 --dir test-logs/run-12346 .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE e/jsonschema-go/rev-parse GOMODCACHE 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/12346/artifacts --jq .artifacts[].name GO111MODULE 1/x64/bin/node GOINSECURE GOMOD GOMODCACHE erignore t-ha�� ithub/workflows/agent-performance-analyzer.md GO111MODULE /opt/hostedtoolcache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (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 .cfg x_amd64/link GOINSECURE ntio/encoding/isrev-parse GOMODCACHE x_amd64/link (http block)
    • Triggering command: /usr/bin/gh gh run download 2 --dir test-logs/run-2 xxol/GL-tkTNtkvunLaxVxxol 64/pkg/tool/linux_amd64/link GOINSECURE contextprotocol/rev-parse GOMODCACHE 64/pkg/tool/linux_amd64/link (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/2/artifacts --jq .artifacts[].name GO111MODULE /opt/hostedtoolcache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 1/x64/bin/node GOINSECURE GOMOD GOMODCACHE 1/x64/bin/node (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 GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh run download 3 --dir test-logs/run-3 GO111MODULE stants.test GOINSECURE 8171528/b006/asmconfig ache/go/1.25.8/xuser.email stants.test 3610�� -json hW2J/wOV8HATkBOuFSSLThW2J x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/3/artifacts --jq .artifacts[].name GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE /opt/hostedtoolcache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (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 .cfg x_amd64/link GOINSECURE ntio/encoding/asrev-parse GOMODCACHE x_amd64/link (http block)
    • Triggering command: /usr/bin/gh gh run download 4 --dir test-logs/run-4 llzq/kleu3xr21GcpMTTxllzq 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/4/artifacts --jq .artifacts[].name GO111MODULE ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile env -json GO111MODULE /opt/hostedtoolcache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (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 .cfg aw.test GOINSECURE ntio/encoding/jsrev-parse GOMODCACHE aw.test 3610�� se 1004877/b023/vet.cfg ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh run download 5 --dir test-logs/run-5 .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE fips140/edwards2rev-parse 8171528/b006/sym--git-dir 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/5/artifacts --jq .artifacts[].name GO111MODULE ache/go/1.25.8/x64/pkg/tool/linu-test.short=true GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linuTest User env -json GO111MODULE 1/x64/bin/node GOINSECURE GOMOD GOMODCACHE 1/x64/bin/node (http block)
  • https://api.github.com/repos/github/gh-aw/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path -json n/codec.go x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_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 --workflow nonexistent-workflow-12345 --limit 100 GOMOD GOMODCACHE x_amd64/vet env -json rotocol/go-sdk@v1.5.0/internal/json/json.go x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_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 --workflow nonexistent-workflow-12345 --limit 6 GOMOD 8171528/b021/symadd 64/pkg/tool/linumyorg env rdian.md 4ACQ/f02Eva1ttQPQuPWq4ACQ ache/go/1.25.8/x64/pkg/tool/linu-nilfunc GOINSECURE t/message GOMODCACHE ache/go/1.25.8/xtest@example.com (http block)
  • https://api.github.com/repos/github/gh-aw/contents/.github/workflows/shared/reporting.md
    • Triggering command: /tmp/go-build3361004877/b404/cli.test /tmp/go-build3361004877/b404/cli.test -test.testlogfile=/tmp/go-build3361004877/b404/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
    • Triggering command: /tmp/go-build3692880717/b404/cli.test /tmp/go-build3692880717/b404/cli.test -test.testlogfile=/tmp/go-build3692880717/b404/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (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 ache/go/1.25.8/x^remote\..*\.gh-resolved$ /usr/bin/git agent-performancgit stmain.go ache/go/1.25.8/x--show-toplevel git rev-�� --show-toplevel ache/go/1.25.8/xrev-parse /usr/bin/git 1004877/b413/conls /tmp/go-build336-lh e/git git (http block)
    • 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 go /usr/bin/git heck '**/*.cjs' git GO111MODULE e_modules/.bin/n--show-toplevel git rev-�� --show-toplevel go /usr/bin/git 4127627469 GO111MODULE /opt/hostedtoolc/tmp/gh-aw/aw-feature-branch.patch git (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 2476361860/.github/workflows 1004877/b244/vet.cfg k GOSUMDB er 64/bin/go ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet sRem�� Tmit7aPmK -trimpath 1/x64/bin/node -p syscall -lang=go1.25 ortcfg (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq [.object.sha, .object.type] | @tsv repo2981244307/001 GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env source-field-variant-3005512430/.github/workflows GO111MODULE ules/.bin/sh GOINSECURE GOMOD GOMODCACHE go (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 /a.out GO111MODULE x_amd64/vet GOINSECURE 7sqeml6bq3lKSp50-C GOMODCACHE x_amd64/vet env g_.a GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.2.3 --jq [.object.sha, .object.type] | @tsv -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go 4908�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (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 -json GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet env g_.a GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet (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 -json GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE S1tZJmA/IR2ra6tzrev-parse env g_.a 0/internal/language/common.go x_amd64/vet GOINSECURE GOMOD abis x_amd64/vet (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 g_.a GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE 9B8vwjI/_jU1qxM0-test.v=true phen�� g_.a /semver/semver.g-test.run=^Test x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet (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 iant-3211404952/.github/workflows GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet env g_.a emplate/v3@v3.0.2/compile.go x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v3.0.0 --jq [.object.sha, .object.type] | @tsv -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go 4908�� -json GO111MODULE sh GOINSECURE GOMOD GOMODCACHE go (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 2476361860/.github/workflows 1004877/b289/vet.cfg ortcfg.link -p main -lang=go1.25 9Ym34G_sfJyM6o-Ioz/mT-tLcfK0hMgkrev-parse -o 8171528/b223/importcfg -trimpath 64/pkg/tool/linux_amd64/compile -p crypto/internal/run -lang=go1.25 64/pkg/tool/linu12345 (http block)
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq [.object.sha, .object.type] | @tsv 51857/001 GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env 80/001/test-frontmatter-with-nested-objects.md GO111MODULE ules/.bin/node GOINSECURE GOMOD GOMODCACHE go (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 GOINSECURE l GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet -V=f�� 2476361860 FnMM/DTE1YZYN5-LgmGb0FnMM .cfg GOSUMDB GOWORK 64/bin/go ache/go/1.25.8/x64/pkg/tool/linuconfig (http block)
    • Triggering command: /usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion GOINSECURE GOMOD GOMODCACHE go t-24�� sistency_GoAndJavaScript2544290080/001/test-inlined-imports-enabled-with-env-template-expressiongit GO111MODULE es GOINSECURE GOMOD GOMODCACHE sh (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 x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE x_amd64/vet GOINSECURE GOMOD sm.s x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh workflow list --repo owner/repo --json name,path,state ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (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 -json go x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env orts,XTestImpor GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/test/repo
    • Triggering command: /usr/bin/gh gh api /repos/test/repo --jq .default_branch 15/001/test-inlined-imports-enab-errorsas 1004877/b036/vet.cfg x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh api /repos/test/repo --jq .default_branch GOMODCACHE go om/org1/repo1.git -json GO111MODULE 64/bin/go git rev-�� --show-toplevel go /usr/bin/git iant-1567479625 GO111MODULE 64/bin/go git (http block)
  • invalid.example.invalid
    • Triggering command: /usr/lib/git-core/git-remote-https /usr/lib/git-core/git-remote-https origin https://invalid.example.invalid/nonexistent-repo.git e/git conf�� --local --get ode_modules/.bin/git =receive Test User t (dns block)

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

Copilot AI changed the title [WIP] Refactor repeated map-to-sorted-slice pattern in domains.go refactor: replace map-to-sorted-slice boilerplate with slices.Sorted(maps.Keys(...)) Apr 25, 2026
Copilot AI requested a review from pelikhan April 25, 2026 21:37
@pelikhan pelikhan marked this pull request as ready for review April 25, 2026 21:43
Copilot AI review requested due to automatic review settings April 25, 2026 21:43
@pelikhan pelikhan merged commit c2b3801 into main Apr 25, 2026
19 checks passed
@pelikhan pelikhan deleted the copilot/refactor-map-to-sorted-slice-pattern branch April 25, 2026 21:43
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

Refactors repeated “collect map keys + sort” patterns into a single idiomatic expression using maps.Keys and slices.Sorted to keep domain/key output deterministic while reducing boilerplate.

Changes:

  • Replaced 8 instances of manual map-key collection + sort.Strings in pkg/workflow/domains.go with slices.Sorted(maps.Keys(...)).
  • Simplified sortedMapKeys in pkg/workflow/map_helpers.go to a one-liner and updated imports accordingly.
Show a summary per file
File Description
pkg/workflow/domains.go Removes repeated map-to-sorted-slice boilerplate for deterministic domain lists; adds maps/slices imports.
pkg/workflow/map_helpers.go Collapses sortedMapKeys to slices.Sorted(maps.Keys(m)) and replaces sort import with maps/slices.

Copilot's findings

Tip

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

  • Files reviewed: 2/2 changed files
  • Comments generated: 2

}
sort.Strings(keys)
return keys
return slices.Sorted(maps.Keys(m))
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

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

Using slices.Sorted(maps.Keys(m)) allocates twice: maps.Keys already allocates a new slice of keys, and slices.Sorted returns a sorted copy (it clones before sorting). If this helper is called frequently, consider sorting in place (e.g., get keys via maps.Keys, then slices.Sort) to keep the single-allocation behavior of the previous implementation.

Suggested change
return slices.Sorted(maps.Keys(m))
keys := maps.Keys(m)
slices.Sort(keys)
return keys

Copilot uses AI. Check for mistakes.
Comment thread pkg/workflow/domains.go
result = append(result, d)
}
sort.Strings(result)
result := slices.Sorted(maps.Keys(domainMap))
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

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

slices.Sorted(maps.Keys(domainMap)) clones and sorts a fresh slice, but maps.Keys already allocates a fresh slice; this introduces an extra allocation vs the previous in-place sort.Strings on the collected keys. If domain lists can be large or computed often, consider sorting in place (maps.Keys + slices.Sort) to avoid the additional allocation.

Suggested change
result := slices.Sorted(maps.Keys(domainMap))
result := maps.Keys(domainMap)
slices.Sort(result)

Copilot uses AI. Check for mistakes.
@github-actions github-actions Bot mentioned this pull request Apr 25, 2026
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.

Replace repeated map-to-sorted-slice pattern in domains.go with slices.Sorted(maps.Keys(...))

3 participants