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

Always read and write nodejs runtime options from/to the environment #6076

Merged
merged 9 commits into from
Jan 26, 2021

Conversation

EvanBoyle
Copy link
Contributor

@EvanBoyle EvanBoyle commented Jan 9, 2021

Fixes #6059 Fixes #6041.

See #6059 for more detail on why this is necessary. TLDR; is that nodejs package resolution can result in multiple copies of a given package in the node_modules tree, and thus multiple runtime options variables that can get out of sync (specifically for automation API where the lifetime of runtime options is managed manually).

In order for settings to be shared appropriately in the instance where an inline program and a provider sdk dependency both bring in different copies of @pulumi/pulumi, we must read and write settings via the environment and avoid caching values.

Copy link
Member

@pgavlin pgavlin left a comment

Choose a reason for hiding this comment

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

Can we add some tests that are specific to this scenario? Even if it's just setting some config and then reading the appropriate envvar.

@komalali
Copy link
Member

@EvanBoyle any chance you could add some tests and close this out this week?

@EvanBoyle
Copy link
Contributor Author

@pgavlin good catch, I had actually forgotten that this should apply to config as well. I updated the config code to always read/write from the environment as well.

I also added some settings tests that round trip some mutations to options and config and then check the resulting environment variables.

Our node config module already has some extensive tests that lend additional confidence to this change.

Copy link
Member

@komalali komalali left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for adding those tests!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants