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

multiple options for keys, not just values based on filters #59

Closed
danielb2 opened this issue Jul 8, 2016 · 4 comments
Closed

multiple options for keys, not just values based on filters #59

danielb2 opened this issue Jul 8, 2016 · 4 comments

Comments

@danielb2
Copy link

danielb2 commented Jul 8, 2016

What if I have:

{
  "plugins": {
    "$filter": "env",
    "$base": {
      "inert": {}
    },

    "qa": {
      "blipp": {}
    },
    "prod": {
      "good": {}
    },

    "$filter": "debug",
    "prod": {
      "debug": {}
    }
    "qa": {
      "extra-debug": {}
    }
  }
}

Right now it's very easy to have values change based on particular filters, however, keys at the same level doesn't seem to have the ability to change. For instance, I may want to have extra debugging plugin loaded for qa. It would be nice to have multiple filters at the same key level.

I don't believe this is possible atm?

( yes I realize in this instance you could argue that a debug plugin should be able to take options for debug levels, but this is an example and not the actual use-case, so please bear with me )

@danielb2 danielb2 closed this as completed Jul 8, 2016
@danielb2
Copy link
Author

danielb2 commented Jul 8, 2016

I believe I can solve this with further nestings which gets a bit hairy

@danielb2
Copy link
Author

danielb2 commented Jul 8, 2016

The equivalent will look like this:

{
  "plugins": {
    "$filter": "env",
    "$base": {
      "inert": {}
    },

    "qa": {
      "$filter": "debug",
      "$default": {
        "blipp": {}
      },
      "$base": {
        "blipp": {}
      },
      "on": {
        "extra-debug": {}
      }
    },

    "prod": {
      "$filter": "debug",
      "$default": {
        "good": {}
      },
      "$base": {
        "good": {}
      },
      "on": {
        "debug": {}
      }
    }
  }

@danielb2
Copy link
Author

danielb2 commented Jul 8, 2016

I think the above is unnecessarily complex. Think there's a better way to solve this?

Basically prod should always load good, qa always load blipp. debug filter turns the appropriate filter on for each one.

@patrickkettner
Copy link
Contributor

sorry for taking so long to get back to you on this.

We are not interested in adding the ability to mutate keys to confidence. This would be best suited to a function that would generate your object, that is then passed to confidence

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

No branches or pull requests

2 participants