From 6e756ca327bed52413e34b203e923e5dae31baac Mon Sep 17 00:00:00 2001 From: Landon Cox Date: Fri, 3 Jul 2026 08:48:37 -0700 Subject: [PATCH 1/2] fix: make test-coverage-reporter resilient to test failures The reporter workflow was failing entirely when any test failed (exit code 1 from npm run test:coverage), skipping all subsequent steps and preventing the agent from running. Since this is a coverage reporter (not a gate), it should continue with whatever coverage data is available and report on it. Changed the coverage step to capture the exit code, emit a warning annotation when tests fail, and continue to the data-extraction steps. All downstream steps already have fallbacks for missing coverage data. Fixes #5855 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .../self-hosted-runner-doctor-updater.lock.yml | 2 +- .github/workflows/self-hosted-runner-doctor.lock.yml | 2 +- .github/workflows/test-coverage-reporter.lock.yml | 4 ++-- .github/workflows/test-coverage-reporter.md | 11 ++++++++++- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/self-hosted-runner-doctor-updater.lock.yml b/.github/workflows/self-hosted-runner-doctor-updater.lock.yml index d626ade77..1c1d0e44e 100644 --- a/.github/workflows/self-hosted-runner-doctor-updater.lock.yml +++ b/.github/workflows/self-hosted-runner-doctor-updater.lock.yml @@ -1,4 +1,4 @@ -# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"01990c75e1bba0ed2b73783215b2ed564d4b28a5bd751b9909a44779cee95176","body_hash":"bcf89bdc297d8db7a6a740cd8fcfc6b16993198f400074be9e7d1a0199879e28","compiler_version":"v0.82.2","strict":true,"agent_id":"copilot","engine_versions":{"copilot":"1.0.68"}} +# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"01990c75e1bba0ed2b73783215b2ed564d4b28a5bd751b9909a44779cee95176","body_hash":"1d3eccded039703d6f74cfb3becb4622991d161a6a2431035e022e2b3cf3fc1a","compiler_version":"v0.82.2","strict":true,"agent_id":"copilot","engine_versions":{"copilot":"1.0.68"}} # gh-aw-manifest: {"version":1,"secrets":["COPILOT_GITHUB_TOKEN","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GITHUB_TOKEN"],"actions":[{"repo":"actions/cache","sha":"55cc8345863c7cc4c66a329aec7e433d2d1c52a9","version":"v6.1.0"},{"repo":"actions/cache/restore","sha":"55cc8345863c7cc4c66a329aec7e433d2d1c52a9","version":"v6.1.0"},{"repo":"actions/cache/save","sha":"55cc8345863c7cc4c66a329aec7e433d2d1c52a9","version":"v6.1.0"},{"repo":"actions/checkout","sha":"9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0","version":"v7.0.0"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"},{"repo":"github/gh-aw-actions/setup","sha":"3fac1cfa7a5a375a6a5eb9839178f6dad7adb60a","version":"v0.82.2"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.27.22","digest":"sha256:55f06588411008b7148eb64b8dfe28602a0cce3675b36c6b190b54aca138468e","pinned_image":"ghcr.io/github/gh-aw-firewall/agent:0.27.22@sha256:55f06588411008b7148eb64b8dfe28602a0cce3675b36c6b190b54aca138468e"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.22","digest":"sha256:afb9ff9140b17d38871dfb9dbac5ff8689ea634c2f91c435da2825192d4881c1","pinned_image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.22@sha256:afb9ff9140b17d38871dfb9dbac5ff8689ea634c2f91c435da2825192d4881c1"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.27.22","digest":"sha256:3cdcc1e2b4b4fe602ba69fd3e21aac7ac512d5c1fce24df4ce69dc4f98164b59","pinned_image":"ghcr.io/github/gh-aw-firewall/squid:0.27.22@sha256:3cdcc1e2b4b4fe602ba69fd3e21aac7ac512d5c1fce24df4ce69dc4f98164b59"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.3.32","digest":"sha256:63e46b56dfd70895a701b6fc6dd0189e11e2d875f327f1781e81b31848735477","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.3.32@sha256:63e46b56dfd70895a701b6fc6dd0189e11e2d875f327f1781e81b31848735477"},{"image":"ghcr.io/github/gh-aw-node","digest":"sha256:529d02eb970b1161aa25c593a9c3df57fdfad5a8add328cb3b6eccef66f3183b","pinned_image":"ghcr.io/github/gh-aw-node@sha256:529d02eb970b1161aa25c593a9c3df57fdfad5a8add328cb3b6eccef66f3183b"},{"image":"ghcr.io/github/github-mcp-server:v1.5.0","digest":"sha256:e25564dccc9110a70a77b9df560cbde11aa392fcb5f08b9abe5c4ebc6d146ea4","pinned_image":"ghcr.io/github/github-mcp-server:v1.5.0@sha256:e25564dccc9110a70a77b9df560cbde11aa392fcb5f08b9abe5c4ebc6d146ea4"}]} # This file was automatically generated by gh-aw (v0.82.2). DO NOT EDIT. To debug this workflow, load the skill at https://github.com/github/gh-aw/blob/main/debug.md # diff --git a/.github/workflows/self-hosted-runner-doctor.lock.yml b/.github/workflows/self-hosted-runner-doctor.lock.yml index 0f4ec71b0..a89cc4ce9 100644 --- a/.github/workflows/self-hosted-runner-doctor.lock.yml +++ b/.github/workflows/self-hosted-runner-doctor.lock.yml @@ -1,4 +1,4 @@ -# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"530fb574e7133fb82dfb790d20ec7b7da1621c1455a45efa76ce0b73c0863113","body_hash":"1ca233c2fc6034bfb1a5136787104e8d3e78ee08781d892f5726676a65f573b4","compiler_version":"v0.82.2","strict":true,"agent_id":"copilot","engine_versions":{"copilot":"1.0.68"}} +# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"530fb574e7133fb82dfb790d20ec7b7da1621c1455a45efa76ce0b73c0863113","body_hash":"87aed479171365ba6481444b2ff2d4790206b5b67685973065ef954e4e73787b","compiler_version":"v0.82.2","strict":true,"agent_id":"copilot","engine_versions":{"copilot":"1.0.68"}} # gh-aw-manifest: {"version":1,"secrets":["COPILOT_GITHUB_TOKEN","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GITHUB_TOKEN"],"actions":[{"repo":"actions/cache","sha":"55cc8345863c7cc4c66a329aec7e433d2d1c52a9","version":"v6.1.0"},{"repo":"actions/cache/restore","sha":"55cc8345863c7cc4c66a329aec7e433d2d1c52a9","version":"v6.1.0"},{"repo":"actions/cache/save","sha":"55cc8345863c7cc4c66a329aec7e433d2d1c52a9","version":"v6.1.0"},{"repo":"actions/checkout","sha":"9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0","version":"v7.0.0"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"},{"repo":"github/gh-aw-actions/setup","sha":"3fac1cfa7a5a375a6a5eb9839178f6dad7adb60a","version":"v0.82.2"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.27.22","digest":"sha256:55f06588411008b7148eb64b8dfe28602a0cce3675b36c6b190b54aca138468e","pinned_image":"ghcr.io/github/gh-aw-firewall/agent:0.27.22@sha256:55f06588411008b7148eb64b8dfe28602a0cce3675b36c6b190b54aca138468e"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.22","digest":"sha256:afb9ff9140b17d38871dfb9dbac5ff8689ea634c2f91c435da2825192d4881c1","pinned_image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.22@sha256:afb9ff9140b17d38871dfb9dbac5ff8689ea634c2f91c435da2825192d4881c1"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.27.22","digest":"sha256:3cdcc1e2b4b4fe602ba69fd3e21aac7ac512d5c1fce24df4ce69dc4f98164b59","pinned_image":"ghcr.io/github/gh-aw-firewall/squid:0.27.22@sha256:3cdcc1e2b4b4fe602ba69fd3e21aac7ac512d5c1fce24df4ce69dc4f98164b59"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.3.32","digest":"sha256:63e46b56dfd70895a701b6fc6dd0189e11e2d875f327f1781e81b31848735477","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.3.32@sha256:63e46b56dfd70895a701b6fc6dd0189e11e2d875f327f1781e81b31848735477"},{"image":"ghcr.io/github/gh-aw-node","digest":"sha256:529d02eb970b1161aa25c593a9c3df57fdfad5a8add328cb3b6eccef66f3183b","pinned_image":"ghcr.io/github/gh-aw-node@sha256:529d02eb970b1161aa25c593a9c3df57fdfad5a8add328cb3b6eccef66f3183b"},{"image":"ghcr.io/github/github-mcp-server:v1.5.0","digest":"sha256:e25564dccc9110a70a77b9df560cbde11aa392fcb5f08b9abe5c4ebc6d146ea4","pinned_image":"ghcr.io/github/github-mcp-server:v1.5.0@sha256:e25564dccc9110a70a77b9df560cbde11aa392fcb5f08b9abe5c4ebc6d146ea4"}]} # This file was automatically generated by gh-aw (v0.82.2). DO NOT EDIT. To debug this workflow, load the skill at https://github.com/github/gh-aw/blob/main/debug.md # diff --git a/.github/workflows/test-coverage-reporter.lock.yml b/.github/workflows/test-coverage-reporter.lock.yml index ed9bfd1a4..0020f0c28 100644 --- a/.github/workflows/test-coverage-reporter.lock.yml +++ b/.github/workflows/test-coverage-reporter.lock.yml @@ -1,4 +1,4 @@ -# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"8b6740e4d5d4812811b974d025993cfcb80ac02a4be61d1b8ff762c6f73d6ffd","body_hash":"4a14009d06d14968811b9939fb94ece32e93d671679e4483aecc61a8fb2733ac","compiler_version":"v0.82.2","agent_id":"copilot","agent_model":"summarization","engine_versions":{"copilot":"1.0.68"}} +# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"eb0f07d5ce857178d8cf34be53e42928eb76403d50566a35e1032c3686a43435","body_hash":"4a14009d06d14968811b9939fb94ece32e93d671679e4483aecc61a8fb2733ac","compiler_version":"v0.82.2","agent_id":"copilot","agent_model":"summarization","engine_versions":{"copilot":"1.0.68"}} # gh-aw-manifest: {"version":1,"secrets":["COPILOT_GITHUB_TOKEN","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GITHUB_TOKEN"],"actions":[{"repo":"actions/cache","sha":"55cc8345863c7cc4c66a329aec7e433d2d1c52a9","version":"v6.1.0"},{"repo":"actions/cache/restore","sha":"55cc8345863c7cc4c66a329aec7e433d2d1c52a9","version":"v6.1.0"},{"repo":"actions/cache/save","sha":"55cc8345863c7cc4c66a329aec7e433d2d1c52a9","version":"v6.1.0"},{"repo":"actions/checkout","sha":"9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0","version":"v7.0.0"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/setup-node","sha":"48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e","version":"v6.4.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"},{"repo":"github/gh-aw-actions/setup","sha":"3fac1cfa7a5a375a6a5eb9839178f6dad7adb60a","version":"v0.82.2"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.27.22","digest":"sha256:55f06588411008b7148eb64b8dfe28602a0cce3675b36c6b190b54aca138468e","pinned_image":"ghcr.io/github/gh-aw-firewall/agent:0.27.22@sha256:55f06588411008b7148eb64b8dfe28602a0cce3675b36c6b190b54aca138468e"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.22","digest":"sha256:afb9ff9140b17d38871dfb9dbac5ff8689ea634c2f91c435da2825192d4881c1","pinned_image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.22@sha256:afb9ff9140b17d38871dfb9dbac5ff8689ea634c2f91c435da2825192d4881c1"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.27.22","digest":"sha256:3cdcc1e2b4b4fe602ba69fd3e21aac7ac512d5c1fce24df4ce69dc4f98164b59","pinned_image":"ghcr.io/github/gh-aw-firewall/squid:0.27.22@sha256:3cdcc1e2b4b4fe602ba69fd3e21aac7ac512d5c1fce24df4ce69dc4f98164b59"},{"image":"ghcr.io/github/gh-aw-mcpg:latest","digest":"sha256:63e46b56dfd70895a701b6fc6dd0189e11e2d875f327f1781e81b31848735477","pinned_image":"ghcr.io/github/gh-aw-mcpg:latest@sha256:63e46b56dfd70895a701b6fc6dd0189e11e2d875f327f1781e81b31848735477"},{"image":"ghcr.io/github/gh-aw-node","digest":"sha256:529d02eb970b1161aa25c593a9c3df57fdfad5a8add328cb3b6eccef66f3183b","pinned_image":"ghcr.io/github/gh-aw-node@sha256:529d02eb970b1161aa25c593a9c3df57fdfad5a8add328cb3b6eccef66f3183b"}]} # This file was automatically generated by gh-aw (v0.82.2). DO NOT EDIT. To debug this workflow, load the skill at https://github.com/github/gh-aw/blob/main/debug.md # @@ -418,7 +418,7 @@ jobs: run: set -o pipefail && npm run build 2>&1 | tail -5 - id: coverage name: Run coverage - run: set -o pipefail && npm run test:coverage 2>&1 | tail -20 + run: "set +e\nnpm run test:coverage 2>&1 | tee /tmp/coverage-full.log\nCOVERAGE_EXIT=$?\ntail -20 /tmp/coverage-full.log\nif [ $COVERAGE_EXIT -ne 0 ]; then\n echo \"::warning::test:coverage exited with code $COVERAGE_EXIT (some tests may have failed); continuing with available coverage data\"\nfi\n# Continue even if tests fail — this is a reporter, not a gate\nexit 0\n" - id: coverage-table name: Compute per-file coverage table run: "{\n echo \"COVERAGE_TABLE< k !== 'total')\n .map(([k, v]) => ({\n file: k.replace(process.cwd() + '/', ''),\n stmts: v.statements.pct,\n branch: v.branches.pct,\n funcs: v.functions.pct,\n lines: v.lines.pct,\n }))\n .filter(r => r.stmts < 80 || SECURITY_CRITICAL.some(s => r.file.includes(s)))\n .sort((a, b) => a.stmts - b.stmts)\n .slice(0, 20);\n console.log('| File | Stmts | Branch | Funcs | Lines | Status |');\n console.log('|------|------:|-------:|------:|------:|--------|');\n rows.forEach(r => {\n const status = r.stmts >= 80 ? '✅' : r.stmts >= 50 ? '⚠️' : '❌';\n console.log(\\`| \\${r.file} | \\${r.stmts}% | \\${r.branch}% | \\${r.funcs}% | \\${r.lines}% | \\${status} |\\`);\n });\n const t = d.total;\n if (t) {\n console.log(\\`| **TOTAL** | **\\${t.statements.pct}%** | **\\${t.branches.pct}%** | **\\${t.functions.pct}%** | **\\${t.lines.pct}%** | |\\`);\n }\n \" 2>/dev/null || echo \"Coverage data not available\"\n echo \"EOF\"\n} >> \"$GITHUB_OUTPUT\"\n" diff --git a/.github/workflows/test-coverage-reporter.md b/.github/workflows/test-coverage-reporter.md index 48dd80ac5..780687e48 100644 --- a/.github/workflows/test-coverage-reporter.md +++ b/.github/workflows/test-coverage-reporter.md @@ -66,7 +66,16 @@ steps: - name: Run coverage id: coverage - run: set -o pipefail && npm run test:coverage 2>&1 | tail -20 + run: | + set +e + npm run test:coverage 2>&1 | tee /tmp/coverage-full.log + COVERAGE_EXIT=$? + tail -20 /tmp/coverage-full.log + if [ $COVERAGE_EXIT -ne 0 ]; then + echo "::warning::test:coverage exited with code $COVERAGE_EXIT (some tests may have failed); continuing with available coverage data" + fi + # Continue even if tests fail — this is a reporter, not a gate + exit 0 - name: Compute per-file coverage table id: coverage-table From ea83c35b175286cdcb1372a4ae11fbb96634c6eb Mon Sep 17 00:00:00 2001 From: Landon Cox Date: Fri, 3 Jul 2026 08:51:54 -0700 Subject: [PATCH 2/2] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .github/workflows/test-coverage-reporter.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-coverage-reporter.md b/.github/workflows/test-coverage-reporter.md index 780687e48..c82399d89 100644 --- a/.github/workflows/test-coverage-reporter.md +++ b/.github/workflows/test-coverage-reporter.md @@ -68,11 +68,11 @@ steps: id: coverage run: | set +e - npm run test:coverage 2>&1 | tee /tmp/coverage-full.log - COVERAGE_EXIT=$? - tail -20 /tmp/coverage-full.log - if [ $COVERAGE_EXIT -ne 0 ]; then - echo "::warning::test:coverage exited with code $COVERAGE_EXIT (some tests may have failed); continuing with available coverage data" + set -o pipefail + npm run test:coverage 2>&1 | tee /tmp/coverage-full.log | tail -20 + COVERAGE_EXIT=${PIPESTATUS[0]} + if [ "${COVERAGE_EXIT}" -ne 0 ]; then + echo "::warning::test:coverage exited with code ${COVERAGE_EXIT} (some tests may have failed); continuing with available coverage data" fi # Continue even if tests fail — this is a reporter, not a gate exit 0