----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/47440/#review134264 -----------------------------------------------------------
LGTM overall. Some notes below and some quetions to Maxim as I don't feel qualified to review certain bits of this patch. In addition, would be great if you could add: * an entry to the release notes * a minimal `docs/features/webhooks.md` that shows a valid webhook config and how a dispatched event would look like. docs/reference/scheduler-configuration.md (line 222) <https://reviews.apache.org/r/47440/#comment198975> How about something like: "File to configure a HTTP webhook to receive task state change events." src/main/java/org/apache/aurora/scheduler/events/Webhook.java (line 46) <https://reviews.apache.org/r/47440/#comment198977> I'd favor if this method returns the `HttpURLConnection` rather than using a mutable class member. src/main/java/org/apache/aurora/scheduler/events/Webhook.java (line 59) <https://reviews.apache.org/r/47440/#comment198980> Is this some Kafka specific header? It does not seem to be default HTTP header (https://en.wikipedia.org/wiki/List_of_HTTP_header_fields) Before we invent custom ones, I think we should rather stick the timestamp into json playload. src/main/java/org/apache/aurora/scheduler/events/Webhook.java (line 60) <https://reviews.apache.org/r/47440/#comment198979> Reading https://docs.oracle.com/javase/6/docs/technotes/guides/net/http-keepalive.html I am not sure if this is necessary: "The support for HTTP keep-Alive is done transparently. However, it can be controlled by system properties http.keepAlive, and http.maxConnections, as well as by HTTP/1.1 specified request and response headers." In anycase, shouldn't that be `keep-alive`? AFAIK only the head field name is case-insensitive, but not the value. src/main/java/org/apache/aurora/scheduler/events/WebhookInfo.java (line 42) <https://reviews.apache.org/r/47440/#comment198976> `requireNonNull` returns the input object if it is non-null. You can therefore place it on the same line as your assignment. src/main/java/org/apache/aurora/scheduler/events/WebhookModule.java (line 45) <https://reviews.apache.org/r/47440/#comment198981> I'd vote to drop the file here and rather move it to test and/or documentation. src/main/java/org/apache/aurora/scheduler/events/WebhookModule.java (line 73) <https://reviews.apache.org/r/47440/#comment198978> Maxim, is this the correct way to do it? Don't we normally throw in a `bind(XXX.class).in(Singleton.class)`? Or is this not necessary here because we are using `toInstance`? src/test/java/org/apache/aurora/scheduler/events/WebhookTest.java (line 28) <https://reviews.apache.org/r/47440/#comment198982> I have the impression that both `testTaskChangedState` and `testCallEndpoint` are not properly exercicing the actual webhook class. Maxim, what do you think? Maybe an e2e test would be the best course of action here. - Stephan Erb On May 19, 2016, 4:16 a.m., Dmitriy Shirchenko wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/47440/ > ----------------------------------------------------------- > > (Updated May 19, 2016, 4:16 a.m.) > > > Review request for Aurora. > > > Bugs: AURORA-1683 > https://issues.apache.org/jira/browse/AURORA-1683 > > > Repository: aurora > > > Description > ------- > > Looking for some feedback whether I'm on the correct path in adding a > webhook. All comments are welcome! > > > Diffs > ----- > > docs/reference/scheduler-configuration.md > f7d676d0ed6bc536f4341dbb9365cf50e8607efb > examples/vagrant/upstart/aurora-scheduler.conf > 3d9e706de564df5e24cb34265bebc0db1cad11a0 > src/main/java/org/apache/aurora/scheduler/app/SchedulerMain.java > 9ebfe230836e88a97bc60092373f72f176a8f6f2 > src/main/java/org/apache/aurora/scheduler/events/PubsubEvent.java > 2a4c0665e48d30e0655de00bd7f6f9b49f01eafc > src/main/java/org/apache/aurora/scheduler/events/Webhook.java PRE-CREATION > src/main/java/org/apache/aurora/scheduler/events/WebhookInfo.java > PRE-CREATION > src/main/java/org/apache/aurora/scheduler/events/WebhookModule.java > PRE-CREATION > src/main/resources/org/apache/aurora/scheduler/webhook.json PRE-CREATION > src/test/java/org/apache/aurora/scheduler/events/WebhookTest.java > PRE-CREATION > > Diff: https://reviews.apache.org/r/47440/diff/ > > > Testing > ------- > > Need to fix tests. > > > Thanks, > > Dmitriy Shirchenko > >