[Test Coverage] src/upstream-proxy.ts – port-out-of-range branch - #6602
Conversation
Cover line 110 in src/upstream-proxy.ts — the guard that rejects port values outside the valid 1–65535 range (NaN, 0, or overflow). Port 0 is a valid URL per the WHATWG URL parser but meaningless as a proxy port; the existing tests stopped before this branch. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds coverage for rejecting upstream proxy port 0.
Changes:
- Tests the lower-bound port validation in
parseProxyUrl.
Show a summary per file
| File | Description |
|---|---|
src/upstream-proxy.test.ts |
Adds the port 0 rejection test. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Medium
|
✅ Copilot review passed with no inline comments. @github-actions[bot] Add the |
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
🛡️ Smoke Copilot Network Isolation confirmed the egress allowlist is enforced. ✅ |
|
✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓 |
|
✅ Smoke Copilot BYOK AOAI (Entra) completed. Copilot AOAI BYOK (Entra) mode operational. 🔓 |
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅ |
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded. |
|
🚀 Security Guard has started processing this pull request |
|
📰 VERDICT: Smoke Docker Sbx has concluded. All systems operational. This is a developing story. 🎤 |
|
✅ Smoke Claude passed |
|
✅ Smoke Copilot BYOK AOAI (api-key) completed. Copilot AOAI BYOK (api-key) mode operational. 🔓 |
|
✅ Build Test Suite completed successfully! |
|
🔌 Smoke Services — All services reachable! ✅ |
|
✅ Contribution Check completed successfully! Contribution check complete: the PR follows the applicable CONTRIBUTING.md guidelines. It adds the expected test in the correct location, the PR description is clear, and no documentation or organization issues stand out for this coverage-only change. |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
✅ Smoke Gemini completed. All facets verified. 💎 Smoke tests completed. GitHub MCP and Connectivity tests failed, File system tests passed. Result: FAIL. Reported to PR #6602. |
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (2 files)
Coverage comparison generated by |
Smoke Test: Claude Engine Validation
Overall result: PASS
|
🔒 Smoke Test: Copilot Network Isolation
Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "example.com"See Network Configuration for more information.
|
|
Smoke Test: Copilot BYOK (Direct) — PASS ✅
Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY) via api-proxy → api.githubcopilot.com
|
🔍 Smoke Test Results
Overall: PARTIAL — MCP connectivity confirmed; pre-computed test data unavailable due to workflow template variable expansion failure.
|
|
|
Chroot Runtime Version Comparison
Overall: ❌ FAILED — Node.js version mismatch between host (
|
Smoke Test Results — Services Connectivity
Overall: FAIL
|
Smoke Test Results
Overall Status: FAIL Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "localhost"See Network Configuration for more information.
|
|
✅ test: drop stale smoke-copilot-pat references Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "registry.npmjs.org"See Network Configuration for more information.
|
Smoke Test: API Proxy OpenTelemetry Tracing — Results
All validatable scenarios pass. OTEL integration is functional.
|
|
Smoke Test Results
Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw) Overall: FAIL
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
🔥 Smoke Test: Docker Sbx — PASS
Overall: PASS · Run:
|
Summary
Adds a test case to cover the previously-uncovered line 110 in
src/upstream-proxy.ts:Port
0is a syntactically valid value for the WHATWG URL parser but is rejected by AWF's validation as unusable. This specific branch was the only uncovered statement inupstream-proxy.ts(coverage was 94.9% statements, 94.7% branches).Changes
src/upstream-proxy.test.ts— adds'rejects port 0 as out-of-range'test inside theparseProxyUrldescribe block.Coverage impact
src/upstream-proxy.ts(statements)src/upstream-proxy.ts(branches)Test run
All 41 tests in
upstream-proxy.test.tsandsquid/upstream-proxy.test.tspass.