Branch env var improperly shadows shared env var

Bug

When using a Shared Environment Variable, creating a non-shared environment variable for one Preview branch hides the shared variable for all preview branches.

Reproduction

  1. Create a Shared Environment Variable: FOO=BAR. Attach it to all environments.
  2. Attach the variable to your project.
  3. Create a non-shared variable in your project. Click “Select custom branch.” Select a valid branch. Set the value to FOO=BAZ.
  4. Build the main preview branch, e.g. main. The build has no value for FOO.

Why I think this is wrong

In (3), I specified that FOO=BAZ only applied to my custom branch. If FOO=BAR had been set as a non-shared environment variable, FOO=BAZ would apply to my custom branch, but FOO=BAR would continue to apply to all other preview builds.

Hey @jamesarosen. Branch-specific variables are not currently supported with Shared Environment Variables

It would be really nice to have that limitation made clearer in the UI. There’s a small strikethrough the shared environment variable at the bottom of the page, but the system should alert the user that they’re about to do something dumb. This broke our app for some users for a week and we had no way to know about it.

Thanks for letting me know. I shared your feedback with the engineering team so we can consider what changes might be needed.

1 Like

While I’m disappointed that this incompatibility exists, I do appreciate the quick reply and clear answer :slight_smile:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.