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
Adding in slack-token to flags #428
Conversation
Codecov Report
@@ Coverage Diff @@
## master #428 +/- ##
=======================================
Coverage 70.78% 70.78%
=======================================
Files 63 63
Lines 3987 3987
=======================================
Hits 2822 2822
Misses 970 970
Partials 195 195
Continue to review full report at Codecov.
|
@@ -565,7 +570,8 @@ repo-whitelist: "github.com/runatlantis/atlantis" | |||
require-approval: true | |||
ssl-cert-file: cert-file | |||
ssl-key-file: key-file | |||
ssl-key-file: my-token | |||
tfe-token: my-token |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this was a botched copy paste, and updated it accordingly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch! 🍺
Thanks for the pull request! Please rebase off of master since you've got some changes deleting tfe-token stuff that should not be in here. Also please fix your vscode import changes. |
cmd/server.go
Outdated
@@ -174,6 +175,10 @@ var stringFlags = []stringFlag{ | |||
" Only set if using TFE as a backend." + | |||
" Should be specified via the ATLANTIS_TFE_TOKEN environment variable for security.", | |||
}, | |||
{ | |||
name: SlackTokenFlag, | |||
description: "API token required for Slack webhook integration", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What kind of API token is required? I forget.
I wouldn't say "slack webhook" because it's a slack notification, not a webhook.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a "bot" token, and I've reworded it. Probably worth putting in an another PR for #42 though.
I think you need to rebase? The PR has 15 commits now and is showing changes that are already on master. You should have one commit and the GitHub UI should show just your changes. |
Yea, I rebased in the cli not sure what's the issue. I'll get it fixed shortly. |
Alright, sorry about that. Learned a lot about git today. I've rebased and reordered. |
cmd/server_test.go
Outdated
Equals(t, "override-cert-file", passedConfig.SSLCertFile) | ||
Equals(t, "override-key-file", passedConfig.SSLKeyFile) | ||
Equals(t, "override-my-token", passedConfig.TFEToken) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This newline required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think not, please remove.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cmd/server.go
Outdated
@@ -22,7 +22,7 @@ import ( | |||
|
|||
"github.com/runatlantis/atlantis/server/logging" | |||
|
|||
"github.com/mitchellh/go-homedir" | |||
homedir "github.com/mitchellh/go-homedir" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't make this change.
homedir "github.com/mitchellh/go-homedir" | |
"github.com/mitchellh/go-homedir" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Glad you figured out your git issues, those can be thorny sometimes (https://xkcd.com/1597/).
I've got a couple comments I'd like addressed.
@@ -565,7 +570,8 @@ repo-whitelist: "github.com/runatlantis/atlantis" | |||
require-approval: true | |||
ssl-cert-file: cert-file | |||
ssl-key-file: key-file | |||
ssl-key-file: my-token | |||
tfe-token: my-token |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch! 🍺
cmd/server_test.go
Outdated
Equals(t, "override-cert-file", passedConfig.SSLCertFile) | ||
Equals(t, "override-key-file", passedConfig.SSLKeyFile) | ||
Equals(t, "override-my-token", passedConfig.TFEToken) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think not, please remove.
cmd/server.go
Outdated
@@ -172,6 +173,10 @@ var stringFlags = []stringFlag{ | |||
"all repos: '*' (not recommended), an entire hostname: 'internalgithub.com/*' or an organization: 'github.com/runatlantis/*'." + | |||
" For Bitbucket Server, {hostname} is the domain without scheme and port, {owner} is the name of the project (not the key), and {repo} is the repo name.", | |||
}, | |||
{ | |||
name: SlackTokenFlag, | |||
description: "API token required for Slack notification integration", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this read:
description: "API token required for Slack notification integration", | |
description: "API token for Slack notifications.", |
cmd/server_test.go
Outdated
Equals(t, "override-cert-file", passedConfig.SSLCertFile) | ||
Equals(t, "override-key-file", passedConfig.SSLKeyFile) | ||
Equals(t, "override-my-token", passedConfig.TFEToken) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest a rebase again 😄 |
I think I've gotten all of the fixes in place, give me a few to battle git again and I'll get it rebased. |
Signed-off-by: Jacob Foard <jacob.foard@formation.ai> Adding in tests, fixing tfe-override for one test Signed-off-by: Jacob Foard <jacob.foard@formation.ai> Alphabetizing config + config tests, removing homedir alias Signed-off-by: Jacob Foard <jacob.foard@formation.ai> Reordering Signed-off-by: Jacob Foard <jacob.foard@formation.ai> Fixing homedir alias Signed-off-by: Jacob Foard <jacob.foard@formation.ai> Fixing slack flag wording, and new lines. With vim this time so I don't have to keep editing the homedir alias Signed-off-by: Jacob Foard <jacob.foard@formation.ai>
Thanks! I've merged this via #442. |
In my testing of the slack functionality, I found I was able to specify the token via the config.yaml, but the env var/flag wasn't working. This allow env/flag/config to work as the rest of the flags do.
Signed-off-by: Jacob Foard jacob.foard@formation.ai