Skip to content

refactor: split LogAnalysis into read-only and mutable interfaces - #29579

Merged
pelikhan merged 2 commits into
mainfrom
copilot/refactor-loganalysis-interface
May 1, 2026
Merged

pelikhan merged 2 commits into
mainfrom
copilot/refactor-loganalysis-interface

Conversation

Copilot AI commented May 1, 2026 •

Copy link
Copy Markdown
Contributor

LogAnalysis mixed read accessors with mutation methods, violating ISP and forcing read-only consumers to implement unnecessary mutation methods.

Changes

  • pkg/cli/log_aggregation.go: Split LogAnalysis into two interfaces:
    • LogAnalysis — read-only (GetAllowedDomains, GetBlockedDomains)
    • MutableLogAnalysis — embeds LogAnalysis, adds SetAllowedDomains, SetBlockedDomains, AddMetrics
  • Updated LogParser[T] and aggregateLogFiles[T] generic constraints from LogAnalysis → MutableLogAnalysis (both call mutation methods on the aggregated result)
  • AddMetrics(other LogAnalysis) parameter type left as LogAnalysis — the argument is only read from
  • pkg/cli/log_aggregation_test.go: Added compile-time interface satisfaction checks for MutableLogAnalysis on both *DomainAnalysis and *FirewallAnalysis
// Before
type LogAnalysis interface {
    GetAllowedDomains() []string
    GetBlockedDomains() []string
    SetAllowedDomains(domains []string)
    SetBlockedDomains(domains []string)
    AddMetrics(other LogAnalysis)
}

// After
type LogAnalysis interface {
    GetAllowedDomains() []string
    GetBlockedDomains() []string
}

