Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: expose env variables from config to edge functions #5408

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

eduardoboucas
Copy link
Member

Summary

We currently have a bug where environment variables declared in netlify.toml are not exposed to edge functions.

To reproduce:

  1. Write the following in netlify.toml

    [context.dev.environment]
    FOO = "bar"
  2. Observe the log line:

    ◈ Injected netlify.toml file env var: FOO
    
  3. Write an edge function that prints the value of the environment variable and observe it's empty

This PR fixes that.

@eduardoboucas eduardoboucas added the type: bug code to address defects in shipped code label Jan 19, 2023
@eduardoboucas eduardoboucas requested a review from a team January 19, 2023 15:45
@github-actions
Copy link

github-actions bot commented Jan 19, 2023

📊 Benchmark results

Comparing with 7e27e7a

Package size: 267 MB

⬇️ 0.00% decrease vs. 7e27e7a

^                  267 MB  267 MB  267 MB  267 MB  267 MB          267 MB  267 MB  267 MB 
│  260 MB  260 MB   ┌──┐    ┌──┐    ┌──┐    ┌──┐    ┌──┐   260 MB   ┌──┐    ┌──┐    ┌──┐  
│   ┌──┐    ┌──┐    |  |    |  |    |  |    |  |    |  |    ┌──┐    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
└───┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴──>
    T-10    T-9     T-8     T-7     T-6     T-5     T-4     T-3     T-2     T-1      T    
Legend

Copy link
Contributor

@khendrikse khendrikse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wh00p!

@codebyuma
Copy link
Contributor

👋 Just noting this related issue: https://github.com/netlify/pod-compute/issues/301

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ecosystem: Dev Foundations type: bug code to address defects in shipped code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants