Skip to content

Commit

Permalink
Sentry: don't use SENTRY_CLIENT_RELEASE if it's 'latest'
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Valsecchi committed Aug 11, 2017
1 parent 930b615 commit 1fd29b5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion c2cwsgiutils/sentry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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_')}
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 1fd29b5

Please sign in to comment.