Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .env.SAMPLE
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ DEFAULT_FROM_EMAIL="user@example.com"
STRIPE_PAYMENT_PRODUCT_NAME="SAMPLE"
STRIPE_PUBLISHABLE_KEY="SAMPLE"
STRIPE_SECRET_KEY="SAMPLE"
SENTRY_DSN="https://..."
# Optional. No backend is wired up yet; see the error-monitoring block in settings.py.
ERROR_MONITORING_DSN=""
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Removed

- Sentry integration and the `sentry_sdk` dependency. The `SENTRY_DSN` setting is replaced by `ERROR_MONITORING_DSN`, which is read but not wired to any service; the init block in `settings.py` is kept as the entry point for a future error-monitoring backend.

### Added

- Membership `started`/`until` are dates; membership runs one year from joining and early renewal extends from the current end date (admins can edit both dates). Existing rows migrate to `until = Dec 31 of the stored year`.
Expand Down
2 changes: 1 addition & 1 deletion conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"STRIPE_PAYMENT_PRODUCT_NAME": "test-product",
"SLACK_PAYMENTS_WEBHOOK": "",
"SLACK_REGISTRATIONS_WEBHOOK": "",
"SENTRY_DSN": "",
"ERROR_MONITORING_DSN": "",
"DEFAULT_FROM_EMAIL": "test@example.com",
"CELERY_TASK_ALWAYS_EAGER": "True",
"CELERY_BROKER_URL": "memory://",
Expand Down
26 changes: 11 additions & 15 deletions dds_registration/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from pathlib import Path

import environ
import sentry_sdk
from celery.schedules import crontab
from loguru import logger

Expand Down Expand Up @@ -42,7 +41,7 @@ def random_string(length: int = 32) -> str:
STRIPE_SECRET_KEY=(str, ""),
SLACK_PAYMENTS_WEBHOOK=(str, ""),
SLACK_REGISTRATIONS_WEBHOOK=(str, ""),
SENTRY_DSN=(str, ""),
ERROR_MONITORING_DSN=(str, ""),
CELERY_BROKER_URL=(str, "redis://127.0.0.1:6379/2"),
CELERY_TASK_ALWAYS_EAGER=(bool, False),
)
Expand All @@ -66,7 +65,7 @@ def random_string(length: int = 32) -> str:
STRIPE_SECRET_KEY = env("STRIPE_SECRET_KEY")
SLACK_PAYMENTS_WEBHOOK = env("SLACK_PAYMENTS_WEBHOOK")
SLACK_REGISTRATIONS_WEBHOOK = env("SLACK_REGISTRATIONS_WEBHOOK")
SENTRY_DSN = env("SENTRY_DSN")
ERROR_MONITORING_DSN = env("ERROR_MONITORING_DSN")

# Build paths inside the project like this: BASE_DIR / 'subdir'.
# Static files (CSS, JavaScript, Images)
Expand Down Expand Up @@ -370,16 +369,13 @@ def random_string(length: int = 32) -> str:
"SITE_KEYWORDS": SITE_KEYWORDS,
}

if SENTRY_DSN:
sentry_sdk.init(
dsn=SENTRY_DSN,
# Set traces_sample_rate to 1.0 to capture 100%
# of transactions for performance monitoring.
traces_sample_rate=1.0,
# Set profiles_sample_rate to 1.0 to profile 100%
# of sampled transactions.
# We recommend adjusting this value in production.
profiles_sample_rate=1.0,
)
# Error-monitoring entry point.
#
# Sentry was removed (see CHANGES.md). If another service (Sentry, GlitchTip, Rollbar,
# ...) is wanted later, initialise its SDK here, guarded by
# ERROR_MONITORING_DSN. Nothing is wired up at the moment, so a non-empty DSN
# is reported but otherwise ignored.
if ERROR_MONITORING_DSN:
logger.warning("ERROR_MONITORING_DSN is set but no error-monitoring backend is configured")
else:
logger.info("No key for Sentry found")
logger.info("No error-monitoring DSN configured")
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ dependencies = [
"qrcode",
"qrcode",
"requests",
"sentry_sdk",
"stripe>=8.9.0",
"xlsxwriter",
]
Expand Down
4 changes: 2 additions & 2 deletions tests/test_cookie_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"STRIPE_PAYMENT_PRODUCT_NAME": "x",
"SLACK_PAYMENTS_WEBHOOK": "x",
"SLACK_REGISTRATIONS_WEBHOOK": "x",
"SENTRY_DSN": "",
"ERROR_MONITORING_DSN": "",
"DEFAULT_FROM_EMAIL": "x@example.com",
}

Expand Down Expand Up @@ -61,7 +61,7 @@ def _load_settings(*, debug: bool) -> dict:
text=True,
check=True,
)
# settings.py logs a Sentry line to stderr; the JSON is the last stdout line.
# settings.py logs an error-monitoring line to stderr; the JSON is the last stdout line.
return json.loads(out.stdout.strip().splitlines()[-1])


Expand Down
Loading