-
Notifications
You must be signed in to change notification settings - Fork 555
Remove deprecated code #2666
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove deprecated code #2666
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! 🧹
Just one note:
We need to remove it from the docs too: https://docs.sentry.io/platforms/python/configuration/options/#request-bodies (both options are there side by side)
Thanks for pointing this out -- adding this to my list of things to update in #2665 |
* remove deprecated client options * remove .install() * remove new_span
## Summary This change removes all usages of the deprecated `store` endpoint from the Python SDK. From now on, events that were previously sent to the `store` endpoint will now be sent as envelopes to the `envelope` endpoint. ## Breaking API changes - `sentry_sdk.transport.Transport` is now an abstract base class, and therefore, it cannot be instantiated directly. Subclasses must implement the `capture_envelope` method. - `sentry_sdk.utils.Auth.store_api_url` has been removed. - `sentry_sdk.utils.Auth.get_api_url`'s now accepts a `sentry_sdk.consts.EndpointType` enum instead of a string as its only parameter. Supplying this parameter is currently unnecessary, since the parameter's default value is the only possible `sentry_sdk.consts.EndpointType` value. ## Backwards-compatible API changes - `sentry_sdk.transport.Transport.capture_event` has been deprecated. Please use `sentry_sdk.transport.Transport.capture_envelope`, instead. - Passing a function to `sentry_sdk.init`'s `transport` keyword argument has been deprecated. If you wish to provide a custom transport, please pass a `sentry_sdk.transport.Transport` instance or a subclass. ## Other changes - `sentry_sdk.transport.HttpTransport._send_event` has been removed, and uses of this method have been removed from the codebase, including from tests. - Cleaned up some transport-related test code _________________________ * Remove store endpoint * Fix linter error * Add stacklevel to warn call * Remove `store_api_url` test, update `get_api_url` test * Fix mypy * Correct import * Use `Enum` instead of `StrEnum` * Update `envelope.py` * Remove `Envelope.events` calls * Fix `capture_events_forksafe` * Hopefully fix circular import * Manually set TestTransport * Fix circular import * Revert "Fix circular import" This reverts commit e681bdb. * Revert "Hopefully fix circular import" This reverts commit 7105849. * Move EndpointType to top of file * Fix AWS tests * Remove TODO comment * Undo ABC change I will make a separate PR for this * Update * Rename envelope_item to envelope_items * Remove unneeded import statement * Updated migration guide * Put back `has_tracing_enabled` check * Remove test for replay context * Update MIGRATION_GUIDE.md * Auto-enable more integrations (#2671) * Remove deprecated code (#2666) * remove deprecated client options * remove .install() * remove new_span Fixes GH-1957 --------- Co-authored-by: Ivana Kellyerova <ivana.kellyerova@sentry.io>
Integration.install
Span.new_span
There's a lot more code marked as deprecated, especially related to tracing. I'm purposefully not removing that here as we anticipate larger changes to the tracing API moving away from the transaction model.
Closes #2583
General Notes
Thank you for contributing to
sentry-python
!Please add tests to validate your changes, and lint your code using
tox -e linters
.Running the test suite on your PR might require maintainer approval. Some tests (AWS Lambda) additionally require a maintainer to add a special label to run and will fail if the label is not present.
For maintainers
Sensitive test suites require maintainer review to ensure that tests do not compromise our secrets. This review must be repeated after any code revisions.
Before running sensitive test suites, please carefully check the PR. Then, apply the
Trigger: tests using secrets
label. The label will be removed after any code changes to enforce our policy requiring maintainers to review all code revisions before running sensitive tests.