3

So, I've been integrating Slack into my back end lately and I noticed that it's getting kind of super annoying to work in development and/or production.

Mainly because there does not seem to be a way to switch between environments so I was wondering whether I overlooked something here.

For now I just created MyApp and [dev] MyApp and mirrored the settings s.t. I can test the app locally and on my production server. That means all slash-commands, their common webhook url, interactive message webhook urls, as well as event webhook url for events plus the additional webhook url for installation and so on.

Quite time consuming but most of all: error prone.

Long story short: I want to know if there is an easier way to manage development and production environmet for Slack apps.

bart
  • 953
  • 9
  • 23
Stefan Falk
  • 18,764
  • 34
  • 144
  • 286
  • 1
    I think having a copy of your Slack app for each environment is the way to go. Same as you would have a different instance of your database for each environment. – Erik Kalkoken Jul 17 '19 at 11:13
  • Still vote to close since they types of question tend to be primarily opinion based. – Erik Kalkoken Jul 17 '19 at 11:14
  • 1
    @ErikKalkoken Well, it's not really opinion based imo: It's either possible or not. Apparently Slack wants us to spawn and manage multiple apps for one deployment. The comparison to the database does not work here because for a database you are using the *same* code base and all you change is e.g. the connection URL. But with Slack, a valid comparison would be if I copy my entire code into a new git repository called `dev-myapp` and from now on, whenever I make a change in the repository `myapp`, I change the code manually in `dev-myapp`. – Stefan Falk Jul 17 '19 at 12:43
  • I disagree. you actually would have a full copy of your database with schema and data for each environment. But a Slack app is even less. Its just a configuration, which should be pretty stable once you finished your design. Its not all all like a code base. proof: you can represent your whole Slack app with just one config file, e.g. in JSON. – Erik Kalkoken Jul 17 '19 at 12:49
  • and the only difference between dev and prod of your Slack app should be the URLs, which point to the respective environments. I may add that you also want to use a different Slack workspace for dev and prod, so you can keep the names identical (e.g. slash commands). – Erik Kalkoken Jul 17 '19 at 12:59
  • @ErikKalkoken Can I create a Slack app using a config file? That would solve my issue actually. The issue with prod and dev is that I have to go through all apps and not just edit URLs but also commands, bot names .. – Stefan Falk Jul 17 '19 at 17:04
  • No, not that I am aware of. It might be possible for the enterprise version, IDK. My suggestion is to have one Slack app per environment and run each in their own workspace. That way you do not have to adjust bot names, commands etc. And your code should be URL agnostic. – Erik Kalkoken Jul 17 '19 at 17:09
  • @ErikKalkoken Well yes except for the point with names and commands because if I change one command, I have to adapt all apps. The same goes for permissions and so on. ^^ But anyway - the answer to the original question is just "no" - it's not possible to work with Slack-based envrionments :) – Stefan Falk Jul 17 '19 at 17:44
  • Yes that is true. However I think the name of commands and permissions should change very little once you finished design. Also I personally can recommend to stick with just one slash command (e.g. `/mybot`) and then use sub-commands (e.g. `/mybot dostuff` or `/mybot domorestuff`). that keeps change to a minimum. – Erik Kalkoken Jul 17 '19 at 17:50

1 Answers1

2

No, Slack apps do not support a formal "Production" & "Development" environment.

I posed this same question to Slack's support team today and got this response:

Hey Alex :wave:,

Thank you for taking the time to write in about this. That is exactly right, 
and you will not be penalized for having both of these apps. Alternatively,
you are also given a beta app that you can use for development once your app
is on the App Directory but I have found some developers confused with how the
 updating of settings works so making a separate app is a recommended workaround.

I hope that makes sense and good luck with your app launch!

Jun | Developer Support

I was unable to find the docs for the "beta app" Jun mentioned, but based on her description that may be for the best! In any case, their recommended approach is to use a separate Slack app for development purposes.

Alex
  • 1,394
  • 9
  • 17