alexellis / derek

Reduce maintainer fatigue by automating GitHub
https://github.com/alexellis/derek/blob/master/USER_GUIDE.md
MIT License
806 stars 72 forks source link

Config redirect with local repo-based overrides #94

Closed alexellis closed 2 years ago

alexellis commented 5 years ago

Expected Behaviour

The config redirect which means a local repo can have just a single entry "redirect_url: https://" rather than a complete .DEREK.yml file has been really useful across the dozen or so OpenFaaS repos. There are times where a local override is needed for a specific repo.

I would see this working as an intersection with the local override taking precedence. This would also be useful for the rebase feature in #91.

There may be a generic config set up in the "main" repo - all other repos may point there defining "@alexellis has rebase access" - then the CLI repo for instance may have @rgee0 and @johnmccabe as having rebase access, so you'd end up with the following for the CLI repo: @alexellis @rgee0 and @johnmccabe without having to specify that @alexellis had access to this feature.

Current Behaviour

Possible, but with duplication and maintenance is required for separate files.

Possible solution

If redirect_url is present, fetch that config file then overlay it with the file being read afterwards.

rgee0 commented 5 years ago

I think this should be relatively simple to implement.

https://github.com/alexellis/derek/blob/784b91660b7bbdc7a3570c65e9e1ebdc4385cc2b/permissionsHandler.go#L104

We parse the remote .DEREK.yml here into a separate types.DerekRepoConfig and then add a method call immediately afterwards to merge the existing local config with that retrieved remotely, de-duping in the process.

alexellis commented 5 years ago

That approach sounds good to me.

burtonr commented 5 years ago

I could take this on as my first contribution to the Derek project :smile:

alexellis commented 5 years ago

Sounds good to me, thanks for commenting so that other people know it's being tackled 👍 🤖

alexellis commented 4 years ago

I did this in ofc-bootstrap, so should be easy to plugin in the approach from there. I think this is fair game for anyone to pick up now.

@Waterdrips, WDYT?

Waterdrips commented 4 years ago

yeh that would be useful. I can pick that up, or we could see if any of our new contributors want to take it? (and i could focus on the ofc helm chart :sweat_smile: )

alexellis commented 4 years ago

Merge plans example code:

https://github.com/openfaas-incubator/ofc-bootstrap/blob/6ea58839a0c615e457cae37dc99cd6cd70a3dbc2/pkg/types/merge.go#L12

alexellis commented 4 years ago

Don't mind, as long as it can be done as in finished within the next week to keep the merge/rebase feature moving forward.

Waterdrips commented 4 years ago

Ah if we need it done for that I'll take it and do it this weekend.

alexellis commented 4 years ago

Merci :+1:

rgee0 commented 2 years ago

Derek close: implemented in #140