Skip to content

fix(ruby): include build source options in lock identity#9992

Draft
risu729 wants to merge 3 commits into
jdx:mainfrom
risu729:fix/ruby-build-lock-options
Draft

fix(ruby): include build source options in lock identity#9992
risu729 wants to merge 3 commits into
jdx:mainfrom
risu729:fix/ruby-build-lock-options

Conversation

@risu729
Copy link
Copy Markdown
Contributor

@risu729 risu729 commented May 19, 2026

Summary

  • include Ruby compile/precompiled/source-build inputs in lock identity
  • include ruby-build/ruby-install source and option choices that can change compiled output
  • add regression coverage for precompiled, experimental-default, source-build, fallback, and ruby-install paths

Classification

Mixed actual lock/install identity and stale-lock invalidation fix.

Actual identity: source-build settings such as installer choice, build repositories, build options, and patch inputs can change the compiled Ruby tree for the same version. Those inputs are not represented by a locked artifact URL.

Stale-lock invalidation: precompiled URL/platform selector settings mostly choose the binary artifact URL/checksum. Once the lock entry is selected, the locked URL identifies the binary, but the selector still belongs in the exact-options key so changing precompiled source or platform settings does not reuse an older lock entry.

Verification

  • cargo fmt --check
  • cargo test ruby_lockfile_options

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 19, 2026

Greptile Summary

This PR fixes Ruby lock identity to include all build-influencing inputs — compile mode, installer choice and options, repository URLs, patches, and precompiled selector settings — by extracting the logic into a dedicated ruby_lockfile_options function and adding five unit tests that cover precompiled, source-build, experimental-default, fallback, and ruby-install code paths.

  • The ruby_lockfile_options function mirrors the should_try_precompiled predicate exactly, so the lock key consistently reflects which execution path will be taken for a given configuration.
  • Precompiled selector options (precompiled_url, precompiled_arch, precompiled_os) are gated outside the is_current_platform block, correctly including them even for cross-platform lock entries where source-build settings are irrelevant.
  • Source-build options are correctly included when compile=Some(false) to cover the precompiled-fallback path.

Confidence Score: 5/5

The change is additive and isolated to a newly extracted helper function; it does not alter any install, download, or resolution logic, only the set of keys recorded in the lock identity.

The lock-identity condition is taken verbatim from the existing should_try_precompiled predicate, keeping the two in sync. All five new tests pass distinct inputs through distinct branches and confirm expected key sets.

No files require special attention.

Important Files Changed

Filename Overview
src/plugins/core/ruby.rs Extracts Ruby lock-identity computation into ruby_lockfile_options, adding compile mode, source-build options, and precompiled selector options to the lock key; adds five new unit tests covering each path.

Reviews (5): Last reviewed commit: "Merge branch 'main' into fix/ruby-build-..." | Re-trigger Greptile

Comment thread src/plugins/core/ruby.rs
Comment thread src/plugins/core/ruby.rs
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces ToolOptionSource::InstallManifest to track and apply tool options from installation manifests, updating BackendArg and configuration resolution logic accordingly. The Ruby plugin's lockfile options were refactored into ruby_lockfile_options to include a broader set of settings such as compilation flags, installer repositories, and precompiled binary metadata. Feedback suggests simplifying a match block in the Ruby plugin using a more idiomatic if let pattern to improve readability.

Comment thread src/plugins/core/ruby.rs Outdated
@risu729

This comment was marked as outdated.

@risu729 risu729 force-pushed the fix/ruby-build-lock-options branch from 556e50e to 7fb77b1 Compare May 31, 2026 08:19
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 31, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: eb029b7a-53c8-42a1-9753-12046e2dfbcc

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

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 this pull request may close these issues.

1 participant