-
Notifications
You must be signed in to change notification settings - Fork 26
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 approval service listener #168
Add approval service listener #168
Conversation
@lindgrenj6 please review |
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.
Waiting for specs to submit full review
35fd5de
to
9006c0d
Compare
9006c0d
to
c580166
Compare
edb5064
to
97d9de4
Compare
d697ec3
to
d988ac7
Compare
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.
Looks good to me 👍
d988ac7
to
f97698a
Compare
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!
require "bundler/setup" | ||
require "approval_request_listener" | ||
|
||
queue_host = ENV["QUEUE_HOST"] || "localhost" |
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.
@syncrou can these 4 lines be wrapped into a function and reused here and in config/initializers/approval_request_listener maybe as a class method
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.
In this case it would only be queue_host
and queue_port
which should be moved to a generic place where all environmental variables are set. We have the same problem with the service order listener. I created this #174 to handle that in a future PR.
f97698a
to
68cb4f1
Compare
Handle denied and approved requests Add specs around the listener
cff7658
to
9adc58c
Compare
@@ -40,7 +40,7 @@ def set_defaults | |||
end | |||
|
|||
def update_message(level, message) | |||
self.updated_at = DateTime.now | |||
self.updated_at = Time.zone.now |
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.
@syncrou This should be in GMT correct?
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.
It will be if we set the rails app config default time to UTC
That's what the zone
method does.
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.
Though it may be that by default.
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.
Yeah, default is UTC - http://patrikonrails.com/posts/2
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.
Shouldn't the update_at
field get updated automatically at record saving time?
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.
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.
We need to account for errors and tenancy which can be done in a separate PR.
@@ -40,7 +40,7 @@ def set_defaults | |||
end | |||
|
|||
def update_message(level, message) | |||
self.updated_at = DateTime.now | |||
self.updated_at = Time.zone.now |
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.
Shouldn't the update_at
field get updated automatically at record saving time?
9adc58c
to
11db84e
Compare
f606cb6
to
6adbdc6
Compare
A progress message only has value if there is an order attached to it Since we have now order we are now logging the full payload to the logger so we would have the data available to us in case there was no record found with the request id in ApprovalRequest
6adbdc6
to
9846d10
Compare
Checked commits syncrou/catalog-api@2cb1cc9~...9846d10 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
…onsole-errors Fix tests console errors.
Adds the Approval Request Listener including a bin file for development environments.
Kafka Published Topics (Events) Are as follows: ( at create of the request )
When the request is approved