Skip to content

fix(bootstrapper): skip already-failed versions in _phase_resolve()#1203

Merged
mergify[bot] merged 1 commit into
python-wheel-build:mainfrom
rd4398:fix-duplicate-failures
Jun 22, 2026
Merged

fix(bootstrapper): skip already-failed versions in _phase_resolve()#1203
mergify[bot] merged 1 commit into
python-wheel-build:mainfrom
rd4398:fix-duplicate-failures

Conversation

@rd4398

@rd4398 rd4398 commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

In --multiple-versions mode, when a version fails to build, _handle_phase_error() discards it from _seen_requirements and records it in _failed_versions, but _failed_versions was never consulted before attempting builds. The resolution cache still returned the full candidate list, so every failed version was re-downloaded, re-prepared, and re-built on each subsequent resolution of the same requirement.

Filter out already-failed versions in _phase_resolve() before expanding them into work items, avoiding redundant build attempts.

Closes: #1198

@rd4398
rd4398 requested a review from a team as a code owner June 22, 2026 15:00
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@rd4398, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 37 minutes and 57 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 23c59dd1-576a-4101-af09-860d94c7407e

📥 Commits

Reviewing files that changed from the base of the PR and between f665ed8 and 093c2db.

📒 Files selected for processing (3)
  • src/fromager/bootstrapper.py
  • tests/test_bootstrapper.py
  • tests/test_bootstrapper_iterative.py
📝 Walkthrough

Walkthrough

In Bootstrapper._phase_resolve, the multiple_versions branch now builds a set of (package, version) pairs from self._failed_versions and filters resolved_versions to remove any previously-failed candidates before the existing cached-wheel and highest-version logic runs. If filtering removes all candidates, a RuntimeError is raised. The _phase_resolve docstring is updated accordingly. Three new unit tests cover: failed versions excluded in multiple_versions mode, no exclusion when multiple_versions is False, and RuntimeError when all candidates are failed.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: skipping already-failed versions in _phase_resolve() to prevent redundant build attempts in multiple-versions mode.
Description check ✅ Passed The description is directly related to the changeset, explaining the performance regression, root cause, and the filtering solution implemented in the PR.
Linked Issues check ✅ Passed The code changes fully address issue #1198 by filtering out already-failed versions in _phase_resolve() before expanding them into work items, with tests validating the new behavior in multiple_versions mode.
Out of Scope Changes check ✅ Passed All changes are tightly scoped to the stated objective: excluding failed versions in _phase_resolve() logic and adding corresponding unit tests for the new behavior.

✏️ 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@rd4398
rd4398 requested a review from EmilienM June 22, 2026 15:00
@mergify mergify Bot added the ci label Jun 22, 2026
EmilienM
EmilienM previously approved these changes Jun 22, 2026
@mergify

mergify Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Comment thread src/fromager/bootstrapper.py Outdated
Comment thread src/fromager/bootstrapper.py Outdated
In `--multiple-versions` mode, when a version fails to build,
`_handle_phase_error()` discards it from `_seen_requirements` and
records it in `_failed_versions`, but `_failed_versions` was never
consulted before attempting builds. The resolution cache still
returned the full candidate list, so every failed version was
re-downloaded, re-prepared, and re-built on each subsequent
resolution of the same requirement.

Filter out already-failed versions in `_phase_resolve()` before
expanding them into work items, avoiding redundant build attempts.

Closes: python-wheel-build#1198
Co-Authored-By: Claude <claude@anthropic.com>
Signed-off-by: Rohan Devasthale <rdevasth@redhat.com>
@rd4398
rd4398 force-pushed the fix-duplicate-failures branch from b2f94e7 to 093c2db Compare June 22, 2026 15:22

@EmilienM EmilienM left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rd4398

rd4398 commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

@mergify rebase

@mergify
mergify Bot merged commit 7ce238d into python-wheel-build:main Jun 22, 2026
39 checks passed
@mergify

mergify Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

rebase

🛑 The pull request rule doesn't match anymore

Details

This action has been cancelled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: multiple_versions mode retries already-failed versions on every new resolution

3 participants