Skip to content

[Test Coverage] src/upstream-proxy.ts – port-out-of-range branch - #6602

Merged
lpcox merged 1 commit into
mainfrom
test-coverage/upstream-proxy-port-validation-6dfde0bb4009773f
Jul 26, 2026
Merged

[Test Coverage] src/upstream-proxy.ts – port-out-of-range branch#6602
lpcox merged 1 commit into
mainfrom
test-coverage/upstream-proxy-port-validation-6dfde0bb4009773f

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Summary

Adds a test case to cover the previously-uncovered line 110 in src/upstream-proxy.ts:

if (isNaN(port) || port < 1 || port > 65535) {
  throw new Error(`Invalid upstream proxy port: ${parsed.port}`);
}

Port 0 is 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 in upstream-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 the parseProxyUrl describe block.

Coverage impact

File Before After
src/upstream-proxy.ts (statements) 94.9% ~96.2%
src/upstream-proxy.ts (branches) 94.7% ~96.0%

Test run

All 41 tests in upstream-proxy.test.ts and squid/upstream-proxy.test.ts pass.

Generated by Test Coverage Improver · sonnet46 · 87.4 AIC · ⊞ 6.4K ·

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>
@lpcox
lpcox marked this pull request as ready for review July 26, 2026 16:12
Copilot AI review requested due to automatic review settings July 26, 2026 16:12

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

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

@github-actions

Copy link
Copy Markdown
Contributor Author

✅ Copilot review passed with no inline comments.

@github-actions[bot] Add the ready-for-aw label to this PR to trigger agentic CI smoke tests.

@github-actions

github-actions Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@github-actions

github-actions Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

🛡️ Smoke Copilot Network Isolation confirmed the egress allowlist is enforced. ✅

@github-actions

github-actions Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓

@github-actions

github-actions Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

Smoke Copilot BYOK AOAI (Entra) completed. Copilot AOAI BYOK (Entra) mode operational. 🔓

@github-actions

github-actions Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅

@github-actions

github-actions Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded.

@github-actions

Copy link
Copy Markdown
Contributor Author

🚀 Security Guard has started processing this pull request

@github-actions

github-actions Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

📰 VERDICT: Smoke Docker Sbx has concluded. All systems operational. This is a developing story. 🎤

@github-actions

github-actions Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

Smoke Claude passed

@github-actions

github-actions Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

Smoke Copilot BYOK AOAI (api-key) completed. Copilot AOAI BYOK (api-key) mode operational. 🔓

@github-actions

github-actions Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

Build Test Suite completed successfully!

@github-actions

github-actions Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

🔌 Smoke Services — All services reachable! ✅

@github-actions

github-actions Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

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.

@github-actions

github-actions Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions

github-actions Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

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.

@github-actions

Copy link
Copy Markdown
Contributor Author

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 99.12% 99.16% 📈 +0.04%
Statements 99.03% 99.08% 📈 +0.05%
Functions 99.52% 99.52% ➡️ +0.00%
Branches 95.60% 95.62% 📈 +0.02%
📁 Per-file Coverage Changes (2 files)
File Lines (Before → After) Statements (Before → After)
src/upstream-proxy.ts 94.5% → 95.9% (+1.37%) 94.9% → 96.2% (+1.27%)
src/log-directory-setup.ts 96.2% → 100.0% (+3.78%) 96.3% → 100.0% (+3.71%)

Coverage comparison generated by scripts/ci/compare-coverage.ts

@github-actions

Copy link
Copy Markdown
Contributor Author

Smoke Test: Claude Engine Validation

Check Result
API status ✅ PASS
gh check ✅ PASS
File status ✅ PASS

Overall result: PASS

Generated by Smoke Claude for #6602 · haiku45 · 53.9 AIC · ⊞ 6.3K ·
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor Author

🔒 Smoke Test: Copilot Network Isolation

EGRESS_RESULT allow=pass deny=pass

  • ✅ Allowed domain (api.github.com): HTTP 200
  • ✅ Blocked domain (example.com): 403 — blocked as expected
  • Overall: PASS

@lpcox all egress checks passed.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • example.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "example.com"

See Network Configuration for more information.

🛡️ Egress verdict from Smoke Copilot Network Isolation
Add label ready-for-aw to run again

@github-actions github-actions Bot added the smoke-copilot-network-isolation Copilot network-isolation egress smoke test label Jul 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor Author

Smoke Test: Copilot BYOK (Direct) — PASS ✅

  • ✅ GitHub MCP connectivity
  • ✅ GitHub.com connectivity (HTTP 200)
  • ✅ File write/read
  • ✅ BYOK inference path active

Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY) via api-proxy → api.githubcopilot.com

🔑 BYOK report filed by Smoke Copilot BYOK
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor Author

🔍 Smoke Test Results

Test Status
GitHub MCP Connectivity ✅ PASS
GitHub.com HTTP ⚠️ N/A (template vars unexpanded)
File Write/Read ⚠️ N/A (template vars unexpanded)

