Skip to content

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

Merged
merged 6 commits into from
Jan 29, 2024
Merged

Conversation

sentrivana
Copy link
Contributor

@sentrivana sentrivana commented Jan 22, 2024

  • remove deprecated client options
  • remove support for Integration.install
  • remove 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.

@sentrivana sentrivana self-assigned this Jan 22, 2024
@sentrivana sentrivana marked this pull request as ready for review January 23, 2024 14:27
@sentrivana sentrivana linked an issue Jan 26, 2024 that may be closed by this pull request
Copy link
Member

@antonpirker antonpirker left a 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)

@sentrivana
Copy link
Contributor Author

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

@sentrivana sentrivana merged commit cb2c70f into sentry-sdk-2.0 Jan 29, 2024
@sentrivana sentrivana deleted the ivana/2.0/remove-deprecated-code branch January 29, 2024 14:14
szokeasaurusrex added a commit that referenced this pull request Jan 29, 2024
* remove deprecated client options
* remove .install()
* remove new_span
szokeasaurusrex added a commit that referenced this pull request Jan 29, 2024
## 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove deprecated code
2 participants