fix: change SENTRY_TOKEN to SENTRY_DSN #1633
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request Type
Description
Change references to SENTRY_TOKEN with SENTRY_DSN in docs (Error Tracking guide) and messages (
interactions.ext.sentry:setup
on error), in accordance with Sentry.io docs. This should avoid confusion by users possibly adding a Sentry.io auth token on setup.Added as
fix
as this PR also includes a fix on an error when specifyingdsn="dsn"
but nottoken="dsn"
on extension setup.Changes
interactions.ext.sentry:setup:
Add argumentdsn
in place oftoken
token
is moved back and is accessible as a kwarg, avoiding breaking changes. However,dsn
will take precedence when available.dsn="dsn"
without specifyingtoken="dsn"
.token=SENTRY_TOKEN
withdsn=SENTRY_DSN
. Instead, an error would be emitted if both are unspecified orNone
.Related Issues
Test Scenarios
A
ZeroDivisionError
event should appear on the Sentry.io project corresponding to the DSN. The DSN below is an example.The
load_extension
should still work withtoken
kwarg:Keyword
dsn
overridestoken
when available:The error message should show, this time for "no Sentry DSN".
Python Compatibility
3.10.x
3.11.x
Checklist
pre-commit
code linter over all edited files