Skip to content

Conversation

@aramprice
Copy link
Member

@aramprice aramprice commented Dec 5, 2025

This PR adds a workflow to test the execution of the embedded ruby code against Rubies >= 2.6

The spec will not pass against Ruby > 3.4 because the ostruct gem required by the code is no longer part of the default gemset.

NOTE: the bosh-cli currently relies on whichever ruby executable is found in its $PATH when invoked, and does not have the capacity to install gems.

@aramprice aramprice moved this from Inbox to Pending Review | Discussion in Foundational Infrastructure Working Group Dec 11, 2025
@aramprice aramprice requested review from a team, KauzClay and julian-hj and removed request for a team December 11, 2025 16:11
@rkoster rkoster requested a review from Copilot December 18, 2025 15:50
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a comprehensive Ruby testing infrastructure to validate embedded Ruby code execution across multiple Ruby versions (2.6 through head) and operating systems. The workflow addresses a known compatibility issue where Ruby versions > 3.4 no longer include the ostruct gem in the default gemset.

Key Changes:

  • Added GitHub Actions workflow to test Ruby code against versions 2.6 through head
  • Created RSpec test suite with specs for ERBRenderer initialization and rendering
  • Modernized erb_renderer.rb with style improvements and safer Ruby patterns

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
.github/workflows/ruby.yml Defines CI workflow to run specs across Ruby 2.6-head and ubuntu/macos
templatescompiler/erbrenderer/Gemfile Adds test dependencies (rspec, standardrb, rake)
templatescompiler/erbrenderer/Rakefile Configures rake tasks for running specs and linting
templatescompiler/erbrenderer/.gitignore Excludes Gemfile.lock from version control
templatescompiler/erbrenderer/spec/spec_helper.rb Sets up RSpec test environment and load paths
templatescompiler/erbrenderer/spec/erb_renderer_spec.rb Adds test coverage for ERBRenderer initialization and template rendering
templatescompiler/erbrenderer/erb_renderer.rb Applies style improvements, modernizes Ruby patterns (alias_method, File.write, JSON.load_file)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1 to +7
source "https://rubygems.org"

group :test do
gem "rake"
gem "rspec"
gem "standardrb"
end
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

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

The Gemfile does not include the 'ostruct' gem, which is required by erb_renderer.rb. According to the PR description, the code will not pass against Ruby > 3.4 because ostruct is no longer part of the default gemset. To ensure compatibility with Ruby > 3.4, add 'gem "ostruct"' to the Gemfile.

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

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

This Gemfile is intended only for testing, and can not require gems for "production" execution of the embedded ruby code so this omission is expected, and intentional.

Copy link
Member Author

Choose a reason for hiding this comment

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

@rkoster - would you care to resolve this for the robot, or shall I?

@aramprice aramprice changed the title Add Ruby workflow for embeded ruby code Add Ruby workflow for embedded ruby code Dec 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Pending Review | Discussion

Development

Successfully merging this pull request may close these issues.

1 participant