From af581a75b094630957ab6370c74016b9ab026e68 Mon Sep 17 00:00:00 2001 From: Chris Hallgren Date: Sat, 22 Oct 2022 16:02:32 -0500 Subject: [PATCH 1/3] Support using SENTRY_RELEASE environment variable --- config/sentry.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/sentry.php b/config/sentry.php index 08c918bf..19dd187f 100644 --- a/config/sentry.php +++ b/config/sentry.php @@ -5,7 +5,7 @@ 'dsn' => env('SENTRY_LARAVEL_DSN', env('SENTRY_DSN')), // capture release as git sha - // 'release' => trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD')), + 'release' => env('SENTRY_RELEASE', trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD'))), // When left empty or `null` the Laravel environment will be used 'environment' => env('SENTRY_ENVIRONMENT'), From a88fffe30c82ac6b1bf43f4ad030f91f5adafe0e Mon Sep 17 00:00:00 2001 From: Alex Bouma Date: Thu, 27 Oct 2022 13:13:44 +0200 Subject: [PATCH 2/3] CR --- config/sentry.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/config/sentry.php b/config/sentry.php index 19dd187f..2635ca7b 100644 --- a/config/sentry.php +++ b/config/sentry.php @@ -4,8 +4,9 @@ 'dsn' => env('SENTRY_LARAVEL_DSN', env('SENTRY_DSN')), - // capture release as git sha - 'release' => env('SENTRY_RELEASE', trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD'))), + // The release version of your application + // Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD')) + 'release' => env('SENTRY_RELEASE'), // When left empty or `null` the Laravel environment will be used 'environment' => env('SENTRY_ENVIRONMENT'), From 3b217088ab1e9e671042abbb1db4f6613fed22e3 Mon Sep 17 00:00:00 2001 From: Alex Bouma Date: Thu, 27 Oct 2022 13:13:52 +0200 Subject: [PATCH 3/3] Add changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0112697..1814d1f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Unreleased - Remove incorrect checks if performance tracing should be enabled and rely on the transaction sampling decision instead (#600) +- Fix `SENTRY_RELEASE` .env variable not working when using config caching (#603) ## 3.0.0