empire icon indicating copy to clipboard operation
empire copied to clipboard

Add a Slack slash command interface

Open ejholmes opened this issue 9 years ago • 8 comments

I think it would be really cool to have built in support for an /empire slack command.

e.g.

/empire ps -a app
/empire restart -a app
/empire scale web=2 -a app

There's a Go library at https://github.com/ejholmes/slash for handling Slack slash commands.

No plans to implement this anytime soon, but I wanted to open it up to keep track of the idea.

ejholmes avatar Dec 09 '15 05:12 ejholmes

I think this would be cool. I'd really like to have notifications around deploys being complete, people sshing into containers etc

mwildehahn avatar Dec 09 '15 17:12 mwildehahn

if we setup: https://github.com/remind101/empire/issues/458 i could route those to slack. i'm going to look into setting this up. i get tired of running emp ps -a app over and over to determine if the app has been deployed :)

mwildehahn avatar Dec 09 '15 19:12 mwildehahn

My main concern over this is the loss of authentication. I think some places might be fine with that. I think it largely also has to do with what commands we allow.

@mhahn I don't think that #458 would actually fix what you're saying. The issue there is that Empire, once we make a change, does not actively monitor and report back when that change is complete. So it'd be larger than what #458 is advocating. It is annoying though to have so little feedback on whether changes you made worked or not.

phobologic avatar Dec 09 '15 19:12 phobologic

Oops, wrong button :)

phobologic avatar Dec 09 '15 19:12 phobologic

So, I think we actually wouldn't lose authentication if we decided to do this. We can still github oauth users that come in through the slack commands and do the same ACL stuff that we're planning to do.

Here's an example of doing that.

ejholmes avatar Dec 10 '15 03:12 ejholmes

Huh, that's pretty cool- though once someone authenticates they are forever authenticated it looks like? Not sure that matters much. Are you imagining that slack would have it's own end points for all the commands it would have, or would you use the existing command endpoints?

phobologic avatar Dec 10 '15 17:12 phobologic

Might require a separate table that stores a slack user id -> empire access token mapping, but I'm pretty sure we can reuse all of the authorization middleware that we use in the api control layer with this.

ejholmes avatar Dec 10 '15 23:12 ejholmes

I was imaging it would just be a separate control layer in package server/slack. It'd just be a consumer of package empire like the api is. I think this could be mvp'd with just a couple of commands. One of the most important for us would be an /empire restart and a slash command for enabling github deployments webhooks on a repo.

ejholmes avatar Dec 10 '15 23:12 ejholmes