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

Add logging for ignored env vars #1698

Merged
merged 2 commits into from
Jan 7, 2021
Merged

Conversation

eduardoboucas
Copy link
Member

@eduardoboucas eduardoboucas commented Jan 6, 2021

- Summary

This PR adds logging messages that flag to the user whenever an environment variable they've defined is overridden by another variable with the same name defined somewhere with a higher precedence.

Closes #1598.

- Test plan

In this example, I've defined NETLIFY_TEST_VAR in four places (.env file, .env.development file, team-level environment, and site-level environment) and TWITTER_SCREEN_NAME in two (site-level environment and process level).

Screenshot 2021-01-06 at 15 05 02
Screenshot 2021-01-06 at 16 04 29

- Description for the changelog

Log overridden environment variables

- A picture of a cute animal (not mandatory but encouraged)

acting-like-animals-dear-tumblr-im-bored

@eduardoboucas eduardoboucas requested a review from a team as a code owner January 6, 2021 18:48
@eduardoboucas eduardoboucas added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Jan 6, 2021
Copy link
Contributor

@erezrokah erezrokah left a comment

Choose a reason for hiding this comment

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

This looks great!

@eduardoboucas
Copy link
Member Author

@erezrokah @ehmicky do you think we should merge this, or should we wait for the upcoming work related to netlify/build#2040?

@ehmicky
Copy link
Contributor

ehmicky commented Jan 7, 2021

I think it's nice if we can break this separately. What do you think @erezrokah?

@erezrokah
Copy link
Contributor

I'm good with merging this. It will be easier to do netlify/build#2040 once we have these logs in place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: warn if env variables assignment is skipped due to process level env
3 participants