-
Notifications
You must be signed in to change notification settings - Fork 26
feat: Combine configs using deepmerge #22
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it 👍
Prior to this change, all top-level keys of a config file would be replaced entirely by the incoming config. For some apps, this may be sufficient. However, some apps have complex settings, and the extend feature is much more useful if you can be more granular about what you are overriding. With this change, you can keep as much or as little of the base config as you'd like. closes probot#21
This matches probot/probot, and will hopefully pass the build.
As soon as this is complete, I'll be able to finish repository-settings/app#105 . That will make the Settings app (especially Protected Branches) considerably more useful and easier to use. |
this will be great! i've been hoping for similar for things even as simple as labels, so i could define a list at the org ( |
deepmerge also merges arrays: https://runkit.com/gr2m/5beca2c2d45bc90012f63204. I don’t see a problem myself right now, but worth mentioning.
|
@gr2m, that is actually one of the features I'm counting on. It allows you to pass a function to use when merging arrays, and I'm going to use it for branch merging in the Protected Branches plugin for the Settings app. |
I considered adding a few different merge functions to this repo that someone could choose to use. Maybe one that overwrites the existing array, one that merges elements based on their index, and one that takes a predicate function like |
LOVELY! thank you! |
Thanks for getting this up to date, @hiimbex. I'm curious if ya'll have considered switching to a |
@jwsloan I agree with the rebase, I do it on all my repos. I use squash-merge, too. And I automate releases using semantic-release. We had that on Probot for a while but removed it after once a major version was released accidentally. I hope to get back to automating things, once semantic-release has a review step :) |
Prior to this change, all top-level keys of a config file would be
replaced entirely by the incoming config. For some apps, this may
be sufficient. However, some apps have complex settings, and the
extend feature is much more useful if you can be more granular about
what you are overriding.
With this change, you can keep as much or as little of the base config
as you'd like.
closes #21