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

Adding in slack-token to flags #428

Closed
wants to merge 2 commits into from
Closed

Adding in slack-token to flags #428

wants to merge 2 commits into from

Conversation

jacobfoard
Copy link

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

@codecov
Copy link

codecov bot commented Jan 15, 2019

Codecov Report

Merging #428 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #428   +/-   ##
=======================================
  Coverage   70.78%   70.78%           
=======================================
  Files          63       63           
  Lines        3987     3987           
=======================================
  Hits         2822     2822           
  Misses        970      970           
  Partials      195      195
Impacted Files Coverage Δ
cmd/server.go 78.94% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c0b89d9...142c6a2. Read the comment docs.

cmd/server.go Outdated Show resolved Hide resolved
@@ -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
Copy link
Author

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

Copy link
Member

Choose a reason for hiding this comment

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

good catch! 🍺

@lkysow
Copy link
Member

lkysow commented Jan 17, 2019

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 Show resolved Hide resolved
cmd/server.go Outdated Show resolved Hide resolved
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",
Copy link
Member

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.

Copy link
Author

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.

@lkysow
Copy link
Member

lkysow commented Jan 17, 2019

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.

@jacobfoard
Copy link
Author

Yea, I rebased in the cli not sure what's the issue. I'll get it fixed shortly.

@jacobfoard
Copy link
Author

Alright, sorry about that. Learned a lot about git today. I've rebased and reordered.

Equals(t, "override-cert-file", passedConfig.SSLCertFile)
Equals(t, "override-key-file", passedConfig.SSLKeyFile)
Equals(t, "override-my-token", passedConfig.TFEToken)

Copy link

Choose a reason for hiding this comment

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

This newline required?

Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change

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"
Copy link
Member

@lkysow lkysow Jan 22, 2019

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.

Suggested change
homedir "github.com/mitchellh/go-homedir"
"github.com/mitchellh/go-homedir"

Copy link
Member

@lkysow lkysow left a 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
Copy link
Member

Choose a reason for hiding this comment

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

good catch! 🍺

Equals(t, "override-cert-file", passedConfig.SSLCertFile)
Equals(t, "override-key-file", passedConfig.SSLKeyFile)
Equals(t, "override-my-token", passedConfig.TFEToken)

Copy link
Member

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",
Copy link
Member

Choose a reason for hiding this comment

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

Can this read:

Suggested change
description: "API token required for Slack notification integration",
description: "API token for Slack notifications.",

Equals(t, "override-cert-file", passedConfig.SSLCertFile)
Equals(t, "override-key-file", passedConfig.SSLKeyFile)
Equals(t, "override-my-token", passedConfig.TFEToken)

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change

@lkysow
Copy link
Member

lkysow commented Jan 22, 2019

I would suggest a rebase again 😄

@jacobfoard
Copy link
Author

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.

Jacob Foard and others added 2 commits January 22, 2019 14:51
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>
@lkysow lkysow mentioned this pull request Jan 23, 2019
@lkysow lkysow closed this in #442 Jan 23, 2019
@lkysow
Copy link
Member

lkysow commented Jan 23, 2019

Thanks! I've merged this via #442.

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