Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 5.5.2 -- log the app version #179

Merged
merged 1 commit into from
Mar 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions application/common/config/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,13 @@
'organizationName' => $idpDisplayName,
];

$logPrefix = function () {
$version = Env::get('GITHUB_REF_NAME', 'unknown');

$logPrefix = function () use ($version) {
$request = Yii::$app->request;
$prefixData = [
'env' => YII_ENV,
'version' => $version,
];
if ($request instanceof \yii\web\Request) {
// Assumes format: Bearer consumer-module-name-32randomcharacters
Expand Down Expand Up @@ -145,7 +148,7 @@
'clientOptions' => [
'attach_stacktrace' => false, // stack trace identifies the logger call stack, not helpful
'environment' => YII_ENV,
'release' => 'idp-id-sync@' . Env::get('GITHUB_REF_NAME', 'unknown'),
'release' => 'idp-id-sync@' . $version,
'before_send' => function (Event $event) use ($idpName): ?Event {
$event->setExtra(['idp' => $idpName]);
return $event;
Expand Down
2 changes: 2 additions & 0 deletions application/run.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

echo "starting idp-id-sync version $GITHUB_REF_NAME"

if [[ $PARAMETER_STORE_PATH ]]; then
config-shim --path $PARAMETER_STORE_PATH /data/yii batch/full
elif [[ $APP_ID ]]; then
Expand Down