-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/47440/#review136169
-----------------------------------------------------------




docs/features/webhooks.md (line 1)
<https://reviews.apache.org/r/47440/#comment201186>

    Please add a reference to this file in `docs/README.md`



docs/features/webhooks.md (line 8)
<https://reviews.apache.org/r/47440/#comment201187>

    Please also add an example event payload that one would receive via a post 
request.



src/main/java/org/apache/aurora/scheduler/events/Webhook.java (lines 71 - 73)
<https://reviews.apache.org/r/47440/#comment201188>

    Seeing the code spelled out here, this looks kind of complicated.
    
    I believe you can make the code more obvious if you don't do any error 
handling within `initializeConnection` but instead just let the exceptions 
bubble-up and handle them in the first `try`-block in `callEndpoint`. You might 
even consider merging all try-blocks into just a single one.



src/main/java/org/apache/aurora/scheduler/events/Webhook.java (line 82)
<https://reviews.apache.org/r/47440/#comment201189>

    According to the docs, `getErrorStream` _may_ return `null`, so we need a 
guard here. 
https://docs.oracle.com/javase/7/docs/api/java/net/HttpURLConnection.html#getErrorStream()



src/main/resources/org/apache/aurora/scheduler/webhook.json (lines 1 - 8)
<https://reviews.apache.org/r/47440/#comment201191>

    I still think we should get rid of that file. It is not really a usuable by 
default for anyone, shipping it in our source and binary distribution therefore 
does not make much sense.



src/test/java/org/apache/aurora/scheduler/events/WebhookTest.java (lines 52 - 
65)
<https://reviews.apache.org/r/47440/#comment201195>

    I have to admit, that I don't really understand what those tests are 
_actually_ asserting, especially given the coarse-grained `try-catch`-clauses 
in the code. 
    
    Personally, I would have opted to start a proper webserver within my test 
that actually asserts data is received as requested.  I have never done this in 
Java, but it seems possible (for example with Jetty): 
https://stackoverflow.com/questions/29758607/how-to-run-jetty-server-for-java-junit-testing


- Stephan Erb


On June 4, 2016, 1:54 a.m., Dmitriy Shirchenko wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/47440/
> -----------------------------------------------------------
> 
> (Updated June 4, 2016, 1:54 a.m.)
> 
> 
> Review request for Aurora, Maxim Khutornenko and Stephan Erb.
> 
> 
> 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
> -----
> 
>   RELEASE-NOTES.md 21a141f1acadfdaa94247b75de2f734b11868137 
>   docs/features/webhooks.md PRE-CREATION 
>   docs/reference/scheduler-configuration.md 
> f7d676d0ed6bc536f4341dbb9365cf50e8607efb 
>   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
> 
>

Reply via email to