Skip to content

Align bridge env config loading behavior#767

Open
eamsden wants to merge 1 commit into
mainfrom
ea/envconfig
Open

Align bridge env config loading behavior#767
eamsden wants to merge 1 commit into
mainfrom
ea/envconfig

Conversation

@eamsden

@eamsden eamsden commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

What was changed

Pass empty OverrideEnvVars through to bridge environment config loading instead of treating an empty override dictionary as unset.

Why?

This keeps bridge config-loading behavior aligned with other SDKs and lets an explicit empty override suppress the process environment. This PR was split out from ea/aws-lambda so the EnvConfig.cs change can be reviewed independently.

Checklist

  1. Closes N/A

  2. How was this tested:
    Not run; branch split only.

  3. Any docs updates needed?
    No.

@eamsden eamsden marked this pull request as ready for review July 7, 2026 19:09
@eamsden eamsden requested a review from a team as a code owner July 7, 2026 19:09

@jmaeagle99 jmaeagle99 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving, but please update the changelog at the very least.

try
{
var envVarsRef = options.OverrideEnvVars?.Count > 0
var envVarsRef = options.OverrideEnvVars != null

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is technically a breaking change, even if the comments on the OverrideEnvVars property were correct on the intended behavior. This very minor breaking change needs to be docuemnted in the changelog and the PR title updated with a 💥.

try
{
var envVarsRef = options.OverrideEnvVars?.Count > 0
var envVarsRef = options.OverrideEnvVars != null

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

And since this is changing a behavior, a small test would be warranted, if possible.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

While the vast majority of the env application is done in core, the marshaling decision is owned by the .NET side. Making a test for this might prove difficult because calling Environment.SetEnvironmentVariable will not have observable result in core; the environment block is loaded by the .NET runtime once and mutated in memory in the .NET runtime without being reflected into the native process environment.

@jmaeagle99 jmaeagle99 mentioned this pull request Jul 8, 2026
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.

2 participants