Skip to content

Commit

Permalink
Merge pull request #155 from silinternational/release/4.5.0
Browse files Browse the repository at this point in the history
Release 4.5.0
  • Loading branch information
briskt authored Oct 9, 2023
2 parents 149fe02 + 0f92fdf commit 313313c
Show file tree
Hide file tree
Showing 6 changed files with 2,038 additions and 851 deletions.
27 changes: 27 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
### Added
-

### Changed
-

### Deprecated
-

### Removed
-

### Fixed
-

### Security
-

---

### Feature PR Checklist
- [ ] Documentation (README, etc.)
- [ ] Unit tests created or updated
- [ ] Run `make composershow`

### Release PR Checklist
- [ ] Update version number in main.php Sentry configuration
28 changes: 23 additions & 5 deletions application/common/config/main.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php

use notamedia\sentry\SentryTarget;
use Sentry\Event;
use Sil\Idp\IdSync\common\components\IdBrokerBase;
use Sil\Idp\IdSync\common\components\IdStoreBase;
use Sil\Idp\IdSync\common\components\notify\EmailServiceNotifier;
use Sil\Idp\IdSync\common\components\notify\NullNotifier;
use Sil\JsonLog\target\EmailServiceTarget;
use Sil\JsonLog\target\JsonStreamTarget;
use Sil\PhpEnv\Env;
use yii\helpers\ArrayHelper;
use yii\helpers\Json;

$alertsEmail = Env::get('ALERTS_EMAIL');
$appEnv = Env::get('APP_ENV', 'prod'); // Have default match "application/frontend/web/index.php".
$idpName = Env::requireEnv('IDP_NAME');
$idpDisplayName = Env::get('IDP_DISPLAY_NAME', $idpName);

Expand Down Expand Up @@ -106,20 +106,38 @@
'logVars' => [], // Disable logging of _SERVER, _POST, etc.
'message' => [
'to' => $alertsEmail ?? '(disabled)',
'subject' => 'ERROR - ' . $idpName . ' ID Sync [' . $appEnv .']',
'subject' => 'ERROR - ' . $idpName . ' ID Sync [' . YII_ENV .']',
],
'baseUrl' => $emailServiceConfig['baseUrl'],
'accessToken' => $emailServiceConfig['accessToken'],
'assertValidIp' => $emailServiceConfig['assertValidIp'],
'validIpRanges' => $emailServiceConfig['validIpRanges'],
'prefix' => function ($message) use ($appEnv, $idpName) {
'prefix' => function ($message) use ($idpName) {
return Json::encode([
'app_env' => $appEnv,
'app_env' => YII_ENV,
'idp_name' => $idpName,
]);
},
'exportInterval' => 1,
],
[
'class' => SentryTarget::class,
'enabled' => !empty(Env::get('SENTRY_DSN')),
'dsn' => Env::get('SENTRY_DSN'),
'levels' => ['error'],
'context' => true,
// Additional options for `Sentry\init`
// https://docs.sentry.io/platforms/php/configuration/options
'clientOptions' => [
'attach_stacktrace' => false, // stack trace identifies the logger call stack, not helpful
'environment' => YII_ENV,
'release' => '[email protected]',
'before_send' => function (Event $event) use ($idpName): ?Event {
$event->setExtra(['idp' => $idpName]);
return $event;
},
],
],
],
],

Expand Down
6 changes: 4 additions & 2 deletions application/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"yiisoft/yii2-swiftmailer": "^2.0",
"guzzlehttp/guzzle": "^6.2",
"google/apiclient": "^2.0",
"codemix/yii2-streamlog": "^1.3"
"codemix/yii2-streamlog": "^1.3",
"notamedia/yii2-sentry": "^1.7"
},
"require-dev": {
"behat/behat": "^3.3",
Expand All @@ -38,7 +39,8 @@
},
"config": {
"allow-plugins": {
"yiisoft/yii2-composer": true
"yiisoft/yii2-composer": true,
"php-http/discovery": false
}
}
}
Loading

0 comments on commit 313313c

Please sign in to comment.