From e7641ba5cb936790660fc3db6c2e610d3e17a46f Mon Sep 17 00:00:00 2001 From: Yorda Date: Sat, 3 Sep 2022 10:12:00 -0600 Subject: [PATCH] Slack Notification Channel (#10) * Added slack notification channel. * Updated readme. *Added screenshots. --- README.md | 31 +-- config/querywatcher.php | 4 + content/slack_notification_console.png | Bin 0 -> 13568 bytes content/slack_notification_request.png | Bin 0 -> 25407 bytes src/Services/ChannelService.php | 2 + .../NotificationStrategy/Channels/Slack.php | 202 ++++++++++++++++++ .../Services/ChannelServiceTest.php | 4 +- tests/Unit/Strategies/Channels/SlackTest.php | 58 +++++ 8 files changed, 287 insertions(+), 14 deletions(-) create mode 100644 content/slack_notification_console.png create mode 100644 content/slack_notification_request.png create mode 100644 src/Strategies/NotificationStrategy/Channels/Slack.php create mode 100644 tests/Unit/Strategies/Channels/SlackTest.php diff --git a/README.md b/README.md index a88c03d..b47d386 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,10 @@ Adjust the configuration file to suite your application. 'enabled' => false, // Do you want discord webhook notifications? 'hook' => env('DISCORD_HOOK', 'please_fill_me_in'), ], + 'slack' => [ + 'enabled' => false, // Do you want Slack webhook notifications? + 'hook' => env('SLACK_HOOK', 'please_fill_me_in'), + ], ] ] ``` @@ -112,6 +116,17 @@ applications [broadcast configuration](https://laravel.com/docs/9.x/broadcasting } ``` +### Slack Notification Channel + +To utilize Slack Notifications, you will need to [create a webhook](https://api.slack.com/messaging/webhooks#create_a_webhook) for one of your Slack Channels. Once you have your +webhook url, add the following variable to your .env file. + +```dotenv +SLACK_HOOK= +``` + +Once you have done this, you can enable Slack Notifications in the configuration file. + ### Discord Notification Channel Get a webhook URL from discord in the channel you want to receive your notifications in by @@ -124,20 +139,10 @@ DISCORD_HOOK= Once you have done this, you can enable Discord Notifications in the configuration file. -### Screenshots - -
- - Logo - -
-
-
- - Logo - -
+### Wiki Documentation +- [Notification Channels Wiki](https://github.com/YorCreative/Laravel-Query-Watcher/wiki/Notification-Channels) +- [Screenshots](https://github.com/YorCreative/Laravel-Query-Watcher/wiki/Screenshots) ## Testing ```bash diff --git a/config/querywatcher.php b/config/querywatcher.php index 274994e..8137a5c 100644 --- a/config/querywatcher.php +++ b/config/querywatcher.php @@ -34,5 +34,9 @@ 'enabled' => false, 'hook' => env('DISCORD_HOOK', 'placeholder'), ], + 'slack' => [ + 'enabled' => false, + 'hook' => env('SLACK_HOOK', 'placeholder'), + ], ], ]; diff --git a/content/slack_notification_console.png b/content/slack_notification_console.png new file mode 100644 index 0000000000000000000000000000000000000000..258bd190075ca38006bd266c6365a51fe2d88ef8 GIT binary patch literal 13568 zcmc(GWmH_03lD9t_u1dC@8o+e-1#uONk{4%8Ob>8A&Z)ll`212P*yC!%OgI*A@9H z@MZD2Ciwx5A3!mt zCnse%^{t`;q7!I~<@DlNQa8?z8rg$qJ#|t=xQkH&Y?o&?__O4_TEm^kB&!xAJ-DiZ zYKm&=XI|eDxI@%KVrn!@$DPMV7&1Mg;;m@DS9=@Umd{NrHjKwb@WF*a{i7F-$Kqe8 zj{VhAmJ;90w1!nCI-<`Q?p$3u*ng|wxbT=*xa?o~J%`oA3M)I&Ha-a5Y(HqbFug2i z*`eZ^zqu;zSjjDM*`CjSWY|z=b-vmmWD;`VEJ*qMvxcP2!23@eGL(=n-%=*h=IjUj z6v8~-*_kc6?Fp7RaIauz9L}!|m%;iTu9ZKlxdt(AT*DA@+`PnQnkI8Rbc@+@Wz||2 z3fbJ0bYpn&L?5hwMlb=fz120YBN~Ka`PZ!K7$=jN1G295ASqA<8Os^HX;Thd$^rCE ztzPokr-+qBBdmp=%EPig77CXpGWIW(>n_ZxHnWbM9sODSMU6tZ5gZ!V-4~!30o&!c zp;Yf)x2WtWnNF4op5$z4&ylz>gA&xaz~j7Qf!|>q`JWVLzH^uS7Swthv_5DR22_b| zeXYqKs(?r2DT!wY8XY*Huslpv57O&uyEG_L&z~3pC1=a9Ri(C7*5`e67HCaCuqwaD z9*T9JX(&}-^cRjnv0!`K7dqcag29vEM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R*Ef&R=C4!Ru8YYJR>SjBCvNa&taPj( z^Fd6`2g1H*0SryzVqfIpj*x5K`i>h~u&!+LC7ro4hTGO0onP(MkuF!@`5ayK!xgNg zDP*TJ=I*{CHf-KybEQ~T>#jDplg#~hM&j^XULid~d;SXHkUaY3P`p>|{!_7~$dd;> zAILf3%HYA#+m#=iRU5l7uo0WY1cXiZ`X)+ToWRKsnyxt+TpD}&J7*=~{urG)aQ!VC z?eAUrfrs_O6dB}7JTQ)OwOMDPJhZ&sxqU9AZAxPLfJ?VTQrmIlEXYHEd_Xx&SG0-; zEsD^5t&A!NmyEZmg4D{-1S&`b>mjz?U0mrP(TLhn#^RYVHpkin-MyGVtk9^q^N)pm z*ky7IvM>1_G^!YV;j>aQM_9$hSeue`%Gk9XXaTI7b(6;kl$WbxfZU1&d@@mLvj_|s z>r4XI-&uK5mffQ7{XW5+nbnvdPe-Z z`)X~D&R4_a+HEGQ;BN3%dk=k*pntFv{8WTX)KL~l{XURl6i=8DNHd3a0XxqS;H7z` ziEKH5p6?$JmH$@pG=I34E)S?1y177MmOZ4O@Kzf=@xNg1q-NN{Miby+#b3R=)qC&* z~l1MJ37W;0PrnBtT02&e&zG0$*T-2j{Am?8CASrB@6>Mla7JT z@bOdV`3Np8SCz#>)DMdgas8lQ=`^feE+%ibu)V&yKv9C(85K49$9cN)f^mbPnhOv8 z;OhJPC||;9hJFIBW7#eq33mWe6y|M4>3ldnJbL$ekWTSh6vA{5wh=j89n9%vZv*|^%E`~6)*EnhqU%2hL_4uEB#VqP7@Rk$|JWMv>5EU>uB|rvxV+sWgQF#8z7o5z;{WF;)@><<-OVj)`MYXx^NdAgyAV20mC3BE(OJX zeaQKQz>N@_CEmDPaG!z literal 0 HcmV?d00001 diff --git a/content/slack_notification_request.png b/content/slack_notification_request.png new file mode 100644 index 0000000000000000000000000000000000000000..0c57ea82825824f458cf4e86b0ca478abe45869a GIT binary patch literal 25407 zcmd431yGz_v?baJB%~og@BqPrdxE=bV~x863GVI*L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NQNo^6 zONZ3>yYFvO`SpBBxz|=1YsDF@?cY-d99 zwYc(Q(hiMdJX-8Fi9ukN9*M@(zkYa-@1um({hZ*PuKwr!ubn}YISKz!lEN|YsSHPC XugO5sXZnFc;hNLOU5?c_Tuk^cZ+keM literal 0 HcmV?d00001 diff --git a/src/Services/ChannelService.php b/src/Services/ChannelService.php index 8cef5f8..83f9139 100644 --- a/src/Services/ChannelService.php +++ b/src/Services/ChannelService.php @@ -5,6 +5,7 @@ use Illuminate\Support\Collection; use YorCreative\QueryWatcher\Models\QueryModel; use YorCreative\QueryWatcher\Strategies\NotificationStrategy\Channels\Discord; +use YorCreative\QueryWatcher\Strategies\NotificationStrategy\Channels\Slack; use YorCreative\QueryWatcher\Strategies\NotificationStrategy\NotificationStrategy; class ChannelService @@ -32,6 +33,7 @@ protected static function getChannels(): Collection { return new Collection([ new Discord(), + new Slack(), ]); } } diff --git a/src/Strategies/NotificationStrategy/Channels/Slack.php b/src/Strategies/NotificationStrategy/Channels/Slack.php new file mode 100644 index 0000000..0c6e3ef --- /dev/null +++ b/src/Strategies/NotificationStrategy/Channels/Slack.php @@ -0,0 +1,202 @@ +buildCoreBaseEnrichment($model); + + // Contextual Information + if ($model->trigger['action'] == 'Console') { + $payload['blocks'] = $this->buildConsoleEnrichment($payload['blocks']); + } else { + $payload['blocks'] = $this->buildRequestEnrichment($payload['blocks'], $model); + } + + // Fire off hook + Http::retry(3)->contentType('application/json')->post(config('querywatcher.channels.slack.hook'), $payload); + } + + /** + * @note Slack Block Builder Reference + * https://app.slack.com/block-kit-builder + * + * If you would like to improve your Slack message, see the block kit builder. + */ + + /** + * @param QueryModel $model + * @return \array[][] + */ + protected function buildCoreBaseEnrichment(QueryModel $model): array + { + return [ + 'blocks' => [ + [ + 'type' => 'divider', + ], + [ + 'type' => 'header', + 'text' => [ + 'type' => 'plain_text', + 'text' => 'Captured Query', + ], + ], + [ + 'type' => 'section', + 'text' => [ + 'type' => 'plain_text', + 'text' => $model->sql, + ], + ], + [ + 'type' => 'header', + 'text' => [ + 'type' => 'plain_text', + 'text' => 'Query Bindings', + ], + ], + [ + 'type' => 'section', + 'text' => [ + 'type' => 'plain_text', + 'text' => json_encode($model->getBindings()), + ], + ], + [ + 'type' => 'header', + 'text' => [ + 'type' => 'plain_text', + 'text' => 'Execution Time', + ], + ], + [ + 'type' => 'section', + 'text' => [ + 'type' => 'plain_text', + 'text' => json_encode($model->time).' ms', + ], + ], + [ + 'type' => 'header', + 'text' => [ + 'type' => 'plain_text', + 'text' => 'Connection', + ], + ], + [ + 'type' => 'section', + 'text' => [ + 'type' => 'plain_text', + 'text' => $model->connection, + ], + ], + ], + ]; + } + + /** + * @param array $payload + * @return array + */ + protected function buildConsoleEnrichment(array $payload): array + { + return array_merge($payload, [ + [ + 'type' => 'header', + 'text' => [ + 'type' => 'plain_text', + 'text' => 'Contextual Information', + ], + ], + [ + 'type' => 'context', + 'elements' => [ + [ + 'type' => 'mrkdwn', + 'text' => '*Trigger:* Console', + ], + ], + ], + ]); + } + + /** + * @param array $payload + * @param QueryModel $model + * @return array + */ + protected function buildRequestEnrichment(array $payload, QueryModel $model): array + { + return array_merge($payload, [ + [ + 'type' => 'header', + 'text' => [ + 'type' => 'plain_text', + 'text' => 'Contextual Information', + ], + ], + [ + 'type' => 'context', + 'elements' => [ + [ + 'type' => 'mrkdwn', + 'text' => '*Trigger:* '.$model->trigger['action'], + ], + ], + ], + [ + 'type' => 'context', + 'elements' => [ + [ + 'type' => 'mrkdwn', + 'text' => '*Method:* '.$model->trigger['context']['method'], + ], + ], + ], + [ + 'type' => 'context', + 'elements' => [ + [ + 'type' => 'mrkdwn', + 'text' => '*URL:* '.$model->trigger['context']['url'], + ], + ], + ], + [ + 'type' => 'context', + 'elements' => [ + 0 => [ + 'type' => 'mrkdwn', + 'text' => '*Request Input:*', + ], + ], + ], + [ + 'type' => 'section', + 'text' => [ + 'type' => 'mrkdwn', + 'text' => json_encode($model->trigger['context']['input']), + ], + ], + ]); + } +} diff --git a/tests/Integration/Services/ChannelServiceTest.php b/tests/Integration/Services/ChannelServiceTest.php index 54a7eeb..5c53e5d 100644 --- a/tests/Integration/Services/ChannelServiceTest.php +++ b/tests/Integration/Services/ChannelServiceTest.php @@ -5,6 +5,7 @@ use ReflectionClass; use YorCreative\QueryWatcher\Services\ChannelService; use YorCreative\QueryWatcher\Strategies\NotificationStrategy\Channels\Discord; +use YorCreative\QueryWatcher\Strategies\NotificationStrategy\Channels\Slack; use YorCreative\QueryWatcher\Tests\TestCase; class ChannelServiceTest extends TestCase @@ -22,11 +23,12 @@ public function it_has_available_channels() $channels = $protectedMethod->invokeArgs(new ChannelService(), []); - $this->assertCount(1, $channels); + $this->assertCount(2, $channels); $channels->each(function ($channel) { $this->assertTrue(in_array($channel, [ new Discord(), + new Slack(), ])); }); } diff --git a/tests/Unit/Strategies/Channels/SlackTest.php b/tests/Unit/Strategies/Channels/SlackTest.php new file mode 100644 index 0000000..08431a3 --- /dev/null +++ b/tests/Unit/Strategies/Channels/SlackTest.php @@ -0,0 +1,58 @@ +slackChannel = new Slack(); + } + + /** + * @test + * @group Unit + * @group Channels + * @group Strategies + */ + public function it_can_send_http_request_to_slack() + { + Http::fake(); + + $this->slackChannel->notify($this->queryModel); + + Http::assertSentCount(1); + } + + /** + * @test + * @group Unit + * @group Channels + * @group Strategies + */ + public function it_can_determine_that_slack_channel_is_enabled() + { + app()['config']->set('querywatcher.channels.slack.enabled', true); + $this->assertTrue($this->slackChannel->isEnabled()); + } + + /** + * @test + * @group Unit + * @group Channels + * @group Strategies + */ + public function it_can_determine_that_slack_channel_is_not_enabled() + { + app()['config']->set('querywatcher.channels.slack.enabled', false); + $this->assertFalse($this->slackChannel->isEnabled()); + } +}