Skip to content

Conversation

@dnorth98
Copy link
Contributor

@dnorth98 dnorth98 commented Jan 28, 2026

Summary

  • Upgrade AWS Lambda Ruby runtime from 3.2 to 3.4
  • AWS Lambda added Ruby 3.4 support in March 2025 and it's available in all regions
  • Update all Ruby version references across configuration files
  • Update gem dependencies via bundle update
  • Add RSpec tests with coverage reporting

Changes

File Change
template.yml Runtime and CompatibleRuntimes: ruby3.2ruby3.4
.ruby-version 3.2.23.4.1
lambda_layer/Makefile RUBY_VERSION = 3.2.03.4.0
.rubocop.yml TargetRubyVersion: 3.23.4, exclude lambda_layer/
.github/workflows/style.yml Updated Ruby version to 3.4.1
README.md Updated tested Ruby version
Gemfile Added rspec, aws-sdk-ssm, simplecov for testing
Gemfile.lock Updated dependencies

New: RSpec Tests

Added unit tests for src/lambda.rb with coverage reporting:

  • get_ssm_parameter - retrieves parameters with decryption
  • update_ssm_parameter - updates parameters with overwrite
  • github_token_from_ssm - fetches GitHub token from SSM
  • last_time_checked_from_ssm - returns stored timestamp or defaults to 1 day ago

Why auditor.rb is not covered: The auditor script is written in a procedural style that executes top-to-bottom when loaded, making it difficult to unit test without refactoring into a class. The lambda.rb functions are well-structured and provide the critical SSM integration logic. Adding tests for auditor.rb would require refactoring it into a testable class structure, which is out of scope for this PR.

Compatibility

The codebase was reviewed and is compatible with Ruby 3.4:

  • Uses frozen_string_literal: true
  • No deprecated keyword argument patterns
  • No removed methods or syntax

Test plan

  • bundle install succeeds
  • bundle exec rubocop passes with no offenses
  • bundle exec rspec passes (5 examples, 0 failures)
  • Coverage reporting works (72% line coverage)
  • ruby -c syntax check passes
  • make build succeeds with new runtime
  • Deploy and verify Lambda executes correctly

🤖 Generated with Claude Code

AWS Lambda added Ruby 3.4 support in March 2025.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@dnorth98 dnorth98 requested a review from a team as a code owner January 28, 2026 15:13
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@stairsj
Copy link

stairsj commented Jan 28, 2026

@dnorth98 if we are going to be keeping this function we should be adding in rspec tests.

- Add RSpec tests for lambda.rb functions
- Add SimpleCov for coverage reporting
- Add CI workflow for tests with coverage threshold
- Exclude lambda_layer from rubocop

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions
Copy link

Simplecov Report

Covered Threshold
72.72% 70%

Add minimal permissions block to satisfy CodeQL security scanning.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@dnorth98 dnorth98 merged commit 235ae37 into main Jan 28, 2026
7 checks passed
@dnorth98 dnorth98 deleted the feature/dnorth/update_ruby_3.4 branch January 28, 2026 15:50
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.

2 participants