fix(resolver): include req_type in resolution cache key#1188
Conversation
|
Warning Review limit reached
More reviews will be available in 32 minutes and 15 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthrough
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Narrow the cache key from the full RequirementType enum to a boolean is_top_level flag. The only behavioral distinction that matters for caching is whether cooldown bypass applies (top-level) or not. Using the enum would cause redundant re-resolution when a package appears as BUILD_SYSTEM, BUILD_BACKEND, BUILD_SDIST, and INSTALL — all of which behave identically for cooldown purposes. Co-Authored-By: Claude <claude@anthropic.com> Closes: python-wheel-build#1187 Signed-off-by: Rohan Devasthale <rdevasth@redhat.com>
|
@dhellmann This alone might not fix the issue |
…ython-wheel-build#1187 exempt_versions Cover top-level == pin scenarios where transitive deps use a different requirement specifier. These validate the python-wheel-build#1157 exempt_versions fix; session-cache coverage remains in python-wheel-build#1188. Co-Authored-By: Claude <claude@anthropic.com> Signed-off-by: Lalatendu Mohanty <lmohanty@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
tiran
left a comment
There was a problem hiding this comment.
IMO the suggestion from 1187 is not the best solution. Breadth-first resolution of top-level requirements should solve the issue, too.
@tiran I agree that 1187 is not the best solution however, I think the BFS approach will make things more complicated. I see the following challenges:
Some points to consider:
Let me know what you think / whether I am missing anything. cc @LalatenduMohanty @dhellmann |
UPDATE: I posted this before reading Doug's comment here: #1187 (comment) |
The session-level cache in
BootstrapRequirementResolverused (requirement_string, pre_built) as its cache key, ignoring req_type. When a package was first resolved as a transitive dependency with cooldown enforced, the cached result was incorrectly reused for a subsequent top-level resolution that should have bypassed cooldown.Add req_type to the cache key so transitive and top-level resolutions are cached separately.
Closes: #1187