type MutableLogAnalysis interface {
    LogAnalysis
    SetAllowedDomains(domains []string)
    SetBlockedDomains(domains []string)
    AddMetrics(other LogAnalysis)
}

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 ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet GOINSECURE t/internal/catmsrev-parse GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linuremote.origin.url (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 GOMOD GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linuremote.origin.url (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 GOMOD GOMODCACHE 64/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 GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet (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 xterm-color 64/pkg/tool/linuTest User /usr/bin/git util.test 2910166/b036/vetrev-parse x_amd64/vet git rev-�� --show-toplevel x_amd64/vet /usr/bin/git se 2910166/b093/vet/opt/hostedtoolcache/node/24.14.1/x64/bin/npm g_.a 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/TestHashConsistency_WithImports1273076178/001/main.md x_amd64/vet /usr/bin/git .a GOPROXY x_amd64/vet git rev-�� --show-toplevel x_amd64/vet /usr/bin/git .a ZW5eqtFbR x_amd64/vet 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 Onlymin-integrity_only_defaults_repo244230556/001 g/fileutil/tar.go ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile -p crypto/internal/-1 -lang=go1.25 ache/go/1.25.8/x64/pkg/tool/linuTest User -uns�� 3946-33594/test-2314277235 /tmp/go-build1942910166/b140/vet.cfg 64/pkg/tool/linux_amd64/vet -goversion b/gh-aw/pkg/giturev-parse -c=4 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq [.object.sha, .object.type] | @tsv --show-toplevel ache/go/1.25.8/x64/pkg/tool/linurev-parse /usr/bin/git /tmp/go-build727git -trimpath 2910166/b417/env--show-toplevel git rev-�� --show-toplevel 2910166/b417/envutil.test /usr/bin/git 3946-33594/test-git c e/git 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 e/git /usr/bin/git --show-toplevel x_amd64/compile /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git ansitiveImports3git rev-parse r,url,status,con--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 -unreachable=false /tmp/go-build1942910166/b227/vet.cfg 2910166/b426/vet.cfg =receive GO111MODULE 64/bin/go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv -stringintconv -tests /bin/sh -json GO111MODULE x_amd64/asm /bin/sh -c git-upload-pack '/tmp/TestParseDefaultBranchFromLsRemoteWithRealGitmaster_branchremote.origin.urgit l 1/x64/bin/node -json ase64.go x_amd64/asm 1/x64/bin/node (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv ErrorFormatting2237797116/001 config /usr/bin/git l 35679184/001' x_amd64/compile git rev-�� s/test.md x_amd64/compile /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linu168.63.129.16 1 GO111MODULE x_amd64/vet /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linuowner (http block)
  • https://api.github.com/repos/actions/download-artifact/git/ref/tags/v8
    • Triggering command: /usr/bin/gh gh api /repos/actions/download-artifact/git/ref/tags/v8 --jq [.object.sha, .object.type] | @tsv -output.go git ache/node/24.14.1/x64/bin/git 11081bcae850e3cb/usr/bin/gh --stdout es/.bin/git Gn/zlMjhZpMQGYe2-f test�� -q (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/download-artifact/git/ref/tags/v8 --jq [.object.sha, .object.type] | @tsv . git n3 11081bcae850e3cb/usr/bin/gh --stdout ules/.bin/git git test�� -q (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/download-artifact/git/ref/tags/v8 --jq [.object.sha, .object.type] | @tsv --require k/gh-aw/gh-aw/actions/setup/js/node_modules/viteowner=github t.lock.yml node --conditions development k/gh-aw/gh-aw/acrev-parse run ithub/workflows git /home/REDACTED/.config/composer/ve-f l git k/node_modules/./home/REDACTED/work/gh-aw/gh-aw python3 (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/vet /usr/bin/git vaScript68616312git /tmp/go-build194status .test git rev-�� --show-toplevel .test /usr/bin/git -unreachable=falgit /tmp/go-build194rev-parse (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 race 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/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 GOMODCACHE 64/pkg/tool/linux_amd64/vet /usr/bin/git 29416/b090/_pkg_git .cfg 64/pkg/tool/linu--show-toplevel git rev-�� --show-toplevel 64/pkg/tool/linux_amd64/vet /usr/bin/git 29416/b257/_pkg_git .cfg x_amd64/link 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 runs/20260501-163946-33594/test-527248245 rev-parse 2910166/b465/vet.cfg s/test.md GO111MODULE x_amd64/vet node /tmp�� /tmp/TestHashStability_SameInputSameOutput236947INVALID,NEW x_amd64/vet /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/linux_amd64/vet /usr/bin/git LsRemoteWithRealgit LsRemoteWithRealrev-parse 64/pkg/tool/linu--show-toplevel /usr/bin/git conf�� --get-regexp ^remote\..*\.gh-resolved$ /usr/bin/git b/workflows til_test.go ache/go/1.25.8/x--show-toplevel git (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 -unreachable=false /tmp/go-build1942910166/b230/vet.cfg /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet -json GO111MODULE 64/bin/go /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linuorigin -ato�� tructions-test-1298511168/.github/workflows s 1/x64/bin/node -errorsas -ifaceassert -nilfunc /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv sistency_GoAndJavaScript686163127/001/test-complex-frontmatter-w-test.timeout=10m0s test@example.com .git e_wasm.s GO111MODULE x_amd64/compile ache/go/1.25.8/x64/pkg/tool/linux_amd64/link add 2910166/b459/tty.test x_amd64/compile 2910166/b459/importcfg.link -json GO111MODULE x_amd64/compile XHjoE8hqd2SJr/Mm0ui0x2Iv4Z-LYbBHBh/hKJC44cVKMHVnpBvTgXO/G1KutSxXHjoE8hqd2SJr (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv /tmp/go-build1942910166/b431/_pkg_.a -trimpath 2910166/b449/vet.cfg -p main -lang=go1.25 git conf�� --get remote.origin.url /usr/bin/infocmp go1.25.8 -c=4 -nolocalimports infocmp (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 k/gh-aw/gh-aw/pkg/styles/huh_theme.go k/gh-aw/gh-aw/pkg/styles/theme.go clusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle remote.origin.urgit GO111MODULE 64/bin/go git rev-�� --show-toplevel go /usr/bin/git cut -f1))" GO111MODULE x_amd64/vet 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 test@example.com ache/node/24.14.1/x64/bin/git --verify 61 run-script/lib/nuser.name git rev-�� HEAD ode_modules/vitemain n-dir/git 0190395be6c094fa/usr/bin/gh tions/setup/js/napi 64/bin/node git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq [.object.sha, .object.type] | @tsv commit.gpgsign false tnet/tools/git --verify 61 bin/node git rev-�� HEAD ode_modules/vitest/suppress-warnings.cjs ache/node/24.14.1/x64/bin/git 0190395be6c094fagit --stdout _modules/.bin/gi/home/REDACTED/work/gh-aw/gh-aw/.github/workflows ode_modules/viterev-parse (http block)
  • https://api.github.com/repos/github/gh-aw
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw --jq .default_branch --binary --output=/tmp/git-patch-utils-WKul4k/.diffsize.tmp k/gh-aw/node_modules/.bin/go c92410ab100107adgit git ache/uv/0.11.8/x/home/REDACTED/work/gh-aw/gh-aw/.github/workflows git add test-RsA9pG/test.go node r: $owner, name: $name) { hasDiscussionsEnabled } } (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw --jq .default_branch /tmp/go-handler-test-O9T6Ff/test-cwd.go git m-evolution-insights.lock.yml nonexistent-brangit jKJz/.diffsize.t-C es/.bin/git python3 /tmp�� ithub/workflows git (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 GOMODCACHE 64/pkg/tool/linu-tests /usr/lib/git-core/git tcfg .cfg 64/pkg/tool/linu--show-toplevel /usr/lib/git-core/git remo�� origin REDACTED /usr/bin/git rity2849543105/0git fWCy/na03iXLzDBMrev-parse ache/go/1.25.8/x--show-toplevel 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 --get (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 user.name Test User ache/node/24.14.1/x64/bin/node -json GO111MODULE x_amd64/vet /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/compile t-43�� k/gh-aw/gh-aw/.github/workflows/architecture-guardian.md -trimpath /usr/bin/git -p main -lang=go1.25 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 >=2026-04-24 GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet env tcfg .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linutest-branch (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 >=2026-04-01 GOMOD GOMODCACHE 64/pkg/tool/linuremote.origin.url tcfg�� add-source-path-4049947248/.github/workflows om/goccy/go-yaml@v1.19.2/ast/ast.go 64/pkg/tool/linux_amd64/vet ata/action_pins.git fips140deps/byteadd GOMODCACHE 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 >=2026-01-31 GOMOD GOMODCACHE x_amd64/link tcfg�� ty-test.md .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE boring/sig GOMODCACHE w4/MTK9fk8zVRHRis0Hc7kg/TlDa0Hf-Bb3BnF9Rs13V (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 GO111MODULE x_amd64/compile GOINSECURE fips140/edwards2rev-parse ache/go/1.25.8/x--show-toplevel x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh run download 1 --dir test-logs/run-1 O8a-/w8uJjXynBhCHi02xO8a- .cfg GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (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 64/pkg/tool/linux_amd64/vet GOINSECURE /go-yaml ache/go/1.25.8/x64/src/math/flooxterm-color 64/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/compile GOINSECURE GOMOD 29416/b011/symab--show-toplevel 64/pkg/tool/linux_amd64/compile (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 x_amd64/vet GOINSECURE b/gh-aw/pkg/cons/tmp/js-hash-test-3639823210/test-hash.js GOMODCACHE x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh run download 12346 --dir test-logs/run-12346 .cfg ionpins.test GOINSECURE fips140/nistec/frev-parse GOMODCACHE ionpins.test 9429�� 3457850894/.github/workflows 2910166/b025/vet.cfg ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/xremote.origin.url (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 GO111MODULE 64/pkg/tool/linux_amd64/compile GOINSECURE fips140/nistec ache/go/1.25.8/x--show-toplevel 64/pkg/tool/linux_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh run download 2 --dir test-logs/run-2 pRaw/gwkwek_UF5vdtNyzpRaw ache/go/1.25.8/x64/pkg/tool/linu-nolocalimports GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linu/tmp/go-build1942910166/b431/_testmain.go (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 29416/b011/sys_wrev-parse ache/go/1.25.8/x--show-toplevel 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh run download 3 --dir test-logs/run-3 bYse/Agvt9vB4Z3tFs27lbYse ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linu-test.v=true (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 GO111MODULE 64/pkg/tool/linux_amd64/link GOINSECURE fips140cache ache/go/1.25.8/x/home/REDACTED/work/gh-aw/gh-aw/.github/workflows/artifacts-summary.md 64/pkg/tool/linux_amd64/link (http block)
    • Triggering command: /usr/bin/gh gh run download 4 --dir test-logs/run-4 gLhb/hBEUOkjpLNrZf4ikgLhb ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet GOINSECURE fips140/hkdf GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linu-test.v=true (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 zm1t/ybsydLQ-bM8eUCGDzm1t x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh run download 5 --dir test-logs/run-5 stmain.go 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/compile (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 GO111MODULE x_amd64/asm GOINSECURE GOMOD GOMODCACHE x_amd64/asm 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 .a 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 6 29416/b007/abi_trev-parse ache/go/1.25.8/x--show-toplevel 64/pkg/tool/linux_amd64/vet env gh-aw.wasm ($(du -h gh-aw.wasm | cut -f1))" cYAj/2RoSUfAH8dMcuiX4cYAj 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/github/gh-aw/contents/.github/workflows/shared/reporting.md
    • Triggering command: /tmp/go-build1942910166/b404/cli.test /tmp/go-build1942910166/b404/cli.test -test.testlogfile=/tmp/go-build1942910166/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)
  • 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/xsecurity /usr/bin/git 3946-33594/test-git /tmp/go-build194rev-parse ingutil.test git rev-�� --show-toplevel ingutil.test /usr/bin/git wabs/iktU4GgBgEadu -buildtags /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 7/001/test-inlined-imports-enabl-s 2910166/b123/vet.cfg ache/go/1.25.8/x64/pkg/tool/linu-buildmode=exe -p internal/msan -lang=go1.25 ache/go/1.25.8/x64/pkg/tool/linurev-parse (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 -json eutil.go x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet env .a GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet (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 ]; then \ cp .github/aw/ac-errorsas GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet env -json 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 x_amd64/vet er_b�� .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 iant-1323740232 GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet env 99157164/001 99157164/002/work 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 -json fer.go x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet env .a GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet (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 se 2910166/b062/vet.cfg .cfg -p internal/runtimerev-parse -lang=go1.25 ache/go/1.25.8/x64/pkg/tool/linu-buildtags (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 t/internal/languinit GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linu-test.v=true (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 sm_wasm.s 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 emclr_wasm.s x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh workflow list --repo owner/repo --json name,path,state .cfg GOINSECURE GOMOD GOMODCACHE 06/m1mI9m8ZybBw5VAsfaec/Pi1C9UClmDRmydbNI-g3 (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 GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE x_amd64/vet GOINSECURE util GOMODCACHE x_amd64/vet (http block)
  • https://api.github.com/repos/test/repo
    • Triggering command: /usr/bin/gh gh api /repos/test/repo --jq .default_branch 2910166/b394/_pkg_.a FnMM/DTE1YZYN5-LgmGb0FnMM ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet -n1 b/gh-aw/pkg/actirev-parse --end-of-options--show-toplevel ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet -o DefaultBranchFromLsRemoteWithRealGitcustom_branch499157164/001' DefaultBranchFromLsRemoteWithRealGitcustom_branch499157164/001' ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet -p crypto/internal/rev-parse -lang=go1.25 ache/go/1.25.8/x64/pkg/tool/linumyorg (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 init�� ndor/bin/git git ode_modules/.bin/git =receive test@example.com--git-dir=/tmp/bare-incremental-iKMK5j /git (dns block)

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

…erns

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/ef754525-3ec8-4d33-b80e-9de367e38ffe

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor LogAnalysis interface to separate read-only and mutation methods refactor: split LogAnalysis into read-only and mutable interfaces May 1, 2026
Copilot AI requested a review from gh-aw-bot May 1, 2026 16:45
@pelikhan
pelikhan marked this pull request as ready for review May 1, 2026 17:05
Copilot AI review requested due to automatic review settings May 1, 2026 17:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Refactors the LogAnalysis abstraction to better follow the Interface Segregation Principle by separating read-only access from mutation/aggregation behaviors.

Changes:

  • Split LogAnalysis into a read-only LogAnalysis and a write-capable MutableLogAnalysis (which embeds LogAnalysis).
  • Tightened generic constraints for LogParser[T] and aggregateLogFiles[T] to require MutableLogAnalysis since aggregation mutates the result.
  • Added compile-time interface satisfaction checks ensuring *DomainAnalysis and *FirewallAnalysis implement MutableLogAnalysis.
Show a summary per file
File Description
pkg/cli/log_aggregation.go Introduces MutableLogAnalysis and updates generic constraints to reflect actual mutating behavior during aggregation.
pkg/cli/log_aggregation_test.go Adds compile-time checks validating DomainAnalysis/FirewallAnalysis implement the new mutable interface.

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: 0

@github-actions github-actions Bot mentioned this pull request May 1, 2026
@github-actions

github-actions Bot commented May 1, 2026

Copy link
Copy Markdown
Contributor

🧪 Test Quality Sentinel Report

Test Quality Score: 70/100

⚠️ Acceptable — with suggestions

Metric Value
New/modified tests analyzed 2
✅ Design tests (behavioral contracts) 2 (100%)
⚠️ Implementation tests (low value) 0 (0%)
Tests with error/edge cases 0 (0%)
Duplicate test clusters 0
Test inflation detected No (1:1 ratio)
🚨 Coding-guideline violations 0

Test Classification Details

Test File Classification Issues Detected
TestDomainAnalysisImplementsMutableLogAnalysis pkg/cli/log_aggregation_test.go:18 ✅ Design Compile-time interface contract; no error cases possible
TestFirewallAnalysisImplementsMutableLogAnalysis pkg/cli/log_aggregation_test.go:23 ✅ Design Compile-time interface contract; no error cases possible

Flagged Tests — Requires Review

No tests require mandatory review. However, the following observation is noted:

i️ TestDomainAnalysisImplementsMutableLogAnalysis and TestFirewallAnalysisImplementsMutableLogAnalysis

Classification: Design tests (compile-time interface contracts)
Note: These follow the established pattern in the file (var _ Interface = (*Type)(nil)). They are correct and idiomatic Go — they enforce at compile time that both concrete types implement the new MutableLogAnalysis interface introduced by the refactor. They cannot have error paths or runtime assertions by nature.
Suggestion (optional): Consider adding a complementary behavioural test that calls SetAllowedDomains / SetBlockedDomains through a MutableLogAnalysis variable and then reads back via LogAnalysis — this would demonstrate the real-world usage of the interface split (e.g., passing a MutableLogAnalysis to an aggregation step and then reading results through the narrower LogAnalysis interface).


Language Support

Tests analyzed:

  • 🐹 Go (*_test.go): 2 tests — unit (//go:build !integration)
  • 🟨 JavaScript (*.test.cjs, *.test.js): 0 tests

Verdict

✅ Check passed. 0% of new tests are implementation tests (threshold: 30%). Both new tests are compile-time interface-compliance checks, which correctly enforce that the concrete types DomainAnalysis and FirewallAnalysis satisfy the newly introduced MutableLogAnalysis interface. No coding-guideline violations detected.

The 0% edge-case coverage (dragging the score to 70 from 100) is a structural limitation of compile-time assertion tests — not a deficiency in this PR.


📖 Understanding Test Classifications

Design Tests (High Value) verify what the system does:

  • Assert on observable outputs, return values, or state changes
  • Cover error paths and boundary conditions
  • Would catch a behavioral regression if deleted
  • Remain valid even after internal refactoring

Implementation Tests (Low Value) verify how the system does it:

  • Assert on internal function calls (mocking internals)
  • Only test the happy path with typical inputs
  • Break during legitimate refactoring even when behavior is correct
  • Give false assurance: they pass even when the system is wrong

Goal: Shift toward tests that describe the system's behavioral contract — the promises it makes to its users and collaborators.

References: §25224048438

🧪 Test quality analysis by Test Quality Sentinel · ● 510.4K · ◷

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Test Quality Sentinel: 70/100. Test quality is acceptable — 0% of new tests are implementation tests (threshold: 30%). Both new tests are idiomatic Go compile-time interface contracts enforcing the MutableLogAnalysis refactor.

@pelikhan
pelikhan merged commit 443f0e4 into main May 1, 2026
41 checks passed
@pelikhan
pelikhan deleted the copilot/refactor-loganalysis-interface branch May 1, 2026 18:21
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.

refactor: split LogAnalysis interface to separate read-only and mutation concerns

4 participants