Skip to content

fix: resolve test coverage regression and locked PR comment failure#1254

Merged
lpcox merged 2 commits intoclaude/fix-issue-20590from
copilot/fix-test-coverage-workflow
Mar 12, 2026
Merged

fix: resolve test coverage regression and locked PR comment failure#1254
lpcox merged 2 commits intoclaude/fix-issue-20590from
copilot/fix-test-coverage-workflow

Conversation

Copy link
Contributor

Copilot AI commented Mar 12, 2026

The "Test Coverage" CI job was failing for two independent reasons: a branch coverage regression introduced by the new --openai-api-target/--anthropic-api-target flags, and an unhandled 403 when trying to comment on a locked PR.

Coverage regression fix

The new validation warning logic was inlined inside program.action() — which is never exercised by unit tests — adding ~10 untested branches and dropping overall branch coverage from 74.82% → 74.03%.

Extract into testable function (src/cli.ts):

export function emitApiProxyTargetWarnings(
  config: { enableApiProxy?: boolean; openaiApiTarget?: string; anthropicApiTarget?: string },
  allowedDomains: string[],
  warn: (msg: string) => void
): void { ... }

Call site uses logger.warn.bind(logger) (no new anonymous function added to the count):

emitApiProxyTargetWarnings(config, allowedDomains, logger.warn.bind(logger));
  • Added 7 unit tests for emitApiProxyTargetWarnings covering all branch paths
  • Added 4 unit tests for OPENAI_API_TARGET/ANTHROPIC_API_TARGET env var forwarding in generateDockerCompose
  • Net result: branch coverage 75.2%, functions 83.01% — both above base (74.82% / 82.77%)

Locked PR comment fix

Added continue-on-error: true to the "Comment PR with coverage comparison" step in test-coverage.yml. Coverage data is still available via job summary and uploaded artifact.

Original prompt

Fix the failing GitHub Actions workflow "Test Coverage / Test Coverage Report (pull_request)".
Analyze the workflow logs, identify the root cause of the failure, and implement a fix.
Job ID: 66734674867
Job URL: /github/gh-aw-firewall/actions/runs/22985479650/job/66734674867?pr=1249


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Copilot AI changed the title [WIP] [GH-1249] Fix failing Test Coverage workflow fix: resolve test coverage regression and locked PR comment failure Mar 12, 2026
@github-actions
Copy link
Contributor

🏗️ Build Test Suite Results

Ecosystem Project Build/Install Tests Status
Bun elysia 1/1 passed ✅ PASS
Bun hono 1/1 passed ✅ PASS
C++ fmt N/A ✅ PASS
C++ json N/A ✅ PASS
Deno oak N/A 1/1 passed ✅ PASS
Deno std N/A 1/1 passed ✅ PASS
.NET hello-world N/A ✅ PASS
.NET json-parse N/A ✅ PASS
Go color passed ✅ PASS
Go env passed ✅ PASS
Go uuid passed ✅ PASS
Java gson 1/1 passed ✅ PASS
Java caffeine 1/1 passed ✅ PASS
Node.js clsx passed ✅ PASS
Node.js execa passed ✅ PASS
Node.js p-limit passed ✅ PASS
Rust fd 1/1 passed ✅ PASS
Rust zoxide 1/1 passed ✅ PASS

Overall: 8/8 ecosystems passed — ✅ PASS

Generated by Build Test Suite for issue #1254 ·

@lpcox lpcox marked this pull request as ready for review March 12, 2026 14:03
Copilot AI review requested due to automatic review settings March 12, 2026 14:03
@lpcox lpcox merged commit b7b2be8 into claude/fix-issue-20590 Mar 12, 2026
32 checks passed
@lpcox lpcox deleted the copilot/fix-test-coverage-workflow branch March 12, 2026 14:03
Copy link
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 two CI failures: a branch coverage regression from untested API proxy target warning logic, and a 403 error when commenting on locked PRs.

Changes:

  • Extract inline warning logic into a testable emitApiProxyTargetWarnings function in src/cli.ts with 7 unit tests
  • Add 4 unit tests for OPENAI_API_TARGET/ANTHROPIC_API_TARGET env var forwarding in generateDockerCompose
  • Add continue-on-error: true to the PR comment step in test-coverage.yml

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/cli.ts Extract warning logic into exported emitApiProxyTargetWarnings function
src/cli.test.ts Add tests for the new emitApiProxyTargetWarnings function
src/docker-manager.test.ts Add tests for API target env var forwarding
.github/workflows/test-coverage.yml Add continue-on-error: true to PR comment step

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

You can also share your feedback on Copilot code review. Take the survey.

lpcox added a commit that referenced this pull request Mar 12, 2026
…#1249)

* Initial plan

* feat: add openai/anthropic api target flags for custom endpoints

* Update src/cli.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix(proxy): warn when custom api targets are not in --allow-domains

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>

* fix(ci): skip agentic workflow activation for bot-triggered pull requests (#1250)

* Initial plan

* fix(ci): skip agentic workflow activation for bot-triggered pull requests

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>

* fix: resolve pid-tracker integration test failure and add missing test coverage for API target validation (#1251)

* Initial plan

* fix: resolve failing Build and Lint (Node 22) CI workflow

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>

* fix(ci): remove unused Setup Scripts step from update_cache_memory jobs (#1252)

* Initial plan

* fix(ci): remove unused Setup Scripts step from update_cache_memory jobs

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>

* docs(proxy): document --openai-api-target and --anthropic-api-target in api-proxy-sidecar.md

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>

* fix: resolve test coverage regression and locked PR comment failure (#1254)

* Initial plan

* fix: resolve coverage regression and locked PR comment failure

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>

---------

Co-authored-by: anthropic-code-agent[bot] <242468646+Claude@users.noreply.github.com>
Co-authored-by: Landon Cox <landon.cox@microsoft.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants