You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
New feature (non-breaking change which adds functionality and tests!)
Breaking change (fix or feature that would cause existing functionality to change)
PR Type
Enhancement, Bug fix
Description
Use prebuilt Ruby with rv-ruby checksums for multiple platforms
Add workaround for rules_ruby incompatibility with jruby/truffleruby
Update rules_ruby git override to specific commit
Pin Psych gem to 5.0.1 and exclude from bundle fetch
Remove date gem checksums (handled by prebuilt Ruby)
Diagram Walkthrough
flowchart LR
A["rules_ruby git override"] --> B["Prebuilt Ruby support"]
B --> C["rv_checksums for platforms"]
D["jruby/truffleruby detection"] --> E["Disable prebuilt Ruby"]
F["Psych 5.0.1 pinning"] --> G["Exclude from bundle fetch"]
C --> H["Enhanced Ruby toolchain"]
E --> H
G --> H
Loading
File Walkthrough
Relevant files
Bug fix
bazel.yml
Add jruby/truffleruby prebuilt Ruby workaround
.github/workflows/bazel.yml
Add conditional step to disable prebuilt Ruby for jruby and truffleruby
Use sed to remove excluded_gems and rv_version from MODULE.bazel
Workaround for rules_ruby incompatibility with alternative Ruby implementations
Below is a summary of compliance checks for this PR:
Security Compliance
⚪
Supply chain override
Description: The new git_override for rules_ruby fetches build tooling directly from https://github.com/bazel-contrib/rules_ruby by commit, which is a supply-chain risk if the upstream repository/commit is later found compromised and should be verified/approved per dependency governance. MODULE.bazel [37-41]
Generic: Robust Error Handling and Edge Case Management
Objective: Ensure comprehensive error handling that provides meaningful context and graceful degradation
Status: Sed portability risk: The new sed -i commands used to edit MODULE.bazel may fail or behave differently across runner environments (e.g., GNU vs BSD sed), which could cause non-graceful CI failures without a fallback path.
Referred Code
# Workaround for rules_ruby not handling rv-ruby and jruby/truffleruby properly
- name: Disable prebuilt Rubyif: startsWith(inputs.ruby-version, 'jruby') || startsWith(inputs.ruby-version, 'truffleruby')run: | sed -i '/^[[:space:]]*excluded_gems/d' MODULE.bazel sed -i '/^[[:space:]]*rv_version/d' MODULE.bazel
✅ Fix incorrect sed commandsSuggestion Impact:Instead of correcting the sed commands as suggested, the commit removed the entire "Disable prebuilt Ruby" workaround step (including the incorrect sed commands), eliminating the buggy behavior altogether.
code diff:
- # Workaround for rules_ruby not handling rv-ruby and jruby/truffleruby properly- - name: Disable prebuilt Ruby- if: startsWith(inputs.ruby-version, 'jruby') || startsWith(inputs.ruby-version, 'truffleruby')- run: |- sed -i '/^[[:space:]]*excluded_gems/d' MODULE.bazel- sed -i '/^[[:space:]]*rv_version/d' MODULE.bazel
Fix the sed commands to correctly remove the excluded_gems line and the multi-line rv_checksums block from MODULE.bazel. The current commands target a non-existent rv_version parameter and would not correctly remove the multi-line rv_checksums block.
run: |
sed -i '/^[[:space:]]*excluded_gems/d' MODULE.bazel
- sed -i '/^[[:space:]]*rv_version/d' MODULE.bazel+ sed -i '/^[[:space:]]*rv_checksums = {/,/^[[:space:]]*},/d' MODULE.bazel
[Suggestion processed]
Suggestion importance[1-10]: 9
__
Why: This suggestion correctly identifies a critical bug where the sed command targets the wrong parameter (rv_version instead of rv_checksums) and would fail to remove the multi-line block, causing build failures. The proposed fix is accurate and essential for the workflow's correctness.
High
High-level
✅ Avoid modifying build files in CISuggestion Impact:The workflow step "Disable prebuilt Ruby" that ran sed commands against MODULE.bazel was removed from .github/workflows/bazel.yml, aligning with the suggestion to avoid modifying build files in CI. The diff does not show any corresponding move of the logic into Bazel rules, only removal of the CI modification.
code diff:
- # Workaround for rules_ruby not handling rv-ruby and jruby/truffleruby properly- - name: Disable prebuilt Ruby- if: startsWith(inputs.ruby-version, 'jruby') || startsWith(inputs.ruby-version, 'truffleruby')- run: |- sed -i '/^[[:space:]]*excluded_gems/d' MODULE.bazel- sed -i '/^[[:space:]]*rv_version/d' MODULE.bazel
Instead of using sed in the CI workflow to modify MODULE.bazel for certain Ruby versions, this logic should be moved into the Bazel rules. This creates a more robust and declarative build process.
# .github/workflows/bazel.yml# The "Disable prebuilt Ruby" step is removed.# MODULE.bazel (remains declarative and unchanged by CI)ruby.toolchain(...rv_checksums = { ... },...)ruby.bundle_fetch(...excluded_gems = ["psych"],...)# The logic is moved into the bazel rules (e.g. a patched rules_ruby)# which would conditionally ignore `rv_checksums` and `excluded_gems`# based on the ruby version (e.g., jruby/truffleruby).
Suggestion importance[1-10]: 8
__
Why: The suggestion correctly identifies a brittle practice of modifying build files (MODULE.bazel) during CI and proposes a more robust, declarative solution, which significantly improves long-term maintainability.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
🔗 Related Issues
💥 What does this PR do?
🔧 Implementation Notes
💡 Additional Considerations
🔄 Types of changes
PR Type
Enhancement, Bug fix
Description
Use prebuilt Ruby with rv-ruby checksums for multiple platforms
Add workaround for rules_ruby incompatibility with jruby/truffleruby
Update rules_ruby git override to specific commit
Pin Psych gem to 5.0.1 and exclude from bundle fetch
Remove date gem checksums (handled by prebuilt Ruby)
Diagram Walkthrough
File Walkthrough
bazel.yml
Add jruby/truffleruby prebuilt Ruby workaround.github/workflows/bazel.yml
truffleruby
implementations
MODULE.bazel
Configure prebuilt Ruby and update gem dependenciesMODULE.bazel
macos-x86_64
Gemfile
Pin Psych gem version with documentationrb/Gemfile