Skip to content

Fix gh aw add not recursively downloading transitive shared imports#28834

Merged
pelikhan merged 2 commits intomainfrom
copilot/add-integration-test-for-workflows
Apr 28, 2026
Merged

Fix gh aw add not recursively downloading transitive shared imports#28834
pelikhan merged 2 commits intomainfrom
copilot/add-integration-test-for-workflows

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 28, 2026

gh aw add silently dropped transitive shared imports — when a top-level workflow imported shared/daily-audit-base.md, that file's own imports (shared/daily-audit-discussion.md, shared/reporting.md, etc.) were never downloaded.

Root Cause

fetchFrontmatterImportsRecursive resolved all relative paths against currentBaseDir (the importing file's directory). A file at .github/workflows/shared/daily-audit-base.md importing shared/reporting.md resolved to the non-existent .github/workflows/shared/shared/reporting.md — silently skipped on 404.

The repo convention is that import paths like shared/foo.md are always relative to the workflow root (.github/workflows/), not the importing file's own directory.

Fix

pkg/cli/includes.go — split path resolution in fetchFrontmatterImportsRecursive:

  • ./foo / ../foo (explicitly relative) → resolve against currentBaseDir (preserves sibling-file references like shared/mcp/serena-go.md → ./serena.md)
  • shared/foo.md (non-explicit relative) → resolve against originalBaseDir (workflow root), matching the repo-wide import convention

Test

Added TestAddWorkflowWithRecursiveSharedImports (integration) pinned to 8d26856, covering the full 3-level import tree of daily-compiler-quality.md:

daily-compiler-quality.md
├── shared/daily-audit-base.md
│   ├── shared/daily-audit-discussion.md  ← was missing
│   ├── shared/reporting.md               ← was missing
│   └── shared/observability-otlp.md      ← was missing
└── shared/go-source-analysis.md
    ├── shared/mcp/serena-go.md           ← was missing
    │   └── shared/mcp/serena.md          ← was missing (./serena.md)
    └── shared/reporting.md

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 (http block)
    • Triggering command: /usr/bin/gh gh repo view owner/repo (http block)
    • Triggering command: /usr/bin/gh gh repo view owner/host-repo (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 d er-docs-review.m-ifaceassert analysis.md k/gh-aw/gh-aw/pktail k/gh-aw/gh-aw/pk-20 k/gh-aw/gh-aw/pk-stringintconv k/gh-aw/gh-aw/pk-tests k/gh�� k/gh-aw/gh-aw/pkg/agentdrain/spec_test.go k/gh-aw/gh-aw/pkg/agentdrain/coordinator.go 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 --show-toplevel 64/pkg/tool/linux_amd64/link /usr/bin/git onpins.test 6196954/b034/vetrev-parse 64/pkg/tool/linu--show-toplevel git rev-�� --show-toplevel 64/pkg/tool/linux_amd64/vet /usr/bin/git 31/001/test-inlinode 6196954/b244/vet/opt/hostedtoolcache/node/24.14.1/x64/bin/npm _.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 3255-14740/test-1770494258 (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 3255-14740/test-3212553462/.github/workflows (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq [.object.sha, .object.type] | @tsv --show-toplevel rtcfg /usr/bin/git /001/inlined-a.mtr ne_constants.go ache/go/1.25.8/x: git rev-�� --show-toplevel ache/go/1.25.8/xremote /usr/bin/git 194969734 /tmp/go-build375rev-parse 1/x64/bin/node 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 git /usr/bin/git r-test2287978106git r-test2287978106rev-parse /usr/bin/git git rev-�� --show-toplevel git /usr/bin/gh --get remote.origin.urrev-parse /opt/hostedtoolc--show-toplevel gh (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 -bool -buildtags 1/x64/bin/node -errorsas -ifaceassert -nilfunc git t-ha�� ithub/workflows/agent-persona-explorer.md -tests ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet s/data/action_pigit --local ash ache/go/1.25.8/x64/pkg/tool/linu-importcfg (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv 3255-14740/test-194969734 -test.v=true ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile -test.timeout=10git -test.run=^Test -test.short=true--show-toplevel ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile rev-�� 963412/b454/_pkg_.a git 963412/b454=> --local b/gh-aw/pkg/testrev-parse 86_64/git /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv --all-progress-implied --revs e/git --thin --delta-base-offrev-parse -q e/git conf�� user.email test@example.com /usr/bin/git k/gh-aw/gh-aw/pkgit k/gh-aw/gh-aw/pkrev-parse x_amd64/vet git (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 /opt/hostedtoolcache/go/1.25.8/x/tmp/go-build965963412/b466/_testmain.go /usr/bin/git ithub/workflows /tmp/go-build375rev-parse /opt/hostedtoolcHEAD git rev-�� --show-toplevel /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linu-tests /usr/bin/git faultBranchFromLgit faultBranchFromLrev-parse /usr/bin/git 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 d -n 10 ratchpad/template-syntax-sanitization.md ratchpad/labels.md ratchpad/token-b/opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet ratchpad/mods/RE-unsafeptr=false ratchpad/mods/js-unreachable=false ratchpad/code-or/tmp/go-build3756196954/b148/vet.cfg ratc�� json' --ignore-path ../../../.pr**/*.json ithub/workflows/shared/activatio--ignore-path ithub/workflows/shared/apm.md ithub/workflows//opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet ithub/workflows/-unsafeptr=false ithub/workflows/-unreachable=false ithub/workflows//tmp/go-build3756196954/b256/vet.cfg (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq [.object.sha, .object.type] | @tsv get --local sh committer.name (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq [.object.sha, .object.type] | @tsv TOKEN"; }; f store TOKEN"; }; f store 64/bin/bash committer.email (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 ry=1 64/pkg/tool/linuconfig 963412/b469/_pkg_.a te '../../../**/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 --get remote.origin.url /usr/bin/git k/gh-aw/gh-aw/pkgit k/gh-aw/gh-aw/pkrev-parse x_amd64/vet git rev-�� --show-toplevel resolved$ /usr/bin/git */*.ts' '**/*.jsgit /home/REDACTED/worrev-parse 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/linu-goversion 963412/b468/vet.cfg y-test.md .cfg ache/go/1.25.8/x--show-toplevel infocmp -1 xterm-color ache/go/1.25.8/x/home/REDACTED/work/gh-aw/gh-aw/pkg/timeutil/format_test.go /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/compile plorer.md 6196954/b041/vetrev-parse ache/go/1.25.8/x--show-toplevel /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/compile (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/TestParseDefaultBranchFromLsRemoteWithRealgo1.25.8 '/tmp/TestParseDefaultBranchFromLsRemoteWithReal-c=4 1/x64/bin/node -errorsas -ifaceassert -nilfunc git t-ha�� ithub/workflows/agentic-observability-kit.md -tests /usr/bin/git l d _modules/.bin/no--show-toplevel 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/go-build965963412/b409/_pkg_.a -trimpath x_amd64/compile -p github.com/aymanrev-parse -lang=go1.24 x_amd64/compile e=/t�� t0 -goversion (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv : ${{ github.repository }} l /usr/bin/git --exclude-hiddengit --all --quiet git rev-�� --show-toplevel k/gh-aw/gh-aw/pk-tests /usr/bin/git k/gh-aw/gh-aw/pkgit k/gh-aw/gh-aw/pkrev-parse x_amd64/vet git (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 /tmp/gh-aw-test-runs/20260428-013255-14740/test-308489346/.github/workflows remote /usr/bin/git submodules | heagit k/gh-aw/gh-aw/screv-parse x_amd64/vet git conf�� --get remote.origin.url _id":222}] '**/*.ts' '**/*.git k/gh-aw/gh-aw/.grev-parse layTitle 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 GOSUMDB GOWORK 64/bin/go GOINSECURE GOMOD GOMODCACHE node /opt�� prettier --check 64/bin/go **/*.ts **/*.json --ignore-path golangci-lint (http block)
    • Triggering command: /usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq [.object.sha, .object.type] | @tsv 1663762/b415/embGOINSECURE GOPROXY $name) { hasDiscussionsEnabled } } GOSUMDB GOWORK 64/bin/go /opt/hostedtoolcGOPROXY -o /tmp/go-build367GOSUMDB -trimpath 64/bin/go -p github.com/githu-C -lang=go1.25 go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq [.object.sha, .object.type] | @tsv che/go-build/98/GOINSECURE GOPROXY 64/bin/go GOSUMDB GOWORK 64/bin/go /opt/hostedtoolcGOPROXY -o /tmp/go-build367GOSUMDB -trimpath 64/bin/go -p github.com/githuapi -lang=go1.25 go (http block)
  • https://api.github.com/repos/github/gh-aw
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw --jq .default_branch -json GO111MODULE r: $owner, name: $name) { hasDiscussionsEnabled } } GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE r: $owner, name: $name) { hasDiscussionsEnabled } } GOINSECURE GOMOD GOMODCACHE 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/git LsRemoteWithRealgit LsRemoteWithRealrev-parse .cfg /usr/bin/git remo�� -v ache/go/1.25.8/xstatus /usr/bin/git 6196954/b364/_pkgit .github/workflowrev-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 /tmp/TestGuardPolicyMinIntegrityOnlymin-integrittest-logs/run-1 963412/b441/_testmain.go /usr/bin/git remote.origin.urgit (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 k/gh-aw/gh-aw/.github/workflows/agent-performanctest-logs/run-3 963412/b444/_testmain.go /opt/hostedtoolcache/node/24.14.1/x64/bin/node yphen2791384748/git yphen2791384748/rev-parse x_amd64/vet node /tmp�� /tmp/TestHashConsistency_GoAndJavaScript2845226731/001/test-empty-frontmatter.md x_amd64/vet /usr/bin/git '**/*.ts' '**/*.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-21 (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-03-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 >=2026-01-28 (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 6196954/b013/vet.cfg 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh run download 1 --dir test-logs/run-1 6196954/b039/vet.cfg 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 l_test.go 64/pkg/tool/linux_amd64/compile ./../.prettieriginfocmp (http block)
    • Triggering command: /usr/bin/gh gh run download 12345 --dir test-logs/run-12345 (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 go-udiff@v0.4.1/export.go 64/pkg/tool/linux_amd64/vet ./../.prettierig/opt/hostedtoolcache/node/24.14.1/x64/bin/node (http block)
    • Triggering command: /usr/bin/gh gh run download 12346 --dir test-logs/run-12346 (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 6196954/b011/vet.cfg 64/pkg/tool/linux_amd64/link (http block)
    • Triggering command: /usr/bin/gh gh run download 2 --dir test-logs/run-2 6196954/b032/vet.cfg 64/pkg/tool/linux_amd64/link (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 6196954/b014/vet.cfg 64/pkg/tool/linux_amd64/vet nts.md ation.md 1/x64/bin/git 64/pkg/tool/linutest@example.com (http block)
    • Triggering command: /usr/bin/gh gh run download 3 --dir test-logs/run-3 6196954/b033/vet.cfg 64/pkg/tool/linux_amd64/vet (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 6196954/b015/vet.cfg test nts.md ation.md (http block)
    • Triggering command: /usr/bin/gh gh run download 4 --dir test-logs/run-4 6196954/b031/vet.cfg 64/pkg/tool/linux_amd64/vet (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 6196954/b016/vet.cfg x_amd64/vet nts.md ation.md (http block)
    • Triggering command: /usr/bin/gh gh run download 5 --dir test-logs/run-5 6196954/b060/vet.cfg 64/pkg/tool/linux_amd64/vet cmd/gh-aw/capitagit cmd/gh-aw/commanrev-parse cmd/gh-aw/format--show-toplevel 64/pkg/tool/linux_amd64/vet /opt�� rdian.md --write k --ignore-path .prettierignore --log-level=erro--show-toplevel ache/go/1.25.8/x64/pkg/tool/linu--jq (http block)
  • https://api.github.com/repos/github/gh-aw/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path k/gh-aw/gh-aw/pk-errorsas k/gh-aw/gh-aw/pk-ifaceassert x_amd64/compile k/gh-aw/gh-aw/pkgo k/gh-aw/gh-aw/pktest k/gh-aw/gh-aw/pk-v x_amd64/compile k/gh�� compiler-quality-run=^Test k/gh-aw/gh-aw/pk./... 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 (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 (http block)
  • https://api.github.com/repos/github/gh-aw/contents/.github/workflows/shared/reporting.md
    • Triggering command: /tmp/go-build965963412/b404/cli.test /tmp/go-build965963412/b404/cli.test -test.testlogfile=/tmp/go-build965963412/b404/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true (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 /opt/hostedtoolc12345 /usr/bin/git api-consumption-git /tmp/go-build375rev-parse tartedAt,updated--show-toplevel git rev-�� --show-toplevel /opt/hostedtoolc--jq /usr/bin/git -bool (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 31/001/test-complex-frontmatter-with-tools.md (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 */*.ts' '**/*.js-s /home/REDACTED/wor-w x_amd64/vet /home/REDACTED/worgit /home/REDACTED/worrev-parse /home/REDACTED/wor--show-toplevel x_amd64/vet 1/x6�� Gitmain_branch2746965586/001' Gitmain_branch2746965586/001' 64/pkg/tool/linux_amd64/vet son /home/REDACTED/wor-C /home/REDACTED/wor/tmp/compile-all-instructions-test-1692495555 64/pkg/tool/linushow (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 aw add\|"add"\|AddCommand\|add_command /home/REDACTED/work/gh-aw/gh-aw/pkg/constants/version_constants.go x_amd64/vet /home/REDACTED/worgit /home/REDACTED/worrev-parse /home/REDACTED/wor--show-toplevel gC9yjdR/RKv1OzzPXee94w7-Cd0Y --no�� lGitmain_branch2746965586/001' lGitmain_branch2746965586/001' eb48e715815e9853fa93936373f24a38-d /home/REDACTED/worgit /home/REDACTED/wor-C /home/REDACTED/wor/tmp/gh-aw-test-runs/20260428-013255-14740/test-762078217 64/pkg/tool/linurev-parse (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 --noprofile (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 --noprofile (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 "prettier" --write 'scripts/**/*.js' --ignore-path .prettierignore --log-level=error (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 nts.md ation.md run-script/lib/n--show-toplevel ache/go/1.25.8/x/home/REDACTED/work/gh-aw/gh-aw/scripts/lint_error_messages_test.go -c "prettier" --write 'scripts/**/*.js' --ignore-path .prettierignore --log-level=error (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 k/gh-aw/gh-aw/pk/opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/cgo k/gh-aw/gh-aw/pk-V=full k/gh-aw/gh-aw/pk-stringintconv x_amd64/compile k/gh�� k/gh-aw/gh-aw/pkg/agentdrain/spec_test.go k/gh-aw/gh-aw/pkg/agentdrain/coordinator.go x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo -importcfg /tmp/go-build965963412/b430/importcfg -embedcfg /tmp/go-build965963412/b430/embedcfg -pack k/gh�� k/gh-aw/gh-aw/pkg/agentdrain/spec_test.go k/gh-aw/gh-aw/pkg/agentdrain/coordinator.go x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh workflow list --repo owner/repo --json name,path,state 64/pkg/tool/linu--created (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 d er-docs-review.m-ifaceassert analysis.md k/gh-aw/gh-aw/pkbash k/gh-aw/gh-aw/pk--norc k/gh-aw/gh-aw/pk--noprofile k/gh-aw/gh-aw/pk-tests k/gh�� k/gh-aw/gh-aw/pkg/agentdrain/spec_test.go k/gh-aw/gh-aw/pkg/agentdrain/coordinator.go 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 _.a **/*.cjs ache/go/1.25.8/x64/pkg/tool/linu-lang=go1.25 **/*.json --ignore-path ../../../.pretti--show-toplevel ache/go/1.25.8/x64/pkg/tool/linu-goversion -c P82kiP9ch (http block)

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

@github-actions

This comment has been minimized.

1 similar comment
@github-actions
Copy link
Copy Markdown
Contributor

Hey @Copilot 👋 — thanks for picking up the integration test for the gh add shared-markdown workflow! Adding coverage here is a great step toward catching recursive-include regressions early.

A couple of things to address before this is ready for review:

  • No code changes yet — the diff is currently empty. The PR body still contains the agent's auto-generated placeholder rather than a description of the actual approach taken.
  • Add a real PR description — once the implementation lands, please replace the template text with a brief summary of what the test does, which AWs it exercises, and what "passes" means (e.g. compiled successfully, imported files present).
  • Tests — the whole point of this PR is the integration test, so the test file(s) should appear in the diff. Make sure they are committed and pushed.

If you'd like a hand getting unstuck, you can assign this prompt to your coding agent:

In the gh-aw repository, implement an integration test for the `gh add` command that:
1. Iterates over every Agentic Workflow (AW) in the repo.
2. Runs `gh add <aw>` for each one.
3. Validates that all transitively imported shared-markdown files were copied into the target directory.
4. Validates that the resulting workflow compiles without errors.
Place the test in the appropriate test directory, follow the existing test file conventions, and update the PR description to summarise the approach and pass criteria.

Generated by Contribution Check · ● 1.1M ·

When a workflow imports a shared file that itself imports other shared
files, those nested imports were not downloaded. The bug was in
fetchFrontmatterImportsRecursive which resolved all relative paths
against currentBaseDir (the importing file's directory), producing
wrong paths like .github/workflows/shared/shared/daily-audit-discussion.md
instead of .github/workflows/shared/daily-audit-discussion.md.

Fix: non-explicit relative paths (not starting with ./ or ../) are now
resolved against originalBaseDir (the top-level workflow root), matching
the convention where shared imports are always written relative to
.github/workflows/. Explicitly-relative paths (./file.md) continue
to resolve against currentBaseDir.

Also adds TestAddWorkflowWithRecursiveSharedImports integration test
that verifies 2-3 level deep import trees are fully downloaded.

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/4dde7cb4-1fe9-4b3a-b756-d5ce0653102f

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add integration test for adding shared markdowns Fix gh aw add not recursively downloading transitive shared imports Apr 28, 2026
Copilot AI requested a review from pelikhan April 28, 2026 01:40
@pelikhan pelikhan marked this pull request as ready for review April 28, 2026 01:47
Copilot AI review requested due to automatic review settings April 28, 2026 01:47
@github-actions github-actions Bot mentioned this pull request Apr 28, 2026
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

Fixes gh aw add so that transitive frontmatter imports: are downloaded recursively with correct path resolution for repo-conventional shared imports (e.g., shared/foo.md), preventing silent skips due to incorrect nested path joins.

Changes:

  • Adjusted fetchFrontmatterImportsRecursive path resolution to treat .//../ as relative to the importing file, and non-explicit relative paths as relative to the top-level workflow directory.
  • Preserved repo-root absolute import behavior (/path/to/file).
  • Added an integration test that validates recursive fetching across a multi-level shared import tree pinned to a specific commit.
Show a summary per file
File Description
pkg/cli/includes.go Fixes recursive import path resolution to correctly fetch transitive shared imports.
pkg/cli/add_integration_test.go Adds an integration test covering a 3-level transitive import tree to prevent regressions.

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

Comment on lines +1066 to +1076
// daily-compiler-quality.md (at commit 8d26856) has this two-level import tree:
//
// daily-compiler-quality.md
// ├── shared/daily-audit-base.md (direct)
// │ ├── shared/daily-audit-discussion.md (nested level 2)
// │ ├── shared/reporting.md (nested level 2)
// │ └── shared/observability-otlp.md (nested level 2)
// └── shared/go-source-analysis.md (direct)
// ├── shared/mcp/serena-go.md (nested level 2)
// │ └── shared/mcp/serena.md (nested level 3, via "./serena.md")
// └── shared/reporting.md (nested level 2, shared with above)
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

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

The comment says this workflow has a "two-level import tree", but the diagram includes a nested level 3 import (serena-go.md → ./serena.md). Consider updating the wording to "multi-level" or "three-level" to avoid confusion when maintaining the pinned tree in the future.

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Copy Markdown
Contributor

🧪 Test Quality Sentinel Report

Test Quality Score: 80/100

Excellent test quality

Metric Value
New/modified tests analyzed 1
✅ Design tests (behavioral contracts) 1 (100%)
⚠️ Implementation tests (low value) 0 (0%)
Tests with error/edge cases 1 (100%)
Duplicate test clusters 0
Test inflation detected Yes (73 test lines / 27 production lines ≈ 2.7:1)
🚨 Coding-guideline violations None

Test Classification Details

Test File Classification Issues Detected
TestAddWorkflowWithRecursiveSharedImports pkg/cli/add_integration_test.go:1083 ✅ Design Test inflation (2.7:1 ratio); otherwise excellent

Analysis

TestAddWorkflowWithRecursiveSharedImports is a well-structured integration test that directly exercises the behavioral contract of the bug fix: gh aw add must recursively download all transitive shared imports, not just direct ones.

  • Build tag: //go:build integration
  • No mock libraries: runs the real binary against GitHub ✅
  • Assertions: all assertions carry descriptive messages ✅
  • Error path: require.NoError on the command execution covers the failure case ✅
  • Coverage depth: verifies direct imports (level 1), transitive imports (level 2), and deeply nested imports (level 3 via serena-go.md → serena.md) — thorough multi-level tree traversal coverage ✅
  • Stability: pinned to a specific commit hash (8d26856) to prevent flakiness from upstream changes ✅
  • Test inflation: 73 lines added in test vs 27 in production (2.7:1). This is expected for an integration test covering a multi-level import tree — the extra lines are descriptive assertions, not padding. No action required.

Language Support

Tests analyzed:

  • 🐹 Go (*_test.go): 1 test — integration (//go:build integration)

Verdict

Check passed. 0% of new tests are implementation tests (threshold: 30%). The new test is a high-value behavioral contract test that directly validates the bug fix.


📖 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: §25029436032

🧪 Test quality analysis by Test Quality Sentinel · ● 434.7K ·

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

✅ Test Quality Sentinel: 80/100. Test quality is acceptable — 0% of new tests are implementation tests (threshold: 30%). The single new test (TestAddWorkflowWithRecursiveSharedImports) is a high-value behavioral integration test that directly validates the recursive import fix.

@pelikhan pelikhan merged commit 1056f1e into main Apr 28, 2026
111 of 121 checks passed
@pelikhan pelikhan deleted the copilot/add-integration-test-for-workflows branch April 28, 2026 02:29
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.

Gh add does not recursively include shared markdowns

3 participants