Overall: PARTIAL — MCP connectivity confirmed; pre-computed test data unavailable due to workflow template variable expansion failure.

Triggered on PR #6602. Author/assignees not accessible (secrecy policy).

📰 BREAKING: Report filed by Smoke Copilot
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor Author

@lpcox Smoke test for PRs: ${{ steps.smoke-data.outputs.SMOKE_PR_DATA }}
• MCP API: ✅
• GitHub.com HTTP: ✅
• File I/O: ✅
• BYOK inference: ✅
Running in direct BYOK mode (AWF_AUTH_TYPE=github-oidc + AWF_AUTH_AZURE_* + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw)
Overall: PASS

🪪 BYOK (AOAI Entra) report filed by Smoke Copilot BYOK AOAI (Entra)
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor Author

Chroot Runtime Version Comparison

Runtime Host Version Chroot Version Match?
Python Python 3.12.13 Python 3.12.13 ✅ YES
Node.js v24.18.0 v22.23.1 ❌ NO
Go go1.22.12 go1.22.12 ✅ YES

Overall: ❌ FAILED — Node.js version mismatch between host (v24.18.0) and chroot (v22.23.1).

Tested by Smoke Chroot
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor Author

Smoke Test Results — Services Connectivity

Check Result
Redis PING host.docker.internal DNS resolution failed; also tried 172.17.0.1 — network unreachable
PostgreSQL pg_isready ❌ No response on either host.docker.internal or 172.17.0.1:5432
PostgreSQL SELECT 1 ❌ Could not connect (same DNS/network issue)

Overall: FAIL

host.docker.internal does not resolve in this sandbox environment (no Docker bridge available). Service containers are not reachable.

🔌 Service connectivity validated by Smoke Services
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor Author

Smoke Test Results

  • GitHub MCP: ❌ (Secrecy Policy blocked access to PRs)
  • GitHub.com Connectivity: ❌ (Connection failed)
  • File Writing: ✅
  • Bash Tool: ✅

Overall Status: FAIL

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • localhost

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "localhost"

See Network Configuration for more information.

💎 Faceted by Smoke Gemini
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor Author

✅ test: drop stale smoke-copilot-pat references
✅ fix: update brace-expansion to 5.0.8 (GHSA-mh99-v99m-4gvg)
✅ GH PR query
✅ Playwright/GitHub title
✅ File + build
Overall: PASS

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • registry.npmjs.org

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "registry.npmjs.org"

See Network Configuration for more information.

🔮 The oracle has spoken through Smoke Codex
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor Author

Smoke Test: API Proxy OpenTelemetry Tracing — Results

Scenario Status Notes
1. Module Loading otel.js loads; exports startRequestSpan, setTokenAttributes, setBudgetAttributes, endSpan, endSpanError, shutdown, isEnabled
2. Test Suite 59 tests passed, 0 failed across 2 suites (otel.test.js, otel-fanout.test.js)
3. Env Var Forwarding api-proxy-env-config forwards OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_HEADERS, GITHUB_AW_OTEL_TRACE_ID, GITHUB_AW_OTEL_PARENT_SPAN_ID, OTEL_SERVICE_NAME
4. Token Tracker onUsage onUsage callback present at line 406 in token-tracker-http.js — OTEL hook point confirmed
5. OTEL Diagnostics ⚠️ Live span export data not accessible from sandbox; no errors detected

All validatable scenarios pass. OTEL integration is functional.

📡 OTel tracing validated by Smoke OTel Tracing
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor Author

Smoke Test Results

  • GitHub MCP: ❌ Resource fetch failed (lower integrity)
  • GitHub.com: ✅
  • File I/O: ✅
  • BYOK Inference: ✅

Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw)

Overall: FAIL

@lpcox

🔑 BYOK (AOAI api-key) report filed by Smoke Copilot BYOK AOAI (api-key)
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor Author

🏗️ 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 1/1 passed ✅ PASS
Go env 1/1 passed ✅ PASS
Go uuid 1/1 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 #6602 · sonnet46 · 50.2 AIC · ⊞ 8.3K ·
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor Author

🔥 Smoke Test: Docker Sbx — PASS

Test Result
GitHub MCP connectivity ✅ Connected (secrecy-filtered response)
GitHub.com HTTP ✅ (pre-step confirmed reachable)
File write/read smoke-test-docker-sbx-30210654419.txt verified

Overall: PASS · Run: 30210654419

📰 BREAKING: Report filed by Smoke Docker Sbx
Add label ready-for-aw to run again

@lpcox
lpcox merged commit 58b9cbe into main Jul 26, 2026
139 of 140 checks passed
@lpcox
lpcox deleted the test-coverage/upstream-proxy-port-validation-6dfde0bb4009773f branch July 26, 2026 17:04
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.

2 participants