{"action":"created","issue":{"url":"https://api.github.com/repos/ember-cli-deploy/ember-cli-deploy/issues/429","repository_url":"https://api.github.com/repos/ember-cli-deploy/ember-cli-deploy","labels_url":"https://api.github.com/repos/ember-cli-deploy/ember-cli-deploy/issues/429/labels{/name}","comments_url":"https://api.github.com/repos/ember-cli-deploy/ember-cli-deploy/issues/429/comments","events_url":"https://api.github.com/repos/ember-cli-deploy/ember-cli-deploy/issues/429/events","html_url":"https://github.com/ember-cli-deploy/ember-cli-deploy/issues/429","id":179868484,"number":429,"title":"Needed: a consistent way to modify config","user":{"login":"jrjohnson","id":349624,"avatar_url":"https://avatars.githubusercontent.com/u/349624?v=3","gravatar_id":"","url":"https://api.github.com/users/jrjohnson","html_url":"https://github.com/jrjohnson","followers_url":"https://api.github.com/users/jrjohnson/followers","following_url":"https://api.github.com/users/jrjohnson/following{/other_user}","gists_url":"https://api.github.com/users/jrjohnson/gists{/gist_id}","starred_url":"https://api.github.com/users/jrjohnson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrjohnson/subscriptions","organizations_url":"https://api.github.com/users/jrjohnson/orgs","repos_url":"https://api.github.com/users/jrjohnson/repos","events_url":"https://api.github.com/users/jrjohnson/events{/privacy}","received_events_url":"https://api.github.com/users/jrjohnson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-28T19:39:28Z","updated_at":"2016-09-29T07:54:38Z","closed_at":null,"body":"Each plugin has configuration options, and sometimes they can get complicated.  As a user if I override a large configuration section I run the risk of missing a future improvement to the plugin because I'm no longer using the default values.  As an example in the json-config plugin the jsonBlueprint option is a large object with several keys.  The only way to override it currently is to replace the entire default object with my own.\r\n\r\nAfter some discussion with @achambers a better approach might be to create a callback in deploy.js which would get the default configuration object for each plugin and then return a modified one.  This would make it much easier to inherit and preserve defaults while overriding only needed options.\r\n\r\nI see three possible ways to specify this:\r\n1) Each option in a plugin could be specified as a callback, eg:\r\n```javascript\r\nENV['s3'] = {\r\n    filePattern(filePath){\r\n      return filePath += ',*.json';\r\n    }\r\n  }\r\n```\r\n\r\n2) Each plugin could be overridden, eg:\r\n```javascript\r\nENV['s3'] = {\r\n    config(defaultConfig){\r\n      defaultConfig.filePath += '*.json';\r\n      return defaultConfig;\r\n    }\r\n  }\r\n```\r\n\r\n3) The entire config tree could be modified:\r\n```javascript\r\nENV.config(defaultConfig){\r\n    defaultConfig['s3'].filePath += '*.json';\r\n    return defaultConfig;\r\n}\r\n```\r\n\r\nI think option 2 provides the right balance of specificity and usefulness.  I'm willing to take a shot at implementing this but I wanted to open it up to discussion first to see if this is a good approach and what the API should look like for users.\r\n\r\nAll comments welcome,"},"comment":{"url":"https://api.github.com/repos/ember-cli-deploy/ember-cli-deploy/issues/comments/250396526","html_url":"https://github.com/ember-cli-deploy/ember-cli-deploy/issues/429#issuecomment-250396526","issue_url":"https://api.github.com/repos/ember-cli-deploy/ember-cli-deploy/issues/429","id":250396526,"user":{"login":"LevelbossMike","id":242299,"avatar_url":"https://avatars.githubusercontent.com/u/242299?v=3","gravatar_id":"","url":"https://api.github.com/users/LevelbossMike","html_url":"https://github.com/LevelbossMike","followers_url":"https://api.github.com/users/LevelbossMike/followers","following_url":"https://api.github.com/users/LevelbossMike/following{/other_user}","gists_url":"https://api.github.com/users/LevelbossMike/gists{/gist_id}","starred_url":"https://api.github.com/users/LevelbossMike/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LevelbossMike/subscriptions","organizations_url":"https://api.github.com/users/LevelbossMike/orgs","repos_url":"https://api.github.com/users/LevelbossMike/repos","events_url":"https://api.github.com/users/LevelbossMike/events{/privacy}","received_events_url":"https://api.github.com/users/LevelbossMike/received_events","type":"User","site_admin":false},"created_at":"2016-09-29T07:54:38Z","updated_at":"2016-09-29T07:54:38Z","body":"Though I have not felt this pain before this definitely sounds like a great solution for configuration properties that return a \"complex\" object like `jsonBlueprint`.\r\n\r\nBecause this changes the current behaviour quite significantly I guess this would need to be be considered a breaking change right?"}}
{"actor":{"display_login":"LevelbossMike"}}