-
-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* sentry * check for main branch * Update openadapt/config.py * Update openadapt/config.py * ERROR_REPORTING_ENABLED * Update config.py * update poetry.lock * Update openadapt/config.py --------- Co-authored-by: Richard Abrich <[email protected]>
- Loading branch information
Showing
3 changed files
with
125 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,13 +15,20 @@ | |
|
||
from dotenv import load_dotenv | ||
from loguru import logger | ||
import git | ||
import sentry_sdk | ||
|
||
_DEFAULTS = { | ||
"CACHE_DIR_PATH": ".cache", | ||
"CACHE_ENABLED": True, | ||
"CACHE_VERBOSITY": 0, | ||
"DB_ECHO": False, | ||
"DB_FNAME": "openadapt.db", | ||
"ERROR_REPORTING_ENABLED": True, | ||
"ERROR_REPORTING_DSN": ( | ||
"https://[email protected]/3798" | ||
), | ||
"ERROR_REPORTING_BRANCH": "main", | ||
"OPENAI_API_KEY": "<set your api key in .env>", | ||
# "OPENAI_MODEL_NAME": "gpt-4", | ||
"OPENAI_MODEL_NAME": "gpt-3.5-turbo", | ||
|
@@ -220,3 +227,14 @@ def obfuscate(val: str, pct_reveal: float = 0.1, char: str = "*") -> str: | |
): | ||
val = obfuscate(val) | ||
logger.info(f"{key}={val}") | ||
|
||
if ERROR_REPORTING_ENABLED: # type: ignore # noqa | ||
active_branch_name = git.Repo(ROOT_DIRPATH).active_branch.name | ||
logger.info(f"{active_branch_name=}") | ||
is_reporting_branch = active_branch_name == ERROR_REPORTING_BRANCH # type: ignore # noqa | ||
logger.info(f"{is_reporting_branch=}") | ||
if is_reporting_branch: | ||
sentry_sdk.init( | ||
dsn=ERROR_REPORTING_DSN, # type: ignore # noqa | ||
traces_sample_rate=1.0, | ||
) |
Oops, something went wrong.