Skip to content

Commit

Permalink
Do not send binaries to Sentry by default
Browse files Browse the repository at this point in the history
This will help at development time, sometimes you just want to send an event to Sentry but without having the binaries uploaded, which requires an authentication token and everything.
  • Loading branch information
wawanbreton committed Nov 25, 2024
1 parent 939b0e7 commit 635904f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion recipes/sentrylibrary/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@
class SentryLibrary:
options = {
"enable_sentry": [True, False],
"sentry_send_binaries": [True, False],
"sentry_create_release": [True, False],
"sentry_project": ["ANY"],
"sentry_is_production": [True, False],
}
default_options = {
"enable_sentry": False,
"sentry_send_binaries": False,
"sentry_create_release": False,
"sentry_project": "",
"sentry_is_production": False,
Expand All @@ -32,7 +34,11 @@ def configure(self):

def validate(self):
if self.options.enable_sentry:
for sentry_conf in ["organization", "url", "token"]:
required_confs = ["url"]
if self.options.sentry_send_binaries:
required_confs += ["organization", "token"]

for sentry_conf in required_confs:
conf_name = f"user.sentry:{sentry_conf}"
if self.conf.get(conf_name, "", check_type=str) == "":
raise ConanInvalidConfiguration(f"Unable to enable Sentry because no {conf_name} was configured (use '-c {conf_name}={sentry_conf}')")
Expand Down

0 comments on commit 635904f

Please sign in to comment.