fix(functions): forward NPM_AUTH_TOKEN to deploy bundler container#4933
fix(functions): forward NPM_AUTH_TOKEN to deploy bundler container#4933addniner wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Central YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe pull request modifies the bundle deployment logic to read the Assessment against linked issues
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
7e87154 to
b1d64e9
Compare
Pull Request Test Coverage Report for Build 23181606618Details
💛 - Coveralls |
b1d64e9 to
570e41a
Compare
|
Updated this PR against the current I kept the scope to host environment forwarding for Docker-based deploys, matching the existing Tested with: go test ./internal/functions/deploy |
The Docker bundler for functions deploy forwards NPM_CONFIG_REGISTRY
from the host environment into the container. When .npmrc uses
${NPM_AUTH_TOKEN} for private registry authentication, the token must
be available in that same bundler container for npm package resolution.
Forward NPM_AUTH_TOKEN alongside NPM_CONFIG_REGISTRY and cover both npm
env entries with a focused unit test.
Addresses supabase#4927
570e41a to
74922d7
Compare
Summary
The Docker bundler for
functions deployforwardsNPM_CONFIG_REGISTRYfrom the host environment into the container. When.npmrcuses${NPM_AUTH_TOKEN}for private registry authentication, the token also needs to be available inside that bundler container.This PR forwards
NPM_AUTH_TOKENfrom the host environment alongsideNPM_CONFIG_REGISTRY.Addresses the CI/CD host environment case in #4927.
Reproduction
supabase functions deploy hello(.npmrcwith${NPM_AUTH_TOKEN})401 unauthenticatedNPM_AUTH_TOKEN=xxx supabase functions deploy hello401 unauthenticated(env not forwarded to container).npmrcwith hardcoded tokenNPM_AUTH_TOKEN=xxxwith patched CLITested with a private package (
@addniner/test-private-pkg) on GitHub Packages, with Docker cache cleared between attempts.Testing
go test ./internal/functions/deploy