Page MenuHomeDevCentral

Add support for Jenkins notification plug-in
ClosedPublic

Authored by dereckson on Aug 15 2016, 21:13.
Tags
None
Referenced Files
F3766532: D612.diff
Fri, Nov 22, 18:44
Unknown Object (File)
Tue, Nov 12, 23:09
Unknown Object (File)
Tue, Nov 12, 10:47
Unknown Object (File)
Sun, Nov 10, 18:45
Unknown Object (File)
Sun, Nov 10, 16:28
Unknown Object (File)
Sun, Nov 10, 16:14
Unknown Object (File)
Sun, Nov 10, 16:14
Unknown Object (File)
Sun, Nov 10, 11:55
Subscribers

Details

Summary

A Jenkins plugin allow to send a JSON payload to an HTTP end-point:
https://wiki.jenkins-ci.org/display/JENKINS/Notification+Plugin

Support for this payload is added on the newly created Jenkins gate.

This allows to track completed or failed Jenkins job.

In this first iteration, it will sort all the notifications to the
default "ci" group. Plan is to implement in a follow-up change the
mapping between jobs and groups.

Ref T953

Diff Detail

Repository
rNOTIF Notifications center
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

dereckson retitled this revision from to Add support for Jenkins notification plug-in.
dereckson updated this object.
dereckson edited the test plan for this revision. (Show Details)
[2016-08-15 19:22:01] local.ERROR: exception 'ErrorException' with message 'Undefined property: stdClass::$status' in /home/ubuntu/workspace/notifications/app/Notifications/JenkinsNotification.php:48
Stack trace:
#0 /home/ubuntu/workspace/notifications/app/Notifications/JenkinsNotification.php(48): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8, 'Undefined prope...', '/home/ubuntu/wo...', 48, Array)
#1 /home/ubuntu/workspace/notifications/app/Notifications/JenkinsNotification.php(23): Nasqueron\Notifications\Notifications\JenkinsNotification->getText()
#2 /home/ubuntu/workspace/notifications/app/Jobs/FireJenkinsNotification.php(52): Nasqueron\Notifications\Notifications\JenkinsNotification->__construct('Nasqueron', Object(stdClass))
#3 /home/ubuntu/workspace/notifications/app/Jobs/FireJenkinsNotification.php(38): Nasqueron\Notifications\Jobs\FireJenkinsNotification->createNotification()
#4 /home/ubuntu/workspace/notifications/app/Listeners/NotificationListener.php(61): Nasqueron\Notifications\Jobs\FireJenkinsNotification->handle()
#5 [internal function]: Nasqueron\Notifications\Listeners\NotificationListener->onJenkinsPayload(Object(Nasqueron\Notifications\Events\JenkinsPayloadEvent))
#6 /home/ubuntu/workspace/notifications/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(348): call_user_func_array(Array, Array)
#7 [internal function]: Illuminate\Events\Dispatcher->Illuminate\Events\{closure}(Object(Nasqueron\Notifications\Events\JenkinsPayloadEvent))
#8 /home/ubuntu/workspace/notifications/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(221): call_user_func_array(Object(Closure), Array)
#9 /home/ubuntu/workspace/notifications/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(217): Illuminate\Events\Dispatcher->fire(Object(Nasqueron\Notifications\Events\JenkinsPayloadEvent))
#10 /home/ubuntu/workspace/notifications/app/Http/Controllers/Gate/JenkinsGateController.php(84): Illuminate\Support\Facades\Facade::__callStatic('fire', Array)
#11 /home/ubuntu/workspace/notifications/app/Http/Controllers/Gate/JenkinsGateController.php(84): Illuminate\Support\Facades\Event::fire(Object(Nasqueron\Notifications\Events\JenkinsPayloadEvent))
#12 /home/ubuntu/workspace/notifications/app/Http/Controllers/Gate/JenkinsGateController.php(58): Nasqueron\Notifications\Http\Controllers\Gate\JenkinsGateController->onPayload()
#13 [internal function]: Nasqueron\Notifications\Http\Controllers\Gate\JenkinsGateController->onPost('Nasqueron')
#14 /home/ubuntu/workspace/notifications/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(80): call_user_func_array(Array, Array)
#15 /home/ubuntu/workspace/notifications/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(146): Illuminate\Routing\Controller->callAction('onPost', Array)
#16 /home/ubuntu/workspace/notifications/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(94): Illuminate\Routing\ControllerDispatcher->call(Object(Nasqueron\Notifications\Http\Controllers\Gate\JenkinsGateController), Object(Illuminate\Routing\Route), 'onPost')
#17 [internal function]: Illuminate\Routing\ControllerDispatcher->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#18 /home/ubuntu/workspace/notifications/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(52): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#19 [internal function]: Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#20 /home/ubuntu/workspace/notifications/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#21 /home/ubuntu/workspace/notifications/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(96): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#22 /home/ubuntu/workspace/notifications/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(54): Illuminate\Routing\ControllerDispatcher->callWithinStack(Object(Nasqueron\Notifications\Http\Controllers\Gate\JenkinsGateController), Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request), 'onPost')
#23 /home/ubuntu/workspace/notifications/vendor/laravel/framework/src/Illuminate/Routing/Route.php(174): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request), 'Nasqueron\\Notif...', 'onPost')
#24 /home/ubuntu/workspace/notifications/vendor/laravel/framework/src/Illuminate/Routing/Route.php(140): Illuminate\Routing\Route->runController(Object(Illuminate\Http\Request))
#25 /home/ubuntu/workspace/notifications/vendor/laravel/framework/src/Illuminate/Routing/Router.php(724): Illuminate\Routing\Route->run(Object(Illuminate\Http\Request))
#26 [internal function]: Illuminate\Routing\Router->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#27 /home/ubuntu/workspace/notifications/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(52): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#28 [internal function]: Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#29 /home/ubuntu/workspace/notifications/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#30 /home/ubuntu/workspace/notifications/vendor/laravel/framework/src/Illuminate/Routing/Router.php(726): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#31 /home/ubuntu/workspace/notifications/vendor/laravel/framework/src/Illuminate/Routing/Router.php(699): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#32 /home/ubuntu/workspace/notifications/vendor/laravel/framework/src/Illuminate/Routing/Router.php(675): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#33 /home/ubuntu/workspace/notifications/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(246): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#34 [internal function]: Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request))
#35 /home/ubuntu/workspace/notifications/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(52): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#36 /home/ubuntu/workspace/notifications/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(64): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#37 [internal function]: Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle(Object(Illuminate\Http\Request), Object(Closure))
#38 /home/ubuntu/workspace/notifications/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(136): call_user_func_array(Array, Array)
#39 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#40 /home/ubuntu/workspace/notifications/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#41 /home/ubuntu/workspace/notifications/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#42 [internal function]: Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#43 /home/ubuntu/workspace/notifications/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(136): call_user_func_array(Array, Array)
#44 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#45 /home/ubuntu/workspace/notifications/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#46 /home/ubuntu/workspace/notifications/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(64): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#47 [internal function]: Illuminate\Session\Middleware\StartSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#48 /home/ubuntu/workspace/notifications/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(136): call_user_func_array(Array, Array)
#49 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#50 /home/ubuntu/workspace/notifications/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#51 /home/ubuntu/workspace/notifications/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#52 [internal function]: Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(Object(Illuminate\Http\Request), Object(Closure))
#53 /home/ubuntu/workspace/notifications/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(136): call_user_func_array(Array, Array)
#54 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#55 /home/ubuntu/workspace/notifications/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#56 /home/ubuntu/workspace/notifications/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(59): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#57 [internal function]: Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure))
#58 /home/ubuntu/workspace/notifications/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(136): call_user_func_array(Array, Array)
#59 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#60 /home/ubuntu/workspace/notifications/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#61 /home/ubuntu/workspace/notifications/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(44): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#62 [internal function]: Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))
#63 /home/ubuntu/workspace/notifications/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(136): call_user_func_array(Array, Array)
#64 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#65 /home/ubuntu/workspace/notifications/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#66 [internal function]: Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#67 /home/ubuntu/workspace/notifications/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#68 /home/ubuntu/workspace/notifications/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(132): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#69 /home/ubuntu/workspace/notifications/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(99): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#70 /home/ubuntu/workspace/notifications/public/index.php(54): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#71 {main}

Fix issue when status is absent, like for job started notifications.

This revision is now accepted and ready to land.Aug 20 2016, 01:03
dereckson edited edge metadata.

Rebased. More doc.

This revision was automatically updated to reflect the committed changes.

Failure was CI infrastructure related (timeout during an operation defined in Composer post update script).

Post-merge build is GREEN.

https://ci.nasqueron.org/job/test-notifications-php/156/

https://ci.nasqueron.org/job/test-notifications-php/156/console