perf(cache): extend shallow-copy cache helpers to mirror PRs - #839
Conversation
|
#786 just merged with the legacy-path shallow-copy helpers ( Keep: dropping Drop: the rewrite to a single |
385a54c to
37af439
Compare
Wire ScoredMirrorPR handling into _build_cache_entry (drop files, copy pr/review_summary/labels/linked_issues) and _isolate_for_downstream (shallow-copy each ScoredMirrorPR plus mutable sub-objects). Add TestMirrorCacheIsolation covering file-blob stripping, store-to-get isolation, and get-to-get isolation for mirror PRs. Closes #696
37af439 to
442ad50
Compare
@anderdc can you please review the update? |
|
Closing as duplicate of #824 |
Summary
_build_cache_entryand_isolate_for_downstreamfrom #786 only handle legacyPullRequestlists. Aftercopy.copy(evaluation), the three mirror lists (mirror_merged_prs,mirror_open_prs,mirror_closed_prs) remain as shared references — source mutations leak into the cache, successiveget()calls share the sameScoredMirrorPRobjects, and heavyfiles[*].head_content/base_contentblobs are never stripped.What changed
_build_cache_entry— copies eachScoredMirrorPRand its nestedMirrorPullRequest(review_summary,labels,linked_issues), setsfiles = None._isolate_for_downstream— copies each cachedScoredMirrorPRand mutable sub-objects to isolate successiveget()calls._scored_mirror_pr_for_cache,_scored_mirror_pr_isolated,_mirror_pr_copy,_mirror_linked_issue_copy.TestMirrorCacheIsolation— 3 tests covering file-blob stripping, store-to-get isolation, and get-to-get isolation.Related Issues
Closes #696
Type of Change
Testing
Checklist