Merge pull request #5623 from keymanapp/chore/linux/sentry

chore(linux): Fix uploading to Sentry
This commit is contained in:
Eberhard Beilharz 2021-08-25 15:05:48 +02:00 committed by GitHub
commit d8ec847b6a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 4 deletions

View file

@ -39,7 +39,7 @@ override_dh_auto_build:
# keyman-config
cd linux/keyman-config && \
make man && \
sed -i -e "s/^__pkgversion__ = \"\"/__pkgversion__ = \"$(DEB_VERSION)\"/g" keyman_config/version.py && \
sed -i -e "s/^__pkgversion__ = \"[^\"]*\"/__pkgversion__ = \"$(DEB_VERSION)\"/g" keyman_config/version.py && \
make compile-po
dh_auto_build --sourcedir=linux/keyman-config --buildsystem=pybuild $@

View file

@ -13,6 +13,7 @@ from .version import __releaseversion__
from .version import __tier__
from .version import __pkgversion__
from .version import __environment__
from .version import __uploadsentry__
def _(txt):
@ -42,6 +43,8 @@ if 'unittest' in sys.modules.keys():
print('Not reporting to Sentry', file=sys.stderr)
elif os.environ.get('KEYMAN_NOSENTRY'):
print('Not reporting to Sentry because KEYMAN_NOSENTRY environment variable set', file=sys.stderr)
elif not __uploadsentry__:
print('Not reporting to Sentry because UPLOAD_SENTRY is false (%s)' % __environment__, file=sys.stderr)
else:
try:
# Try new sentry-sdk first
@ -51,8 +54,8 @@ else:
HaveSentryNewSdk = True
sentry_logging = LoggingIntegration(
level=logging.INFO, # Capture info and above as breadcrumbs
event_level=logging.CRITICAL # Send critical errors as events
level=logging.INFO, # Capture info and above as breadcrumbs
event_level=logging.CRITICAL # Send critical errors as events
)
SentryUrl = "https://1d0edbf2d0dc411b87119b6e92e2c357@sentry.keyman.com/12"
sentry_sdk.init(

View file

@ -9,5 +9,6 @@ __versionwithtag__ = "_VERSIONWITHTAG_"
__majorversion__ = "_MAJORVERSION_"
__releaseversion__ = "_RELEASEVERSION_"
__tier__ = "_TIER_"
__pkgversion__ = ""
__pkgversion__ = "(local)"
__environment__ = "_ENVIRONMENT_"
__uploadsentry__ = "_UPLOADSENTRY_"

View file

@ -85,6 +85,7 @@ for proj in ${extra_projects}; do
-e "s/_RELEASEVERSION_/${VERSION_RELEASE}/g" \
-e "s/_TIER_/${TIER}/g" \
-e "s/_ENVIRONMENT_/${VERSION_ENVIRONMENT}/g" \
-e "s/_UPLOADSENTRY_/${UPLOAD_SENTRY}/g" \
version.py.in > version.py
cd ../buildtools && python3 ./build-langtags.py
fi