Skip to content

ci: add JFrog OIDC proxy for npm registry access#223

Closed
pffigueiredo wants to merge 24 commits intomainfrom
fix/jfrog-npm-registry-proxy
Closed

ci: add JFrog OIDC proxy for npm registry access#223
pffigueiredo wants to merge 24 commits intomainfrom
fix/jfrog-npm-registry-proxy

Conversation

@pffigueiredo
Copy link
Copy Markdown
Collaborator

@pffigueiredo pffigueiredo commented Apr 13, 2026

Summary

  • Route bun install through Databricks npm proxies since registry.npmjs.org is network-blocked on Databricks machines
  • CI: JFrog OIDC proxy (databricks.jfrog.io) with auth, overwrites .npmrc + bunfig.toml, deletes lockfile before install
  • Local dev: bunfig.toml pointing to npm-proxy.dev.databricks.com (no auth needed)
  • Same pattern as neondatabase/neon-js (798530b)

Why delete the lockfile?

Bun ignores registry config for tarball downloads when a lockfile exists — it always uses registry.npmjs.org. Deleting the lockfile forces fresh resolution through the configured proxy. Version drift is mitigated by save-exact=true.

Test plan

This pull request was AI-assisted by Isaac.

neondatabase-protected-runner-group cannot reach npm registries directly.
Route through databricks.jfrog.io using OIDC authentication.
Bun reads .npmrc for registry config.

Same pattern as neondatabase/neon-js.

Co-authored-by: Isaac
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
mcp-server-neon Ignored Ignored Preview Apr 13, 2026 4:59pm

Request Review

The default working-directory is landing/, and landing/.npmrc already
exists. Bun stops walking up when it finds an .npmrc, so the root-level
file was never read. Append JFrog registry config to landing/.npmrc.

Co-authored-by: Isaac
.npmrc was correctly written but bun may not read it for tarball
downloads. Add BUN_CONFIG_REGISTRY env var as belt-and-suspenders,
plus a debug step to verify .npmrc contents.

Co-authored-by: Isaac
landing/.npmrc has no trailing newline, so >> concatenated the
registry line onto the save-exact line, producing invalid config.

Co-authored-by: Isaac
The runner image (ubuntu-22-04-crowdstrike-image) has a TLS-intercepting
proxy. Bun uses BoringSSL with bundled root CAs and doesn't read the
system CA store. NODE_EXTRA_CA_CERTS makes bun trust the system bundle
where CrowdStrike's CA cert is installed.

Co-authored-by: Isaac
Need to understand: does the CA file exist? Is there a proxy? Can
curl reach npm/JFrog? What cert does the TLS handshake present?

Co-authored-by: Isaac
Diagnostics show registry.npmjs.org is network-blocked on the runner
(SSL_ERROR_SYSCALL), not a cert issue. JFrog is reachable. But bun
with --frozen-lockfile may use cached resolution URLs ignoring the
registry override. Test without --frozen-lockfile first.

Co-authored-by: Isaac
Need to verify if JFrog rewrites tarball URLs or leaves them pointing
to registry.npmjs.org (which is network-blocked on the runner).

Co-authored-by: Isaac
bun.lock stores empty resolved URLs which default to registry.npmjs.org
for tarball downloads. Deleting the lockfile forces bun to resolve
everything fresh from the configured JFrog registry, including tarballs.

Confirmed locally: without lockfile, bun correctly uses JFrog URLs.

Co-authored-by: Isaac
- Remove debug/diagnostic steps from pr.yml
- Remove NODE_EXTRA_CA_CERTS (not needed — fix was lockfile deletion)
- Add landing/bunfig.toml pointing to npm-proxy.dev.databricks.com
  for local development behind the corporate proxy

Co-authored-by: Isaac
- bunfig.toml: set default registry to npm-proxy.dev.databricks.com
- .npmrc: override @neondatabase scope (global ~/.npmrc points it to
  the blocked registry.npmjs.org)
- Regenerate bun.lock via the Databricks proxy

registry.npmjs.org is network-blocked on Databricks machines.
npm-proxy.dev.databricks.com proxies all packages including
@neondatabase scoped ones.

Co-authored-by: Isaac
bunfig.toml points to npm-proxy.dev.databricks.com (local dev proxy)
which CI runners can't reach. Override it with JFrog URL in CI.
Revert .npmrc @neondatabase scope (only needed locally, and bunfig.toml
handles it).

Co-authored-by: Isaac
.npmrc has @neondatabase scope pointing to npm-proxy.dev.databricks.com
(local dev only). CI overwrites .npmrc entirely with JFrog config
to avoid reaching unreachable dev proxy.

Co-authored-by: Isaac
The scope override was working around a stale global ~/.npmrc that
pointed @neondatabase packages at the blocked registry.npmjs.org.
The Databricks proxy already has @neondatabase packages, so the
override is unnecessary once the global config is fixed.

Co-authored-by: Isaac
Default registry already handles all packages including @neondatabase.

Co-authored-by: Isaac
Drop JFrog CLI, OIDC auth, .npmrc overwrite. The committed bunfig.toml
already points to npm-proxy.dev.databricks.com which needs no auth.
If CI runners can reach it, this is all we need.

Co-authored-by: Isaac
npm-proxy.dev.databricks.com is only reachable from dev machines,
not from neondatabase-protected-runner-group CI runners. JFrog OIDC
is required for CI.

Consolidated the .npmrc and bunfig.toml overwrite into a single
Configure step.

Co-authored-by: Isaac
Don't commit internal proxy URL to public repo. Instead:
- bin/setup-registry.sh generates bunfig.toml locally (run once)
- bunfig.toml is gitignored
- CI generates its own bunfig.toml with JFrog in the workflow

Co-authored-by: Isaac
No manual setup needed — bun install triggers preinstall which
generates bunfig.toml if missing. CI already writes its own
bunfig.toml before install, so the hook is a no-op there.

Co-authored-by: Isaac
Avoids committing internal proxy URL to public repo. The script
reads whatever registry the developer has in their global ~/.npmrc.
Databricks devs get the proxy, external contributors get npmjs.org.

Co-authored-by: Isaac
Instead of letting bun hang with cryptic ConnectionRefused errors,
detect registry.npmjs.org and tell the developer to configure a
proxy in their global ~/.npmrc.

Co-authored-by: Isaac
Check BUN_CONFIG_REGISTRY env var first, then npm config, then
default. Error message gives three options: global ~/.npmrc, env
var for this session, or manual bunfig.toml creation.

Co-authored-by: Isaac
@pffigueiredo
Copy link
Copy Markdown
Collaborator Author

Superseded by #224 which includes JFrog OIDC setup + pnpm migration in a single PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant