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.
Migrate Cloud Foundry Java Buildpack to Ruby 3.4.7
Summary
Migrates the buildpack from Ruby 2.5.9 (released 2019, EOL 2021) to Ruby 3.4.7,
as ruby 2.x does not compile anymore on newer machines due to openssl incompatibility.
so local development was harder..
this is also addressing breaking changes in Psych 4.0+ YAML loading, REXML XML parsing,
adding required standard library gems, and modernizing the codebase for current Ruby best practices.
Changes Overview
28 files changed, 112 insertions(+), 104 deletions(-)
This PR includes 6 focused commits that systematically address Ruby 3.4 compatibility:
Key Technical Changes
1. Psych 4.0+ YAML Loading Security
Ruby 3.1+ ships with Psych 4.0, which changed YAML.load_file behavior for security:
Before (Ruby 2.x with Psych 3.x)
YAML.load_file(file)
After (Ruby 3.x with Psych 4.x)
YAML.load_file(file, permitted_classes: [Symbol], aliases: true)
Files updated:
• lib/java_buildpack/util/configuration_utils.rb
• lib/java_buildpack/repository/repository_index.rb
• lib/java_buildpack/framework/multi_buildpack.rb
2. Standard Library Gems
Ruby 3.4+ removed several gems from the default bundle. Added to Gemfile:
• base64 - Base64 encoding/decoding
• bigdecimal - Arbitrary precision decimals
• digest - Cryptographic hash functions
• set - Set data structure
• tmpdir - Temporary directory utilities
3. REXML XML Parsing
Ruby 3.4 changed REXML behavior:
• Empty XML documents now require explicit declaration creation
• Formatters strip trailing whitespace from text nodes
Fixed: lib/java_buildpack/container/tomcat/tomcat_geode_store.rb
4. RuboCop Toolchain Update
• Updated from 1.28.2 → 1.81.7 (Ruby 3.4 support)
• Added racc gem (required by parser)
• Updated rubocop-rspec 2.10.0 → 3.8.0
• Modernized .rubocop.yml configuration
5. Platform Support Update
Updated supported Ubuntu platforms for LTS lifecycle compliance:
• Removed: bionic (Ubuntu 18.04 - EOL April 2023)
• Kept: jammy (Ubuntu 22.04 LTS - support until 2027)
• Added: noble (Ubuntu 24.04 LTS - support until 2029)
Updated 10 documentation files with current platform examples.
6. CI Docker Environment
Updated ci/Dockerfile:
• Base image: ubuntu:bionic → ubuntu:jammy
• Ruby versions: Single version (3.4.7) instead of four (2.5.9, 2.7.6, 3.0.4, 3.1.3)
• Dependencies: Added libffi-dev, libyaml-dev for Ruby 3.4 compilation
• Python: python → python3 (Python 2 removed from jammy)
• SSL: libssl1.0-dev → libssl-dev (jammy compatibility)
Benefits: Faster builds, smaller images, aligned with buildpack requirements
Testing
All 972 non-integration tests passing ✅
Finished in 2.3 seconds
972 examples, 0 failures
Comprehensive test coverage includes:
• Core buildpack functionality (127 examples)
• Container specs (121 examples)
• Framework specs (200+ examples)
• JRE specs (39 examples)
• Utility specs (266 examples)
• Download cache specs (28 examples)
Docker CI image verified: Successfully builds with Ruby 3.4.7 (983MB)
Breaking Changes
None for buildpack users. This is an internal Ruby version update that maintains full backward compatibility for Java applications deployed with the buildpack.
For buildpack developers:
• Ruby 3.4.7+ now required for development
• RuboCop updated (may flag new style issues)
• CI environment updated to Ubuntu Jammy
Pre-existing Issues Fixed
During migration, discovered and fixed two unrelated bugs: