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

Add /deploy command for GitHub deployment #9

Merged
merged 3 commits into from Oct 10, 2018
Merged

Add /deploy command for GitHub deployment #9

merged 3 commits into from Oct 10, 2018

Conversation

Lucus16
Copy link
Contributor

@Lucus16 Lucus16 commented Oct 9, 2018

No description provided.

Copy link
Contributor

@lukateras lukateras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vetoing. This breaks separation of concerns, making this piece of software useless (and unorthogonal) outside of Serokell. Should really be a separate service.

if String.contains?(repo, "@") do
String.split(repo, "@")
else
[repo, "production"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be an OTP param.


env =
case command do
[] -> "production"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same.

@@ -0,0 +1,41 @@
defmodule Hermetic.Github do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent casing (Github here, but not in PR title or on this site).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tbh I really hate typing GitHub, I'd rather change it all to Github.

# Finish string or raise if unclosed
defp do_split(<<>>, "", acc, false), do: Enum.reverse(acc)
defp do_split(<<>>, buf, acc, false), do: Enum.reverse([buf | acc])
defp do_split(<<>>, _, _, _), do: raise("quoted string not closed")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is manual splitting here justified over OptionParser.split/1?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this code was only moved. It is almost the same as the source of OptionParser.split/1. I don't know if we need to support ' in the command right now, but I think it's better to keep parsing consistent with the other command.

@Lucus16
Copy link
Contributor Author

Lucus16 commented Oct 10, 2018

re separation of concerns: I think it would be unwieldy to run separate bots for every small feature. The best solution is probably to create a single slack bot with plugins for each of these features. That would take me a significant amount of effort though, so I don't think it should be covered in this PR. Most of the code here can still be used verbatim for plugins, so no effort is lost. If you want to do this refactoring, feel free, otherwise I might take it up in the future when I have a better understanding of Elixir.

@mkaito
Copy link
Contributor

mkaito commented Oct 10, 2018

re separation of concerns: log

We never heard back from you about this, even though I prompted you multiple times.

Making the bot modular is out of scope for this PR.

@@ -3,6 +3,10 @@ use Mix.Config
config :hermetic, Hermetic,
cowboy_options: [port: 59468]

config :hermetic, Hermetic.Slash.Deploy,
default_ref: "master",
default_env: "production"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I'm aware that this is configurable, I'd prefer the default to be staging, so that a deployment to production needs to be explicitly specified.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I chose production because this is what the github api defaults to, so I think it makes more sense because that is what people expect a bot to do that just wraps the github deployments api.

@lukateras
Copy link
Contributor

lukateras commented Oct 10, 2018

We never heard back from you about this, even though I prompted you multiple times.

We've had this conversation multiple times over several months, even back to when it was Vito's job, and nothing has changed since then. This repo is for a generic, user-configurable YouTrack -> Slack bridge, not some Serokell bot.

Making the bot modular is out of scope for this PR.

This feature is out of scope for this program.

@Lucus16
Copy link
Contributor Author

Lucus16 commented Oct 10, 2018

It seems I, @mkaito and @yorickvP agree that this repo serves us better as a generic Serokell bot. If we have time for it, we can reintroduce separation of concerns using some kind of plugin system, as I mentioned earlier. Merging this.

@Lucus16 Lucus16 merged commit 4c27264 into master Oct 10, 2018
@serokell-bot serokell-bot deleted the deploy branch October 10, 2018 15:03
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

Successfully merging this pull request may close these issues.

None yet

3 participants