[WIP] Refactor API proxy secret-isolation tests to reduce duplicate code#5305
Conversation
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (1 files)
Coverage comparison generated by |
There was a problem hiding this comment.
Pull request overview
Refactors the API-proxy secret-isolation Jest tests to reduce repeated process.env mutation/restoration and repeated Docker Compose env extraction, making it easier to add/maintain additional key-isolation cases consistently.
Changes:
- Added a local
withEnvVar()helper to centralize env var mutation + restoration viatry/finally. - Added a local
getAgentEnvironment()helper to centralize compose generation + agent env retrieval. - Updated multiple API key isolation test cases (Anthropic/OpenAI/Codex, with/without
envAll) to use the helpers.
Show a summary per file
| File | Description |
|---|---|
| src/services/api-proxy-service-key-isolation.test.ts | Introduces local test helpers and refactors key-isolation cases to use them, reducing duplicated scaffolding. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 1
| const getAgentEnvironment = ( | ||
| config: WrapperConfig, | ||
| networkConfig = mockNetworkConfigWithProxy | ||
| ): Record<string, string> => { | ||
| const result = generateDockerCompose(config, networkConfig); | ||
| return result.services.agent.environment as Record<string, string>; | ||
| }; |
|
@copilot address the review feedback and fix the pr title and summary |
Addressed in |
|
@copilot address the review feedback and fix the pr title and summary |
|
✅ Copilot review passed with no inline comments. @copilot Add the |
|
🔌 Smoke Services — All services reachable! ✅ |
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded. |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
❌ Smoke Claude failed |
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅ |
|
✅ Smoke Copilot BYOK AOAI (Entra) completed. Copilot AOAI BYOK (Entra) mode operational. 🔓 |
|
✅ Build Test Suite completed successfully! |
|
✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓 |
|
✅ Smoke Copilot BYOK AOAI (api-key) completed. Copilot AOAI BYOK (api-key) mode operational. 🔓 |
|
🚀 Security Guard has started processing this pull request |
|
✅ Smoke Gemini completed. All facets verified. 💎 |
|
🔑 Smoke Copilot PAT PAT auth validated. All systems operational. ✅ |
|
✅ Contribution Check completed successfully! |
🔥 Smoke Test Results
PR: [WIP] Refactor API proxy secret-isolation tests to reduce duplicate code Overall: PASS ✅
|
Smoke Test: Copilot BYOK (Direct) ✅
Status: PASS
|
🔥 Smoke Test: Copilot PAT — PASS
Overall: PASS | Auth mode: PAT (COPILOT_GITHUB_TOKEN) CC
|
|
[WIP] Refactor API proxy secret-isolation tests to reduce duplicate code 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.
|
|
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
|
🔬 Smoke Test: API Proxy OpenTelemetry Tracing
All 5 scenarios pass. OTEL tracing integration is fully wired: module loads, tests pass, env vars are forwarded, token-tracker hooks exist, and graceful degradation is confirmed.
|
Gemini Smoke Test Results
Overall status: PASS 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.
|
Chroot Version Comparison Results
Overall: ❌ Not all versions matched. Go versions are in sync, but Python and Node.js differ between the host and chroot environments. The chroot is running older versions (Python 3.12.3 vs 3.12.13, Node v22 vs v24).
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
Smoke Test Results — FAIL
Overall: FAIL
|
|
|
src/services/api-proxy-service-key-isolation.test.tslint,build,test) before code changeslint,build,test) and security scan