Skip to content
This repository has been archived by the owner on Mar 14, 2023. It is now read-only.

Unexpected behavior when more servers defined in default than in a specific environment #137

Closed
sangaline opened this issue Oct 27, 2016 · 3 comments

Comments

@sangaline
Copy link
Contributor

Imagine a situation where you have a set of servers that you want to be common between multiple environments but then want to override the servers in other environments. Here is one possible example:

const config = {
  default: {
    servers: [ 'server01', 'server02'],
  }, development: {
    servers: ['devserver'],
  },
  ...
}

In this situation, I would expect the development configuration to include only devserver (or possibly server01, server02, and devserver). What actually happens is that it includes devserver and server02 but not server01. It's a bit subjective, but this behavior seems unintuitive to me and might just be an unintended consequence of using lodash.merge.

What do you think of making any environment-specific servers definitions completely override the default one?

@timkelty
Copy link
Member

@sangaline I agree! PR looks good, I'll merge it in.

@timkelty timkelty reopened this Nov 13, 2016
@timkelty
Copy link
Member

Ya know, looking at it now, it seems like maybe making an exception for servers isn't the way to go...it seems like maybe we should be using _.assign instead, always overwriting anything you have in your environment.

Do you agree?

@timkelty
Copy link
Member

I merged in the _.assign solution and used your test.
Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants