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

Commit f70723d

Browse files
authored
Revert "Bundle analysis: carryforward at most once per commit (#1131)" (#1173)
1 parent 5447115 commit f70723d

4 files changed

Lines changed: 10 additions & 374 deletions

File tree

services/bundle_analysis/report.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,11 +211,17 @@ def _attempt_init_from_previous_report(
211211
repo_id=commit.repoid,
212212
).values_list("bundle_name", flat=True)
213213

214-
# Delete the bundle from the report if it's not to be cached
214+
# For each bundle:
215+
# if caching is on then update bundle.is_cached property to true
216+
# if caching is off then delete that bundle from the report
217+
update_fields = {}
215218
for bundle in bundle_report.bundle_reports():
216-
if bundle.name not in bundles_to_be_cached:
219+
if bundle.name in bundles_to_be_cached:
220+
update_fields[bundle.name] = True
221+
else:
217222
bundle_report.delete_bundle_by_name(bundle.name)
218-
223+
if update_fields:
224+
bundle_report.update_is_cached(update_fields)
219225
return bundle_report
220226
# fallback to create a fresh bundle analysis report if there is no previous report to carry over
221227
return BundleAnalysisReport()

tasks/tests/unit/cassetes/test_upload_task/TestUploadTaskIntegration/test_upload_task_call_bundle_analysis_carryforward_only_once.yaml

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

0 commit comments

Comments
 (0)