-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
Add ability to override/merge items in local .DEREK.yml #140
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.
Looks good so far. I think we need to add an abuse-prevention technique for cyclic redirects or redirects which are too deep.
Currently it only follows the local file's redirect url (only goes 1 layer deep) |
4022163
to
59fe949
Compare
59fe949
to
4d54685
Compare
We can now provide some local overrides from our Local DEREK.yml, these overrides are then merged with the remote DEREK.yaml. This allows us to add specific users to specific repos, or add features for specific ones too. Any slices are merged and the single values are overridden by the local values. Signed-off-by: Alistair Hey <alistair@heyal.co.uk>
4d54685
to
4a9cdaf
Compare
|
||
func MergeDerekRepoConfigs(localConfig, remoteConfig DerekRepoConfig) (DerekRepoConfig, error) { | ||
|
||
mergeErr := mergo.Merge(&remoteConfig, &localConfig, mergo.WithAppendSlice) |
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.
Are we going to have the same issues we have with ofc-bootstrap? I saw some tests, do we need more?
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.
LGTM
I suspect the messages list might break @Waterdrips, can you add some tests for union/intersection? |
Good spot. Iv just written a failing test. I'll get a pr in to sort that messages list soon |
Description
We can now provide some local overrides from our Local DEREK.yml,
these overrides are then merged with the remote DEREK.yaml.
This allows us to add specific users to specific repos, or add
features for specific ones too. Any slices are merged and the
single values are overridden by the local values.
Signed-off-by: Alistair Hey alistair@heyal.co.uk
Motivation and Context
Config redirect with local repo-based overrides #94
How Has This Been Tested?
Unit tests written, and this was tested on github using this repo: https://github.com/Waterdrips/heyal-ofc-customers
I setup a .DEREK.yml that had me as a contributor and a load of general config, but no "features"
pointed the Redirect at .DEREK-OVERRIDE.yml in the same repo, which added @alexellis as a contributor, plus it had the features listed.
Then I created a non signed commit and PR, DCO check was done (features in redirect file)
I was able to use the derek commands (local file)
And Alex was able to use Derek commands (set in redirect file)
Types of changes
Checklist:
git commit -s