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

Enable pluggable drivers via RPC #4

Closed
bradrydzewski opened this issue Dec 2, 2018 · 1 comment
Closed

Enable pluggable drivers via RPC #4

bradrydzewski opened this issue Dec 2, 2018 · 1 comment

Comments

@bradrydzewski
Copy link
Member

bradrydzewski commented Dec 2, 2018

It would be interesting to have an RPC driver that lets you implement your own scm client. This could be useful when you need to test / implement a driver that is not currently supported, or when you need to customize or override how an existing driver behaves.

I have started an example branch here:
https://github.com/drone/go-scm/tree/rpc

Some challenges:

  1. the rpc client will need to pass oauth1/2 credentials from the client to server. How do we do this in a generic and customizable way?
  2. some of the abstractions in this library currently leak. Specifically we need to know how to create a netrc file for cloning (in Drone) and we use the driver name to determine the exact format. We would need to work around this. Also we use the driver name to decide whether or not to ignore certain webhook types. For example, GitHub may use a push webhook for tags, and ignore tag_create webhooks because we get more information from the push.
  3. we will need to split parsing the webhook and validating the signature into separate methods. Doing this in a single function with a callback is not conducive to this rpc proposal.
  4. ideally we would do simple REST rpc (I'd prefer not to pull in a giant dependency like grpc). We would probably have to come up with some sort of convention for how we want to handle routing, passing input parameters, etc. Maybe just simple jsonrpc?
@tboerger
Copy link
Contributor

tboerger commented Dec 3, 2018

Sounds like a good plan. I think jsonrpc should eliminate 3 and 4 and is still easy to handle.

jstrachan pushed a commit to jstrachan/go-scm that referenced this issue Jun 14, 2021
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