Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bundle Caching][Worker] Cache parent BAR if the commit's BAR doesn't exist #2037

Closed
3 tasks done
Tracked by #1707
JerrySentry opened this issue Jul 4, 2024 · 0 comments · Fixed by codecov/worker#562
Closed
3 tasks done
Tracked by #1707
Assignees

Comments

@JerrySentry
Copy link

JerrySentry commented Jul 4, 2024

In the BundleAnalysisReportService.process_upload:
do something like:

# fetch existing bundle report from storage
bundle_report = bundle_loader.load(commit_report.external_id)

# carry over parent bundle analysis report if commit doesn't have
if bundle_report is None:
    bundle_report = _previous_bundle_analysis_report(bundle_loader, commit)
    # bundles_to_be_cached = fetch all bundles for this repo_id in the BundleConfig table where is_caching=True
    # for bundle in bundle_report that exists in bundles_to_be_cached -> call `update_is_cached(name, True)
    # for bundle in bundle_report that dne in bundles_to_be_cached -> call `delete_bundle_by_name(name)

# fallback to create a fresh bundle analysis report
if bundle_report is None:
    bundle_report = BundleAnalysisReport()

What this does is it will do a automatic full carry forward of the parent commit with all its bundles. Afterwards any actual uploads for this commit will be overwriting whatever the bundles that got carried over (this logic already exists).

Note that this will not selectively figure out which bundle names it should cache or not (as it will just cache every bundle), that work will be done in another ticket.

Also note that we don't know yet what bundles were carried over vs what is from the actual commit's upload, we need to differentiate this because we need to tell the user which bundles are cached and which is not

@JerrySentry JerrySentry self-assigned this Jul 4, 2024
@JerrySentry JerrySentry changed the title [Bundle Caching][Worker] Copy parent BAR if the commit's BAR doesn't exist [Bundle Caching][Shared/Worker] Copy parent BAR if the commit's BAR doesn't exist Jul 4, 2024
@JerrySentry JerrySentry changed the title [Bundle Caching][Shared/Worker] Copy parent BAR if the commit's BAR doesn't exist [Bundle Caching][Shared/Worker] Cache parent BAR if the commit's BAR doesn't exist Jul 4, 2024
@JerrySentry JerrySentry changed the title [Bundle Caching][Shared/Worker] Cache parent BAR if the commit's BAR doesn't exist [Bundle Caching][Worker] Cache parent BAR if the commit's BAR doesn't exist Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant