-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: playbooks #499
feat: playbooks #499
Conversation
[skip ci]
minutes. * Improve error message on incorrect params [skip ci]
[skip ci]
[skip ci]
playbook run. [skip ci]
@moshloop This is ready for review now.
|
@moshloop @yashmehrotra I've added a new application level error struct that can be easily mapped to HTTP errors. It was kind of necessary for me right now so I've added it in this PR itself. It's pretty much a copy of https://github.com/benbjohnson/wtf/blob/main/error.go with some minor changes. |
[skip ci]
[skip ci]
}) | ||
|
||
ginkgo.It("should store playbook run via API", func() { | ||
run := RunParams{ |
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 think it is necessary to call these functions via HTTP - we can all the functions directly
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.
Everything about saving a playbook run is handled by the HTTP handler. The actual task is simply to save to DB and the handler performs other validation on top of that.
I think its better to test the handler this way than just directly saving to db from the test.
|
||
func (t *queueConsumer) Listen() error { | ||
pgNotify := make(chan string) | ||
go utils.ListenToPostgresNotify(t.pool, "playbook_run_updates", t.dbReconnectMaxDuration, t.dbReconnectBackoffBaseDuration, pgNotify) |
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 move this method to the QueueConsumer .e.g
t.PgListen("playbook_spec_approval", approvalUpdated)
No description provided.