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

Commit 53e4286

Browse files
committed
Store v2 reports in GCS instead of Redis
Worker has some dedicated code to move an uploaded report from Redis over to GCS. Instead of having that code, we can just store the report into GCS in the first place. Additionally, this PR also cleans up the `services.archive`, replacing it fully with the `shared.api_archive.archive`. It also forwards all the task arguments directly to the `Upload` task, in addition to storing it in Redis, to be forward compatible to some more planned upload processing improvements.
1 parent 02f2f83 commit 53e4286

25 files changed

+75
-239
lines changed

graphql_api/dataloader/bundle_analysis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from typing import Union
22

3+
from shared.api_archive.archive import ArchiveService
34
from shared.bundle_analysis import (
45
BundleAnalysisReportLoader,
56
MissingBaseReportError,
@@ -10,7 +11,6 @@
1011
from core.models import Commit
1112
from graphql_api.types.comparison.comparison import MissingBaseReport, MissingHeadReport
1213
from reports.models import CommitReport
13-
from services.archive import ArchiveService
1414
from services.bundle_analysis import BundleAnalysisComparison, BundleAnalysisReport
1515

1616

graphql_api/tests/test_bundle_analysis_measurements.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from unittest.mock import patch
22

33
from django.test import TransactionTestCase
4+
from shared.api_archive.archive import ArchiveService
45
from shared.bundle_analysis import StoragePaths
56
from shared.bundle_analysis.storage import get_bucket_name
67
from shared.django_apps.core.tests.factories import (
@@ -11,10 +12,7 @@
1112
from shared.storage.memory import MemoryStorageService
1213

1314
from reports.models import CommitReport
14-
from reports.tests.factories import (
15-
CommitReportFactory,
16-
)
17-
from services.archive import ArchiveService
15+
from reports.tests.factories import CommitReportFactory
1816
from timeseries.tests.factories import MeasurementFactory
1917

2018
from .helper import GraphQLTestHelper

graphql_api/tests/test_commit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import yaml
88
from django.test import TransactionTestCase
9+
from shared.api_archive.archive import ArchiveService
910
from shared.bundle_analysis import StoragePaths
1011
from shared.bundle_analysis.storage import get_bucket_name
1112
from shared.django_apps.core.tests.factories import (
@@ -30,7 +31,6 @@
3031
UploadFactory,
3132
UploadFlagMembershipFactory,
3233
)
33-
from services.archive import ArchiveService
3434
from services.comparison import MissingComparisonReport
3535
from services.components import Component
3636
from services.profiling import CriticalFile

graphql_api/tests/test_pull.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
from django.test import TransactionTestCase
66
from freezegun import freeze_time
7+
from shared.api_archive.archive import ArchiveService
78
from shared.bundle_analysis import StoragePaths
89
from shared.bundle_analysis.storage import get_bucket_name
910
from shared.django_apps.core.tests.factories import (
@@ -18,7 +19,6 @@
1819
from core.models import Commit
1920
from reports.models import CommitReport
2021
from reports.tests.factories import CommitReportFactory, ReportLevelTotalsFactory
21-
from services.archive import ArchiveService
2222

2323
from .helper import GraphQLTestHelper, paginate_connection
2424

profiling/serializers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from rest_framework import serializers
2+
from shared.api_archive.archive import ArchiveService
23

34
from profiling.models import ProfilingCommit, ProfilingUpload
4-
from services.archive import ArchiveService
55

66

77
class CreatableProfilingCommitRelatedField(serializers.SlugRelatedField):

profiling/tests/test_views.py

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

33
from django.urls import reverse
44
from rest_framework.test import APIClient
5+
from shared.api_archive.archive import ArchiveService
56
from shared.django_apps.core.tests.factories import (
67
RepositoryFactory,
78
RepositoryTokenFactory,
89
)
910

1011
from profiling.models import ProfilingCommit, ProfilingUpload
11-
from services.archive import ArchiveService
1212
from services.task import TaskService
1313

1414

profiling/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33

44
from rest_framework.generics import CreateAPIView
55
from rest_framework.permissions import BasePermission
6+
from shared.api_archive.archive import ArchiveService, MinioEndpoints
67

78
from codecov_auth.authentication.repo_auth import RepositoryTokenAuthentication
89
from profiling.models import ProfilingCommit
910
from profiling.serializers import ProfilingCommitSerializer, ProfilingUploadSerializer
10-
from services.archive import ArchiveService, MinioEndpoints
1111
from services.task import TaskService
1212

1313
log = logging.getLogger(__name__)

services/archive.py

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

services/bundle_analysis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import sentry_sdk
99
from django.utils.functional import cached_property
10+
from shared.api_archive.archive import ArchiveService
1011
from shared.bundle_analysis import AssetReport as SharedAssetReport
1112
from shared.bundle_analysis import (
1213
BundleAnalysisComparison as SharedBundleAnalysisComparison,
@@ -25,7 +26,6 @@
2526
measurements_last_uploaded_before_start_date,
2627
)
2728
from reports.models import CommitReport
28-
from services.archive import ArchiveService
2929
from timeseries.helpers import fill_sparse_measurements
3030
from timeseries.models import Interval, MeasurementName
3131

services/profiling.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
import regex
66
import shared.reports.api_report_service as report_service
77
from django.utils.functional import cached_property
8+
from shared.api_archive.archive import ArchiveService
89
from shared.profiling import ProfilingSummaryDataAnalyzer
910
from shared.yaml import UserYaml
1011

1112
from core.models import Commit, Repository
1213
from profiling.models import ProfilingCommit
13-
from services.archive import ArchiveService
1414

1515
log = logging.getLogger(__name__)
1616

0 commit comments

Comments
 (0)