refactor: unexport internal helpers in copilot-api-resolver#3394
Conversation
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (1 files)
Coverage comparison generated by |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
This PR reduces the exported API surface of the Copilot API routing resolver by making two URL-derivation helpers module-private and exposing them to unit tests via the repository’s established testHelpers export pattern.
Changes:
- Make
deriveCopilotApiTargetFromProviderBaseUrlandderiveCopilotApiBasePathFromProviderBaseUrlnon-exported (module-private). - Add
export const testHelpers = { ... }(annotated@internal+ts-prune-ignore-next) to preserve unit-test access without named exports. - Update
src/cli.test.tsto import the helpers viatestHelpers.
Show a summary per file
| File | Description |
|---|---|
src/copilot-api-resolver.ts |
Unexports internal helper functions and re-exposes them under testHelpers for tests only. |
src/cli.test.ts |
Updates test imports to use testHelpers instead of direct named imports. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 1
|
|
||
| const { deriveCopilotApiTargetFromProviderBaseUrl, deriveCopilotApiBasePathFromProviderBaseUrl } = | ||
| copilotApiResolverTestHelpers; | ||
| import { redactSecrets } from './redact-secrets'; |
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.
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 |
Done — moved the |
Smoke Test Results✅ GitHub API: 2 PR entries confirmed Result: PASS
|
🔬 Smoke Test Results
PR: "refactor: unexport internal helpers in copilot-api-resolver" Overall: PARTIAL — MCP test passed; pre-computed test data was not injected (raw
|
|
Smoke Codex: 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.
|
Smoke Test: Copilot BYOK — PASS ✅
Running in BYOK offline mode ( PR by
|
Chroot Version Comparison Results
Overall: ❌ Not all tests passed — Python and Node.js versions differ between host and chroot.
|
|
Smoke Test: Gemini Engine Validation\n\n- GitHub MCP Testing: ❌\n- GitHub.com Connectivity: ✅\n- File Writing Testing: ✅\n- Bash Tool Testing: ✅\n\nOverall 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.
|
Smoke Test Results
Overall: FAIL —
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
deriveCopilotApiTargetFromProviderBaseUrlandderiveCopilotApiBasePathFromProviderBaseUrlwere exported despite being private implementation details ofresolveCopilotApiRouting, widening the public API surface of a security-critical module with no production consumers outside the defining file.Changes
src/copilot-api-resolver.ts: Removeexportfrom both helper functions; expose them via the establishedtestHelperspattern (@internal+ts-prune-ignore-next) for test access onlysrc/cli.test.ts: Update import to destructure fromtestHelpersinstead of direct named imports — test assertions are unchanged