Set PACKAGE_MANAGER on the proxy container - #1773
AbhishekBhaskar wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The implementation consistently forwards the required value, updates all callers, and includes focused coverage.
Review tier: Balanced
Findings: None
What changed in this PR
Forwards the job’s package manager to the proxy container, enabling ecosystem-specific egress handling and observability.
Changes:
- Passes
package-managerthroughUpdaterandProxyBuilder. - Sets
PACKAGE_MANAGERin the proxy environment. - Updates unit/integration tests and bundled output.
| File | Description |
|---|---|
src/updater.ts |
Forwards the package manager. |
src/proxy.ts |
Sets the proxy environment variable. |
dist/main.js |
Updates bundled action code. |
__tests__/updater.test.ts |
Verifies argument forwarding. |
__tests__/updater-builder-integration.test.ts |
Updates proxy invocations. |
__tests__/proxy.test.ts |
Verifies the environment variable. |
__tests__/proxy-integration.test.ts |
Updates integration invocations. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
honeyankit
left a comment
There was a problem hiding this comment.
Note: dependabot-core was not affected — it already receives the full job (including package-manager) via job.json. This gap was specific to the proxy container.
@AbhishekBhaskar : My understanding is that, job.json will already contains package manager when it is passed to dependabot-action?
@honeyankit yes correct, dependabot-api sends the |
What & why
The Dependabot proxy runs in its own container and receives a curated set of env vars plus a credentials/experiments-only
config.json— it never gets the fulljob.json. As a resultos.Getenv("PACKAGE_MANAGER")was always empty in the proxy.This is a prerequisite for the egress allowlist work: the allowlist keys its per-ecosystem defaults off
PACKAGE_MANAGER, and the observability metric tags on it. Without this value, the allowlist degrades to GitHub-infra-only (every registry/CDN request would403under enforce), andpackage_managershows empty in Datadog.Changes
src/updater.ts— forwarddetails['package-manager']intoproxyBuilder.run(...).src/proxy.ts—run()/createContainer()accept apackageManagerparam; addPACKAGE_MANAGER=${packageManager}to the proxy containerEnv.dist/main.js— rebuilt (npm run package).PACKAGE_MANAGERis set on the container.Testing
npm run typecheck,lint-check,format-check,package— all pass.PACKAGE_MANAGERenv test.Related