Skip to content

refactor: split squid-config-features.test.ts into focused files by feature area#5572

Merged
lpcox merged 4 commits into
mainfrom
copilot/refactor-squid-config-features-test
Jun 26, 2026
Merged

refactor: split squid-config-features.test.ts into focused files by feature area#5572
lpcox merged 4 commits into
mainfrom
copilot/refactor-squid-config-features-test

Conversation

Copilot AI commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

src/squid-config-features.test.ts (632 lines) mixed five independent security feature test domains into a single file, making it hard to isolate failures and navigate during code review.

Changes

  • Deleted src/squid-config-features.test.ts
  • Created five focused replacements, each under 200 lines:
File Feature area Tests
squid-config-logging.test.ts Log format, timestamps, JSONL audit schema 14
squid-config-streaming.test.ts Timeouts, half_closed_clients, session tuning 8
squid-config-blocklist.test.ts Blocklist ACLs, wildcard patterns, rule ordering 10
squid-config-ssl-bump.test.ts SSL Bump config, URL patterns, protocol restrictions 15
squid-config-dlp.test.ts DLP rules, credential pattern ACLs, empty domain edge case 9

No source code changes. Each file reproduces the shared import boilerplate (generateSquidConfig, SquidConfig) independently. All 56 tests pass.

Copilot AI changed the title [WIP] Refactor to split squid-config-features test by feature area refactor: split squid-config-features.test.ts into focused files by feature area Jun 26, 2026
Copilot finished work on behalf of lpcox June 26, 2026 15:53
Copilot AI requested a review from lpcox June 26, 2026 15:53
@lpcox lpcox marked this pull request as ready for review June 26, 2026 16:36
Copilot AI review requested due to automatic review settings June 26, 2026 16:36

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

This PR refactors the Squid configuration feature tests by splitting the previously large src/squid-config-features.test.ts into smaller, feature-focused Jest test files, improving navigability and isolating failures without changing production behavior.

Changes:

  • Deleted the monolithic src/squid-config-features.test.ts.
  • Added five focused test files covering logging, streaming timeouts, blocklist behavior, SSL bump behavior, and DLP/empty-domain behavior.
Show a summary per file
File Description
src/squid-config-features.test.ts Removes the prior all-in-one feature test file to enable more focused test organization.
src/squid-config-logging.test.ts Adds logging/audit JSONL and access_log-related config assertions.
src/squid-config-streaming.test.ts Adds assertions for long-lived/streaming timeout-related Squid directives.
src/squid-config-blocklist.test.ts Adds blocklist ACL/rule ordering and wildcard behavior coverage.
src/squid-config-ssl-bump.test.ts Adds SSL bump section/rule coverage including URL ACL ordering assertions.
src/squid-config-dlp.test.ts Adds empty-domain and DLP rule ordering/interaction coverage.

Review details

Tip

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

  • Files reviewed: 6/6 changed files
  • Comments generated: 1
  • Review effort level: Low

Comment thread src/squid-config-logging.test.ts
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

✅ Copilot review passed with no inline comments.

@copilot Add the ready-for-aw label to this PR to trigger agentic CI smoke tests.

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

🔑 Smoke Copilot PAT PAT auth validated. All systems operational. ✅

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Smoke Gemini completed. All facets verified. 💎

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Security Guard has started processing this pull request

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

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

@lpcox

lpcox commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Build Test Suite completed successfully!

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

🔌 Smoke Services — All services reachable! ✅

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Smoke Claude passed

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Contribution Check failed. Please review the logs for details.

Comment thread src/squid-config-logging.test.ts Fixed
@github-actions

Copy link
Copy Markdown
Contributor

🔥 Smoke Test: PAT Auth

Test Result
GitHub MCP
github.com connectivity (HTTP 200)
File write/read

Overall: PASS — Auth mode: PAT (COPILOT_GITHUB_TOKEN)

cc @lpcox @Copilot

🔑 PAT report filed by Smoke Copilot PAT

Copilot AI commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

@copilot fix these failing ci checks https://github.com/github/gh-aw-firewall/actions/runs/28259315804/job/83730372183?pr=5572 https://github.com/github/gh-aw-firewall/actions/runs/28259315804/job/83...

Fixed in the latest commit. The CI failure was caused by a missing closing }); on the last it() block in src/squid-config-logging.test.ts (line 165 had 2-space indent instead of 4-space, collapsing the it and inner describe closing braces into one). ESLint reported Parsing error: '}' expected at line 167. All 14 tests in that file now pass.

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Claude Engine Validation

  • API status: ✅ PASS
  • gh check: ✅ PASS
  • File status: ✅ PASS

Overall result: PASS

