remind101 / empire

A PaaS built on top of Amazon EC2 Container Service (ECS)
BSD 2-Clause "Simplified" License
2.69k stars 158 forks source link

Add a Slack slash command interface #686

Open ejholmes opened 8 years ago

ejholmes commented 8 years ago

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.

mwildehahn commented 8 years ago

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

mwildehahn commented 8 years ago

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 :)

phobologic commented 8 years ago

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 commented 8 years ago

Oops, wrong button :)

ejholmes commented 8 years ago

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.

phobologic commented 8 years ago

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?

ejholmes commented 8 years ago

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 commented 8 years ago

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.