-
Notifications
You must be signed in to change notification settings - Fork 8
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
Stack execution progress #81
Conversation
Please resolve conflicts first and attach some screens if possible. :) |
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.
LGTM 👍, minor remarks.
main.go
Outdated
@@ -77,4 +78,14 @@ func main() { | |||
stack.DestroyStack(&context) | |||
os.Exit(0) | |||
} | |||
|
|||
if *context.CliArguments.Mode == cliparser.SetupSinkMode { | |||
notificationservice.ConfigureRemoteSink(&context) |
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'd rename it to notifications
or progress
.
notificationservice/notification.go
Outdated
TopicArn *string | ||
} | ||
|
||
var sinkName = "Perun-sink-" |
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.
Start with a small letter.
notificationservice/notification.go
Outdated
shouldSNSTopicBeRemoved := snsTopicExists && !sqsQueueExists | ||
err = conn.deleteRemainingSinkResources(shouldSNSTopicBeRemoved, false) | ||
if err != nil { | ||
println("error deleting up remote sink", err.Error()) |
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.
Let's use logger for errors everywhere in that review.
notificationservice/notification.go
Outdated
|
||
if err == nil { | ||
context.Logger.Info("Remote sink configuration successful") | ||
context.Logger.Info("Remote Sink configuration may take up to 2 minutes, wait before calling 'create-stack' with flag --progress") |
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.
Replate Remote Sink configuration
with It
if it is displayed one after another.
And even better - use warning for that.
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.
Let's add it then. ;)
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 believe our logger does not have a warning type
notificationservice/notification.go
Outdated
} | ||
} | ||
|
||
// Remove all AwS Resources created for stack monitoring |
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.
AwS
-> AWS
.
notificationservice/notification.go
Outdated
conn.context.Logger.Error("error reading json message" + err.Error()) | ||
} | ||
|
||
//DELETE READ MESSAGE (to prevent reading the same message multiple times) |
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.
Missing space after //
.
notificationservice/notification.go
Outdated
messageMap[messages[0]] = messages[1] | ||
} | ||
// Parse timestamp of message | ||
messageArrivedTime, err := time.Parse("2006-01-02T15:04:05.000Z", v.Timestamp) |
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.
Is it possible to name that date and time format with some meaningful name as a constant?
notificationservice/notification.go
Outdated
} | ||
|
||
func (conn *Connection) createJsonPolicy() (jsonStringPolicy string, err error) { | ||
|
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.
Superfluous empty line.
notificationservice/notification.go
Outdated
return | ||
} | ||
|
||
func (conn *Connection) deleteSnsTopic() (err error) { |
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 don't see deleting a policy here - is it taken care when deleting SQS queue?
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.
Those are parameters of the SQS queue, the policy itself is not created - only set up as an attribute of the SQS queue.
One more thing: please create a new branch from current |
README.md
Outdated
|
||
To destroy remote sink just type: | ||
|
||
``~ $ perun destroy-remote-sink`` |
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.
Use triple backticks and new lines always.
README.md
Outdated
##### Remote sink | ||
To setup remote sink type: | ||
|
||
```~ $ perun setup-remote-sink``` |
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.
Use newlines inside code blocks.
cliparser/cliparser.go
Outdated
@@ -91,7 +91,7 @@ func ParseCliArguments(args []string) (cliArguments CliArguments, err error) { | |||
deleteStack = app.Command(DestroyStackMode, "Deletes a stack on aws") | |||
deleteStackName = deleteStack.Arg("stack", "An AWS stack name.").Required().String() | |||
|
|||
setupSink = app.Command(SetupSinkMode, "Sets up resources required for progress report on stack events (SNS Topic, SQS Queue)") | |||
setupSink = app.Command(SetupSinkMode, "Sets up resources required for progress report on stack events (SNS Topic, SQS Queue and SQSQueue Policy)") |
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.
SQSQueue
-> SQS Queue
.
Added support for SNS and SQS notifications - remote sink creation and deletion. Untested Stack Execution Progress #17 Added setup/destroy remote sink for creation of required resources Stack Execution Progress #17 Added Table with Tablewriter Stack Execution Progress #17 Added Table Printing Stack Execution Progress #17 Added verification for current process stack messages and auto close Stack Execution Progress #17 Fixed Pull request issues Stack Execution Progress #17 Fixed Pull request issues
c9f8b88
to
7b5fedc
Compare
This closes #17.