Generated by Smoke Claude for issue #5572 · 37.3 AIC · ⊞ 3.3K ·

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Copilot BYOK ✅

  • ✅ GitHub MCP connectivity (listed 2 PRs)
  • ✅ GitHub.com HTTP 200
  • ✅ File read test passed
  • ✅ Running in direct BYOK mode (dummy key via api-proxy)

Status: PASS

🔑 BYOK report filed by Smoke Copilot BYOK

@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smoke Test Results — PASS

Test Result
GitHub MCP connectivity
GitHub.com HTTP connectivity
File write/read

PR: refactor: split squid-config-features.test.ts into focused files by feature area
Author: @Copilot | Assignees: @lpcox @Copilot

Overall: PASS

📰 BREAKING: Report filed by Smoke Copilot

@github-actions

Copy link
Copy Markdown
Contributor

Reviewed merged PRs:

Checks:

  • GitHub reads: ✅
  • File write/readback: ✅
  • Browser title: ✅
  • Discussion lookup/comment: ✅
  • 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

@github-actions

Copy link
Copy Markdown
Contributor

Chroot Version Comparison Results

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

Overall: ❌ FAILED — Python and Node.js versions differ between host and chroot environments.

Tested by Smoke Chroot

@github-actions

Copy link
Copy Markdown
Contributor
  • GitHub MCP Testing: ❌
  • GitHub.com Connectivity: ❌
  • File Writing Testing: ✅
  • Bash Tool Testing: ✅

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

@github-actions

Copy link
Copy Markdown
Contributor

📡 Smoke Test: API Proxy OpenTelemetry Tracing

Scenario Result Notes
1. Module Loading otel.js loaded; isEnabled: true; exports: startRequestSpan, setTokenAttributes, setBudgetAttributes, endSpan, endSpanError, shutdown, isEnabled (+7 internals)
2. Test Suite 59 tests passed, 0 failed (2 suites: otel.test.js, otel-fanout.test.js)
3. Env Var Forwarding ⚠️ OTEL_EXPORTER_OTLP_ENDPOINT / GITHUB_AW_OTEL_TRACE_ID not yet in api-proxy-service.ts — expected during development
4. Token Tracker Integration token-tracker-http.js has onUsage callback (OTEL hook point)
5. OTEL Diagnostics i️ No span file at /tmp/gh-aw/.../otel.jsonl — expected (no live api-proxy container in this run)

Summary: Core OTEL implementation is solid (module loads, 59 tests pass, token-tracker hook in place). Env var forwarding from the AWF CLI to the api-proxy container is the one remaining gap — expected pending work.

📡 OTel tracing validated by Smoke OTel Tracing

@github-actions

Copy link
Copy Markdown
Contributor

@lpcox

Smoke test results:

  • GitHub MCP Testing: ✅
  • GitHub.com Connectivity: ✅
  • File Write/Read Test: ✅
  • BYOK Inference Test: ✅

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) authenticated via Microsoft Entra

Overall: PASS

🪪 BYOK (AOAI Entra) report filed by Smoke Copilot BYOK AOAI (Entra)

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test Results — Services Connectivity

Check Result
Redis PING (host.docker.internal:6379) ❌ TCP timeout
PostgreSQL pg_isready (host.docker.internal:5432) ❌ No response
PostgreSQL SELECT 1 ❌ Connection timeout

Overall: FAIL

host.docker.internal resolves to 172.17.0.1 but both ports 6379 and 5432 are unreachable (TCP timeout). Services are also not reachable on localhost (connection refused). The GitHub Actions service containers do not appear to be accessible from this runner environment.

🔌 Service connectivity validated by Smoke Services

@github-actions

Copy link
Copy Markdown
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 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 issue #5572 · 45.4 AIC · ⊞ 7.8K ·

@github-actions

Copy link
Copy Markdown
Contributor

@Copilot @lpcox
refactor: split squid-config-features.test.ts into focused files by feature area

GitHub MCP: ✅
github.com: ✅
Filesystem I/O: ✅
Direct 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: PASS

🔑 BYOK (AOAI api-key) report filed by Smoke Copilot BYOK AOAI (api-key)

@github-actions

Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 98.24% 98.28% 📈 +0.04%
Statements 98.17% 98.21% 📈 +0.04%
Functions 99.53% 99.53% ➡️ +0.00%
Branches 94.00% 94.00% ➡️ +0.00%
📁 Per-file Coverage Changes (1 files)
File Lines (Before → After) Statements (Before → After)
src/workdir-setup.ts 92.7% → 94.5% (+1.82%) 92.7% → 94.5% (+1.82%)

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

@lpcox lpcox merged commit f0e6e46 into main Jun 26, 2026
23 checks passed
@lpcox lpcox deleted the copilot/refactor-squid-config-features-test branch June 26, 2026 19:51
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.

4 participants