Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Commit 144d60e

Browse files
committed
Remove codecovopentelem integration
This was part of the deprecated (and already removed) `profiling` product. Lets remove these things, as they should be completely unused.
1 parent 786d94a commit 144d60e

File tree

7 files changed

+20
-339
lines changed

7 files changed

+20
-339
lines changed

api/public/v2/compare/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from distutils.util import strtobool
21
from drf_spectacular.types import OpenApiTypes
32
from drf_spectacular.utils import OpenApiParameter, extend_schema
43
from rest_framework import mixins
@@ -15,6 +14,7 @@
1514
)
1615
from services.components import ComponentComparison, commit_components
1716
from services.decorators import torngit_safe
17+
from utils import strtobool
1818

1919
from .serializers import ComparisonSerializer, ComponentComparisonSerializer
2020

codecov/wsgi.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,5 @@
1414
from utils.config import get_settings_module
1515

1616
os.environ.setdefault("DJANGO_SETTINGS_MODULE", get_settings_module())
17-
if (
18-
os.getenv("OPENTELEMETRY_ENDPOINT")
19-
and os.getenv("OPENTELEMETRY_TOKEN")
20-
and os.getenv("OPENTELEMETRY_CODECOV_RATE")
21-
):
22-
from open_telemetry import instrument
23-
24-
instrument()
2517

2618
application = get_wsgi_application()

graphql_api/types/config/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
from ariadne import ObjectType
44
from asgiref.sync import sync_to_async
5-
from distutils.util import strtobool
65
from django.conf import settings
76
from graphql.type.definition import GraphQLResolveInfo
87

98
import services.self_hosted as self_hosted
109
from graphql_api.types.enums.enums import LoginProvider, SyncProvider
10+
from utils import strtobool
1111

1212
config_bindable = ObjectType("Config")
1313

open_telemetry.py

Lines changed: 0 additions & 191 deletions
This file was deleted.

pyproject.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ dependencies = [
3131
"minio==7.1.13",
3232
"multidict>=6.1.0",
3333
"oauth2==1.9.0.post1",
34-
"opentelemetry-instrumentation-django>=0.45b0",
35-
"opentelemetry-sdk>=1.24.0",
3634
"polars==1.12.0",
3735
"psycopg2-binary>=2.9.10",
3836
"pydantic>=2.9.0",

utils/__init__.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,20 @@ def round_decimals_down(number: float, decimals: int = 2) -> float:
2424

2525
factor = 10**decimals
2626
return math.floor(number * factor) / factor
27+
28+
29+
# Copied from <https://github.com/python/cpython/blob/v3.11.2/Lib/distutils/util.py#L308>
30+
def strtobool(val: Any) -> int:
31+
"""Convert a string representation of truth to true (1) or false (0).
32+
33+
True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values
34+
are 'n', 'no', 'f', 'false', 'off', and '0'. Raises ValueError if
35+
'val' is anything else.
36+
"""
37+
val = val.lower()
38+
if val in ("y", "yes", "t", "true", "on", "1"):
39+
return 1
40+
elif val in ("n", "no", "f", "false", "off", "0"):
41+
return 0
42+
else:
43+
raise ValueError("invalid truth value %r" % (val,))

0 commit comments

Comments
 (0)