Skip to content

Commit

Permalink
chore: deprecate the aioredis integration (#7790)
Browse files Browse the repository at this point in the history
This change fixes #4351 by
adding a deprecation warning to imports of `contrib.aioredis`. It
removes automated testing of the aioredis integration, but does not
touch the integration itself. Thus, this is a non-breaking change and
can be released immediately. The aioredis integration is now effectively
a "candidate for removal" in a future major version.

## Checklist

- [x] Change(s) are motivated and described in the PR description.
- [x] Testing strategy is described if automated tests are not included
in the PR.
- [x] Risk is outlined (performance impact, potential for breakage,
maintainability, etc).
- [x] Change is maintainable (easy to change, telemetry, documentation).
- [x] [Library release note
guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html)
are followed. If no release note is required, add label
`changelog/no-changelog`.
- [x] Documentation is included (in-code, generated user docs, [public
corp docs](https://github.com/DataDog/documentation/)).
- [x] Backport labels are set (if
[applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting))

## Reviewer Checklist

- [x] Title is accurate.
- [x] No unnecessary changes are introduced.
- [x] Description motivates each change.
- [x] Avoids breaking
[API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces)
changes unless absolutely necessary.
- [x] Testing strategy adequately addresses listed risk(s).
- [x] Change is maintainable (easy to change, telemetry, documentation).
- [x] Release note makes sense to a user of the library.
- [x] Reviewer has explicitly acknowledged and discussed the performance
implications of this PR as reported in the benchmarks PR comment.
- [x] Backport labels are set in a manner that is consistent with the
[release branch maintenance
policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)
- [x] If this PR touches code that signs or publishes builds or
packages, or handles credentials of any kind, I've requested a review
from `@DataDog/security-design-and-guidance`.
- [x] This PR doesn't touch any of that.
  • Loading branch information
emmettbutler authored Dec 1, 2023
1 parent 577ed15 commit 9840930
Show file tree
Hide file tree
Showing 52 changed files with 19 additions and 2,635 deletions.
13 changes: 2 additions & 11 deletions .circleci/config.templ.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ commands:
description: "Install hatch"
steps:
- run: pip3 install hatch==1.7.0 hatch-containers==0.7.0

start_docker_services:
description: "Start Docker services"
parameters:
Expand Down Expand Up @@ -140,7 +140,7 @@ commands:
services: testagent << parameters.docker_services >>
- run:
environment:
DD_TRACE_AGENT_URL: << parameters.trace_agent_url >>
DD_TRACE_AGENT_URL: << parameters.trace_agent_url >>
RIOT_RUN_RECOMPILE_REQS: "<< pipeline.parameters.riot_run_latest >>"
command: |
./scripts/run-test-suite '<<parameters.pattern>>' <<pipeline.parameters.coverage>> 1
Expand Down Expand Up @@ -1068,15 +1068,6 @@ jobs:
wait: postgres
pattern: 'aiopg'

aioredis:
<<: *machine_executor
parallelism: 2
steps:
- run_test:
docker_services: 'redis'
pattern: 'aioredis$'
snapshot: true

aredis:
<<: *machine_executor
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/COMMIT_TEMPLATE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ feat/fix/docs/refactor/ci(xxx): commit title here
# CircleCI:django,flask,wsgi

# CircleCI suites are:
# aiobotocore, aiohttp, aiomysql, aiopg, aioredis, algoliasearch, appsec, appsec_iast,
# aiobotocore, aiohttp, aiomysql, aiopg, algoliasearch, appsec, appsec_iast,
# appsec_iast_memcheck, appsec_integrations, aredis, asgi, asyncpg, asynctest, aws_lambda,
# botocore, bottle, cassandra, celery, cherrypy, ci_visibility, consul, datastreams,
# ddtracerun, debugger, django, django_hosts, djangorestframework, dogpile_cache,
Expand Down
25 changes: 0 additions & 25 deletions .riot/requirements/12b0262.txt

This file was deleted.

24 changes: 0 additions & 24 deletions .riot/requirements/12c6f65.txt

This file was deleted.

24 changes: 0 additions & 24 deletions .riot/requirements/131b01d.txt

This file was deleted.

25 changes: 0 additions & 25 deletions .riot/requirements/1692bd3.txt

This file was deleted.

27 changes: 0 additions & 27 deletions .riot/requirements/186a1b5.txt

This file was deleted.

26 changes: 0 additions & 26 deletions .riot/requirements/352ae2b.txt

This file was deleted.

24 changes: 0 additions & 24 deletions .riot/requirements/4b6364f.txt

This file was deleted.

25 changes: 0 additions & 25 deletions .riot/requirements/a6e48ee.txt

This file was deleted.

11 changes: 10 additions & 1 deletion ddtrace/contrib/aioredis/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
from ddtrace.internal.utils.deprecations import DDTraceDeprecationWarning
from ddtrace.vendor.debtcollector import deprecate


deprecate(
"The aioredis integration is deprecated.",
message="Please use the redis integration with redis>=4.2.0 instead.",
category=DDTraceDeprecationWarning,
)
"""
The aioredis integration instruments aioredis requests. Version 1.3 and above are fully
supported.
Expand Down Expand Up @@ -60,7 +69,7 @@
myaioredis = aioredis.Aioredis()
Pin.override(myaioredis, service="myaioredis")
"""
from ...internal.utils.importlib import require_modules
from ...internal.utils.importlib import require_modules # noqa:E402


required_modules = ["aioredis"]
Expand Down
2 changes: 0 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ contacting support.
+--------------------------------------------------+---------------+----------------+
| :ref:`aiopg` | >= 0.16.0 | Yes |
+--------------------------------------------------+---------------+----------------+
| :ref:`aioredis` | >= 1.3.0 | Yes |
+--------------------------------------------------+---------------+----------------+
| :ref:`algoliasearch` | >= 2.5.0 | Yes |
+--------------------------------------------------+---------------+----------------+
| :ref:`aredis` | \* | Yes |
Expand Down
7 changes: 0 additions & 7 deletions docs/integrations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@
Integrations
------------

.. _aioredis:

aioredis
^^^^^^^^
.. automodule:: ddtrace.contrib.aioredis


.. _aiobotocore:

aiobotocore
Expand Down
6 changes: 6 additions & 0 deletions releasenotes/notes/deprecate-aioredis-e4a356f920de2cfe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
deprecations:
- |
aioredis: The aioredis integration is deprecated and will be removed in a future version.
As an alternative to the aioredis integration, you can use the redis integration with
redis>=4.2.0.
14 changes: 0 additions & 14 deletions riotfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -1883,20 +1883,6 @@ def select_pys(min_version=MIN_PYTHON_VERSION, max_version=MAX_PYTHON_VERSION):
},
command="reno {cmdargs}",
),
Venv(
name="aioredis",
# aioredis was merged into redis as of v2.0.1, no longer maintained and does not support Python 3.11 onward
pys=select_pys(min_version="3.7", max_version="3.10"),
command="pytest {cmdargs} tests/contrib/aioredis",
pkgs={
"pytest-asyncio": latest,
"aioredis": [
"~=1.3.0",
latest,
],
"typing-extensions": latest,
},
),
Venv(
name="asyncpg",
command="pytest {cmdargs} tests/contrib/asyncpg",
Expand Down
10 changes: 0 additions & 10 deletions tests/.suitespec.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
"redis": [
"ddtrace/contrib/rediscluster/*",
"ddtrace/contrib/redis/*",
"ddtrace/contrib/aioredis/*",
"ddtrace/contrib/aredis/*",
"ddtrace/contrib/yaaredis/*",
"ddtrace/contrib/trace_utils_redis.py",
Expand Down Expand Up @@ -1040,15 +1039,6 @@
"@pg",
"tests/contrib/aiopg/*"
],
"aioredis": [
"@bootstrap",
"@core",
"@contrib",
"@tracing",
"@redis",
"tests/contrib/aioredis/*",
"tests/snapshots/tests.contrib.{suite}.*"
],
"aredis": [
"@bootstrap",
"@core",
Expand Down
Empty file removed tests/contrib/aioredis/__init__.py
Empty file.
Loading

0 comments on commit 9840930

Please sign in to comment.