Conversation
pickEnvVars to eliminate repetitive env passthrough spread pattern
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (2 files)
✨ New Files (1 files)
Coverage comparison generated by |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
Refactors the api-proxy sidecar’s environment passthrough construction by introducing a small utility helper to reduce repetitive conditional spreads and make host env passthrough easier/safer to extend.
Changes:
- Added
pickEnvVars(...names)helper to include only set/non-emptyprocess.envvars in an object. - Replaced repetitive
...(process.env.X && { X: process.env.X })passthrough entries inapi-proxy-service.tswithpickEnvVarscalls (including the conditional GitHub OIDC token passthrough). - Added unit tests covering
pickEnvVarsbehavior for unset, empty-string, and set values.
Show a summary per file
| File | Description |
|---|---|
| src/services/api-proxy-service.ts | Uses pickEnvVars to simplify and standardize env passthrough into the api-proxy sidecar service definition. |
| src/env-utils.ts | Introduces pickEnvVars helper for conditional env var inclusion. |
| src/env-utils.test.ts | Adds Jest tests validating pickEnvVars semantics. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/3 changed files
- Comments generated: 1
| }); | ||
|
|
||
| function setEnv(key: string, value: string | undefined): void { | ||
| savedEnv[key] = process.env[key]; |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@copilot address review feedback |
Smoke Test Results✅ GitHub MCP: Last 2 merged PRs retrieved Overall Status: PASS
|
🔬 Smoke Test: Copilot BYOK (Offline) Mode
Running in BYOK offline mode ( Overall: PARTIAL — MCP and BYOK inference ✅; pre-step data unavailable (template not expanded). PR author:
|
🔍 Smoke Test Results
PR: refactor: extract Overall: PARTIAL — MCP ✅, pre-step outputs not injected (workflow template vars unexpanded)
|
This comment has been minimized.
This comment has been minimized.
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
🧪 Chroot Smoke Test Results
Overall: ❌ Not all tests passed — Python and Node.js versions differ between host and chroot environment.
|
Smoke Test Results — FAIL
|
|
Codex smoke: FAIL 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.
|
10+ nearly-identical
...(process.env.X && { X: process.env.X })spread entries inapi-proxy-service.tsmade the env passthrough block hard to extend and easy to mistype (silently dropping a variable on a typo).Changes
src/env-utils.ts— newpickEnvVars(...names: string[]): Record<string, string>helper; includes only set/non-empty vars, omits the restsrc/services/api-proxy-service.ts— replaces the 10-line spread block with threepickEnvVarscalls:src/env-utils.test.ts— unit tests forpickEnvVarscovering absent, empty-string, and set vars