Skip to content

Commit 40d9ccb

Browse files
authored
Add sentry.properties file content validation during debug symbol upload (#862)
* Add properties file content checks for Windows * Add properties file content checks for Mac/Linux * Update changelog
1 parent 63992d9 commit 40d9ccb

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- Allow Sentry CLI to authenticate via environment variables during debug symbols upload ([#836](https://github.com/getsentry/sentry-unreal/pull/836))
1212
- Added the ability to specify a separate DSN for crashes while in editor vs cooked title ([#853](https://github.com/getsentry/sentry-unreal/pull/853))
1313
- Add callback to pre-process breadcrumbs before adding ([#814](https://github.com/getsentry/sentry-unreal/pull/814))
14+
- Add `sentry.properties` file content validation during debug symbol upload ([#862](https://github.com/getsentry/sentry-unreal/pull/862))
1415

1516
### Fixes
1617

plugin-dev/Scripts/upload-debug-symbols-win.bat

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,21 @@ echo Sentry: Looking for properties file '%PropertiesFile%'
9494

9595
if exist "%PropertiesFile%" (
9696
echo Sentry: Properties file found. Starting upload...
97+
call :ParseIniFile "%PropertiesFile%" Sentry defaults.project ProjectName
98+
if "!ProjectName!"=="" (
99+
echo Error: Project name is not set. Skipping...
100+
exit /B 0
101+
)
102+
call :ParseIniFile "%PropertiesFile%" Sentry defaults.org OrgName
103+
if "!OrgName!"=="" (
104+
echo Error: Project organization is not set. Skipping...
105+
exit /B 0
106+
)
107+
call :ParseIniFile "%PropertiesFile%" Sentry auth.token AuthToken
108+
if "!AuthToken!"=="" (
109+
echo Error: Auth token is not set. Skipping...
110+
exit /B 0
111+
)
97112
set "SENTRY_PROPERTIES=%PropertiesFile%"
98113
) else (
99114
echo Sentry: Properties file not found. Falling back to environment variables.

plugin-dev/Scripts/upload-debug-symbols.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,21 @@ echo "Sentry: Looking for properties file '$SENTRY_PROPERTIES'"
9292

9393
if [ -f "$PROPERTIES_FILE" ]; then
9494
echo "Sentry: Properties file found. Starting upload..."
95+
ProjectName=$(awk -F "=" '/defaults.project/ {print $2}' "$PROPERTIES_FILE")
96+
if [ -z "$ProjectName" ]; then
97+
echo "Error: Project name is not set. Skipping..."
98+
exit
99+
fi
100+
OrgName=$(awk -F "=" '/defaults.org/ {print $2}' "$PROPERTIES_FILE")
101+
if [ -z "$OrgName" ]; then
102+
echo "Error: Project organization is not set. Skipping..."
103+
exit
104+
fi
105+
AuthToken=$(awk -F "=" '/auth.token/ {print $2}' "$PROPERTIES_FILE")
106+
if [ -z "$AuthToken" ]; then
107+
echo "Error: Auth token is not set. Skipping..."
108+
exit
109+
fi
95110
export SENTRY_PROPERTIES=$PROPERTIES_FILE
96111
else
97112
echo "Sentry: Properties file not found. Falling back to environment variables."

0 commit comments

Comments
 (0)