Hi Badri,

This 
<https://github.com/gocd/gocd/blob/master/server/src/com/thoughtworks/go/server/messaging/plugin/StageStatusPluginNotifier.java#L48>
 
is the code responsible for sending these notifications out. Just to answer 
your question, currently the notifications get sent when a stage starts 
(regular schedule + reruns) and finishes off, not based on the job 
start/completion. 


>    1. Specifically if a stage has 3 jobs (meant to run in parallel) and 
>    it starts with only two of them running - and the third one starts half 
>    through the execution of the other two, how many notifications will get 
>    sent out?
>
> - Two, assuming the stage completes (ie. all jobs within this stage 
complete - pass/fail doesn't matter)

>
>    1. Similarly, if a stage has three running jobs and they all finish in 
>    a staggered manner one after the other, how many notifications will get 
>    sent?
>
> - One, assuming the stage completes

>
>    1. If a stage with 3 jobs has run once and then is re-run, what would 
>    we expect to see? 
>
> - A total of 4 notifications. Two for the original run, and two for the 
re-run. Assuming the stage completes both the times

Does that help? Do you see some incorrect behavior there?

Cheers,
Jyoti

On Wednesday, 22 March 2017 10:11:20 UTC+5:30, Badri Janakiraman wrote:
>
> Hey Ketan
>
> I would be happy to add to the example data. To help me do so, would you 
> mind letting me know what are the circumstances under which this 
> notification would be sent? 
>
>
>    1. Specifically if a stage has 3 jobs (meant to run in parallel) and 
>    it starts with only two of them running - and the third one starts half 
>    through the execution of the other two, how many notifications will get 
>    sent out?
>    2. Similarly, if a stage has three running jobs and they all finish in 
>    a staggered manner one after the other, how many notifications will get 
>    sent?
>    3. If a stage with 3 jobs has run once and then is re-run, what would 
>    we expect to see?
>
> It would be hard for me to put the system into all these states - so any 
> tips on how to determine this would be very helpful.
>
> Thank you
> - Badri
>  
>
> On Tuesday, March 21, 2017 at 9:01:34 PM UTC-7, Ketan Padegaonkar wrote:
>>
>> Badri,
>>
>> We don't have a schema available (because we don't validate or test 
>> against the schema). But to answer your specific question about the 
>> possible values of the fields —
>>
>> This code 
>> <https://github.com/gocd/gocd/blob/3c001b1d376263e964495723fb76a4771ca8a705/plugin-infra/go-plugin-access/src/com/thoughtworks/go/plugin/access/notification/v2/StageNotificationDTO.java#L137-L147>
>>  is 
>> what is responsible for rendering the stage JSON. It seems like we're 
>> stringifying some 
>> <https://github.com/gocd/gocd/blob/3c001b1d376263e964495723fb76a4771ca8a705/domain/src/com/thoughtworks/go/domain/StageState.java>
>>  
>> enums 
>> <https://github.com/gocd/gocd/blob/3c001b1d376263e964495723fb76a4771ca8a705/domain/src/com/thoughtworks/go/domain/StageResult.java>
>>  
>> from core. Would you mind submitting a PR to improve the documentation?
>>
>>
>> On Wed, Mar 22, 2017 at 5:48 AM Badri Janakiraman <
>> [email protected]> wrote:
>>
>>> Hello
>>>
>>> I am trying to understand a couple of things about the StageStatusChange 
>>> message.
>>>
>>>    1. Does it get sent when a stage starts AND finishes - or is it only 
>>>    sent when one finishes? I assume both - but I wanted to check.
>>>    2. Are there samples for the content and structure of this message 
>>>    for when the stage starts? Or if it gets re-run?
>>>
>>> I noticed that there is an example here: 
>>> https://plugin-api.gocd.io/current/notifications/#stage-status-changed 
>>> - but that seems to be for a simple stage completion for a stage with with 
>>> exactly one job. How can we know what values to expect for the various 
>>> fields like state and status at the stage and job levels? Is this just 
>>> something that we have to run and see? Is there a JSON schema somewhere 
>>> that gives us some information about the expected structure - similar to 
>>> the plugin.xml schema that is published here 
>>> <https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/resources/plugin-descriptor.xsd>
>>> ?
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "go-cd" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to [email protected].
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to