← Back to Pull requests

refactor: extract subpackages_for_output into rattler_build_core #2955

Closed
unknown closed this pull request without merging on Nov 20, 2026 15:32 UTC
View on GitHub
unknown unknown commented on Nov 17, 2026 18:43 UTC
Author

<!-- Your own words here. -->

Expose this logic as a function to be consumed by pixi-build-rattler-build.

---

<details>
<summary>AI-generated details (Claude Opus 5.5)</summary>

Moves the code in get_build_output that fills BuildConfiguration::subpackages into a public rattler_build_core::subpackages_for_output(&IndexSet<DiscoveredOutput>, index). No behaviour change: it returns the non-skipped outputs up to and including index in topological order, overlaid with the variant-matched exact pins of that output, exactly as the loop did before.

Motivation: pixi-build-rattler-build constructs its own BuildConfiguration in conda/build_v1 and currently passes an empty subpackages map, which breaks pin_subpackage in outputs that inherit from a staging output (prefix-dev/pixi#7557). With this helper, the backend can call the same function as the CLI instead of copying the logic (prefix-dev/pixi#7559), so the two can't drift apart.

Verification:

  • cargo fmt --check and cargo clippy -p rattler-build -p rattler_build_core --all-targets -- -D warnings are clean.

  • The end-to-end tests in test_simple.py and test_staging.py that cover pins, siblings, variants, staging and ordering pass (53 passed, 3 skipped), including test_sibling_exact_pin_uses_matching_variant and test_missing_pin_subpackage.

  • cargo test --lib for both crates passes except system_tools::tests::test_system_tool, which needs patchelf on PATH and fails the same way on main locally.
  • </details>

    Diff: 189 lines (+141 / -48) across 2 files Reviewer: wolfv Review duration: 4129m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.41) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.41 · 189 lines diff across 2 files
    0.41
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.314
    Shallow Review Depth shallow_review_depth
    0.289
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #2955"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 40.8% (MEDIUM) · Higher = larger blast radius
    40.8%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 16.1% · Safe to merge
    16.1%