Skip to content

Commit 6a6602c

Browse files
Merge pull request #8 from matomo-org/PG-4530-alert-via-slack
Adds changes to send CustomAlerts via Slack, #PG-4530
2 parents 0d29f39 + 555467d commit 6a6602c

17 files changed

Lines changed: 649 additions & 22 deletions

.github/workflows/matomo-tests.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Action for running tests
22
# This file has been automatically created.
33
# To recreate it you can run this command
4-
# ./console generate:test-action --plugin="Slack" --php-versions="7.2,8.4" --schedule-cron="0 5 * * 6"
4+
# ./console generate:test-action --plugin="Slack" --php-versions="7.2,8.4" --dependent-plugins="matomo-org/plugin-CustomAlerts" --schedule-cron="0 5 * * 6"
55

66
name: Plugin Slack Tests
77

@@ -56,6 +56,9 @@ jobs:
5656
redis-service: true
5757
artifacts-pass: ${{ secrets.ARTIFACTS_PASS }}
5858
upload-artifacts: ${{ matrix.php == '7.2' && matrix.target == 'maximum_supported_matomo' }}
59+
artifacts-protected: true
60+
dependent-plugins: 'matomo-org/plugin-CustomAlerts'
61+
github-token: ${{ secrets.TESTS_ACCESS_TOKEN || secrets.GITHUB_TOKEN }}
5962
UI:
6063
runs-on: ubuntu-24.04
6164
steps:
@@ -74,3 +77,6 @@ jobs:
7477
redis-service: true
7578
artifacts-pass: ${{ secrets.ARTIFACTS_PASS }}
7679
upload-artifacts: true
80+
artifacts-protected: true
81+
dependent-plugins: 'matomo-org/plugin-CustomAlerts'
82+
github-token: ${{ secrets.TESTS_ACCESS_TOKEN || secrets.GITHUB_TOKEN }}

EnrichTriggeredAlerts.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
/**
4+
* Matomo - free/libre analytics platform
5+
*
6+
* @link https://matomo.org
7+
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
8+
*/
9+
10+
namespace Piwik\Plugins\Slack;
11+
12+
use Piwik\Container\StaticContainer;
13+
use Piwik\Plugins\CustomAlerts\Controller;
14+
15+
class EnrichTriggeredAlerts extends Controller
16+
{
17+
public function __construct()
18+
{
19+
parent::__construct(StaticContainer::get('Piwik\Plugins\API\ProcessedReport'));
20+
}
21+
22+
public function enrichTriggeredAlerts($triggeredAlerts)
23+
{
24+
return parent::enrichTriggeredAlerts($triggeredAlerts);
25+
}
26+
}

0 commit comments

Comments
 (0)