Skip to content

Commit

Permalink
Merge c6e8639 into 9df9a8f
Browse files Browse the repository at this point in the history
  • Loading branch information
dyohan9 committed Nov 13, 2019
2 parents 9df9a8f + c6e8639 commit f880c89
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 31 deletions.
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ gevent = "*"
packaging = "*"
django-environ = "*"
boto3 = "*"
sentry-sdk = "==0.7.10"

[dev-packages]
"flake8" = "*"
Expand Down
70 changes: 39 additions & 31 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,5 @@ You can set environment variables in your OS, write on ```.env``` file or pass v
| BOTHUB_BOT_EMAIL | ```string``` | ```bot_repository@bothub.it``` | Email that the system will automatically create for existing repositories that the owner deleted the account
| BOTHUB_BOT_NAME | ```string``` | ```Bot Repository``` | Name that the system will use to create the account
| BOTHUB_BOT_NICKNAME | ```string``` | ```bot_repository``` | Nickname that the system will use to create the account
| BOTHUB_ENGINE_USE_SENTRY | ```bool``` | ```False``` | Enable Support Sentry
| BOTHUB_ENGINE_SENTRY | ```string``` | ```None``` | URL Sentry
16 changes: 16 additions & 0 deletions bothub/settings.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import os

import environ
import sentry_sdk

from django.utils.log import DEFAULT_LOGGING
from sentry_sdk.integrations.django import DjangoIntegration

from .utils import cast_supported_languages
from .utils import cast_empty_str_to_none
Expand Down Expand Up @@ -49,6 +51,8 @@
BOTHUB_BOT_EMAIL=(str, "bot_repository@bothub.it"),
BOTHUB_BOT_NAME=(str, "Bot Repository"),
BOTHUB_BOT_NICKNAME=(str, "bot_repository"),
BOTHUB_ENGINE_USE_SENTRY=(bool, False),
BOTHUB_ENGINE_SENTRY=(str, None),
)

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
Expand Down Expand Up @@ -288,3 +292,15 @@
BOTHUB_BOT_EMAIL = env.str("BOTHUB_BOT_EMAIL")
BOTHUB_BOT_NAME = env.str("BOTHUB_BOT_NAME")
BOTHUB_BOT_NICKNAME = env.str("BOTHUB_BOT_NICKNAME")

# Sentry Environment

BOTHUB_ENGINE_USE_SENTRY = env.bool("BOTHUB_ENGINE_USE_SENTRY")


# Sentry

if BOTHUB_ENGINE_USE_SENTRY:
sentry_sdk.init(
dsn=env.str("BOTHUB_ENGINE_SENTRY"), integrations=[DjangoIntegration()]
)

0 comments on commit f880c89

Please sign in to comment.