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

Commit eda41a1

Browse files
committed
Use load_report instead of gql dataloader version
1 parent ee3bab1 commit eda41a1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

graphs/views.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@
1313

1414
from api.shared.mixins import RepoPropertyMixin
1515
from core.models import Branch, Pull
16-
from graphql_api.dataloader.bundle_analysis import load_bundle_analysis_report
1716
from graphs.settings import settings
18-
from services.bundle_analysis import BundleAnalysisReport
17+
from services.bundle_analysis import BundleAnalysisReport, load_report
1918
from services.components import commit_components
2019

2120
from .helpers.badge import (
@@ -254,15 +253,17 @@ def get_bundle_size(self) -> int | None:
254253
log.warning("Commit not found", extra=dict(commit=branch.head))
255254
return None
256255

257-
bundle_report = load_bundle_analysis_report(commit)
256+
shared_bundle_report = load_report(commit)
258257

259-
if not isinstance(bundle_report, BundleAnalysisReport):
258+
if shared_bundle_report is None:
260259
log.warning(
261260
"Bundle analysis report not found for commit",
262261
extra=dict(commit=branch.head),
263262
)
264263
return None
265264

265+
bundle_report = BundleAnalysisReport(shared_bundle_report)
266+
266267
return bundle_report.size_total
267268

268269

0 commit comments

Comments
 (0)