Skip to content
This repository has been archived by the owner on Oct 24, 2019. It is now read-only.

dispatch-oracle: knowing who to DM and tag #22

Closed
ianshward opened this issue Aug 9, 2017 · 3 comments
Closed

dispatch-oracle: knowing who to DM and tag #22

ianshward opened this issue Aug 9, 2017 · 3 comments

Comments

@ianshward
Copy link
Member

ianshward commented Aug 9, 2017

In order to know who to DM on Slack, as well as tag in Github issues, for rules like https://github.com/mapbox/patrol-service/issues/137 we need a way to look up a user's Slack and Github. On one hand we could assume that all messages sent to dispatch should already contain who to DM and who to tag. However, having to bake that into every single patrol rule would not be very convenient. I'm leaning toward that we should support two ways (example message json sent to dispatch. Property names are just examples and not implying we call them this):

{
  recipient: {
    slack: "@ianshward",
    github: "@ianshward"
  }
}

In this format, we tell dispatch we know who to send the message to

So what does our REST endpoint do

For our REST endpoint (dispatch-oracle), it'd be an api-gateway-fronted lambda. The lambda code would fetch the latest version of our internal list of GitHub and Slack handles.

The interface could look like:

lookup('@ianshward')

What do other peoples' REST endpoints do

Assuming we open source dispatch, people can plug in a URL to their "oracle endpoint" and it can work however they want it to. It should just return JSON in a specified manner.

Where does this live

This dispatch-oracle should be a separate GH project, since if we open source Dispatch, dispatch-oracle is very custom to our use case and we would not want to make it publicly available.

Is it overkill

I don't think so. This is one of the most critical aspects of dispatch - knowing who to assign a task to, and, ensuring dispatch always has a very up-to-date directory (which /us does for us already).

cc @k-mahoney @oliikit

@ianshward ianshward mentioned this issue Aug 9, 2017
9 tasks
@ianshward
Copy link
Member Author

Based on discussion over on https://github.com/mapbox/generate-people/issues/31 we should do this as a standalone lambda + api-gateway and use our own BambooHR access token. The lambda should fetch all users from BambooHR, and then use the "key" provided as a query string to look up the matching user. The "key" could be one of github handle, serial number, or slack handle, for now.

The result it returns could be like:

{
    "github": "ianshward",
    "slack": "ianshward",
    "laptop_serial": "ABC123"
  }

We can use lambda-cfn to build this. This can live it its own repo since having it live here complicates open sourcing dispatch.

The second part of this work is to add the functionality into dispatch-incoming so that it does a GET request when the incoming message says the recipient needs to do a lookup.

@oliikit
Copy link
Contributor

oliikit commented Aug 16, 2017

Dispatch oracle repo is created!

@oliikit
Copy link
Contributor

oliikit commented Aug 24, 2017

We got the oracle created! We just need to integrate now with Dispatch. Since this ticket is mainly for creating oracle, I will close and open up a new issue for the integration.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants