From 1fd29b5c04d8a8e6fa606a0f9f7fe78bcee0567a Mon Sep 17 00:00:00 2001 From: Patrick Valsecchi Date: Fri, 11 Aug 2017 09:41:37 +0200 Subject: [PATCH] Sentry: don't use SENTRY_CLIENT_RELEASE if it's 'latest' --- README.md | 7 ++++--- c2cwsgiutils/sentry.py | 2 +- setup.py | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b2d2d63b6..3ea31bcf2 100644 --- a/README.md +++ b/README.md @@ -250,9 +250,10 @@ to point the the project's public DSN. A few other environment variables can be used to tune the info sent with each report: -* GIT_HASH: will be used for the release -* SENTRY_CLIENT_ENVIRONMENT: the environment (dev, int, prod, ...) -* SENTRY_TAG_...: to add custom other tags +* `GIT_HASH`: will be used for the release +* `SENTRY_CLIENT_RELEASE`: If not equal to "latest", will be taken for the release instead of the GIT_HASH +* `SENTRY_CLIENT_ENVIRONMENT`: the environment (dev, int, prod, ...) +* `SENTRY_TAG_...`: to add other custom tags Developer info diff --git a/c2cwsgiutils/sentry.py b/c2cwsgiutils/sentry.py index e5ea5f877..fbf457f33 100644 --- a/c2cwsgiutils/sentry.py +++ b/c2cwsgiutils/sentry.py @@ -11,7 +11,7 @@ def init(): if 'SENTRY_URL' in os.environ: client_info = {key[14:].lower(): value for key, value in os.environ.items() if key.startswith('SENTRY_CLIENT_')} - if 'GIT_HASH' in os.environ and 'release' not in client_info: + if 'GIT_HASH' in os.environ and not ('release' in client_info and client_info['release'] != 'latest'): client_info['release'] = os.environ['GIT_HASH'] client_info['tags'] = {key[11:].lower(): value for key, value in os.environ.items() if key.startswith('SENTRY_TAG_')} diff --git a/setup.py b/setup.py index 9daae26a0..83969d823 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages -VERSION = '0.19.2' +VERSION = '0.19.3' HERE = os.path.abspath(os.path.dirname(__file__)) INSTALL_REQUIRES = open(os.path.join(HERE, 'requirements.txt')).read().splitlines()