Skip to content

Feature/ruby 3.1.6#43

Open
c-badilla-manta wants to merge 6 commits intofeature/support-systemdfrom
feature/ruby-3.1.6
Open

Feature/ruby 3.1.6#43
c-badilla-manta wants to merge 6 commits intofeature/support-systemdfrom
feature/ruby-3.1.6

Conversation

@c-badilla-manta
Copy link
Copy Markdown

@c-badilla-manta c-badilla-manta commented Oct 22, 2025

Pull Request: Upgrade Ploy to Ruby 3.1.6 with Modern Dependencies

@mantacode/tech-pr

Description of Changes

This PR modernizes the ploy deployment tool with the following major changes:

Ruby and Dependency Upgrades

  • Ruby version: Upgraded from 2.4.4 to 3.1.6
  • AWS SDK: Migrated from deprecated aws-sdk-v1 (1.64) to modern AWS SDK gems:
    • aws-sdk-s3 (~> 1.140)
    • aws-sdk-ec2 (~> 1.450)
  • Core dependencies:
    • fpm: 1.12.0 → 1.15.1
    • sinatra: 1.4.6 → ~> 2.2
    • nokogiri: 1.10.0 → ~> 1.15
    • rspec: upgraded to ~> 3.12
    • Added rexml and webrick for Ruby 3.0+ compatibility

New Features

  • Systemd support: Added support for systemd service files alongside existing upstart support
    • New configuration options: systemd_files and mnt_log_path
    • When both upstart and systemd files are present, systemd is preferred
    • Automatic log directory creation for systemd services

Code Improvements

  • S3Storage refactor: Complete rewrite to use modern AWS SDK v3 API
    • Updated put, copy, read, get, metadata, and list methods
    • Better error handling with AWS SDK v3 patterns
  • MetaOracle refactor: Updated to use AWS SDK v3 EC2 Resource API
  • Sinatra syntax: Updated deprecated hash rocket syntax for settings
  • Missing require: Added missing require 'ploy/package' in packageset.rb

Testing

  • New test coverage: Added comprehensive specs for:
    • command/bless_spec.rb - blessing packages by deployment/branch/version
    • command/build_spec.rb - building packages with custom configs
    • Extended debbuilder_spec.rb with systemd tests
    • Extended metaoracle_spec.rb and s3storage_spec.rb with proper mocking

Infrastructure

  • Created separate gemspecs for this Ruby version:
    • ploy-3.1.6.gemspec (version 0.0.46)
  • Updated .travis.yml to use Ruby 3.1.6
  • Added .ruby-version file

Zenhub Card

[Add your Zenhub card link here]

Dependencies

  • Requires Ruby 3.1.6 (gemspec enforces >= 3.1.0)
  • AWS SDK v3 gems (breaking change from v1)
  • FPM 1.15.1+
  • All other dependencies specified in Gemfile.lock

Testing

Unit Tests

All existing tests have been updated and new tests added:

  • ✅ Systemd service file handling
  • ✅ AWS SDK v3 compatibility
  • ✅ Command specs for bless and build operations
  • ✅ Proper mocking to prevent real AWS calls during tests

Manual Testing Required

  • Verify systemd service installation on Ubuntu systems
  • Test AWS S3 upload/download operations
  • Verify package blessing workflow
  • Test both systemd and upstart deployment scenarios

Breaking Changes

⚠️ This is a breaking change due to:

  1. Ruby version requirement bump (2.4.4 → 3.1.6)
  2. AWS SDK v1 → v3 migration (different API)
  3. Configuration changes for systemd support

Migration Notes

Users upgrading will need to:

  1. Upgrade Ruby to 3.1.0 or higher
  2. Update any direct AWS SDK usage to v3 API
  3. Optionally add systemd_files and mnt_log_path to .ploy-publisher.yml for systemd support

Deployment / Merge Strategy ⚠️

This change cannot be merged into the master branch immediately.

A coordinated rollout is required because the upgraded Ploy tool requires Ruby 3.1.6, which is a breaking change for our CI/CD and deployment environments.

Required Pre-Merge Actions

  1. Travis CI Updates: All repository .travis.yml files that use Ploy must be updated to explicitly use Ruby 3.1.6 for deployment steps.
  2. AMI Image Updates: Our base AMI images, which download Ploy from RubyGems upon boot/provisioning, must be upgraded to have Ruby 3.1.6 installed as the default or compatible Ruby environment.

This PR should be merged only after the widespread infrastructure changes (Travis and AMIs) are complete and validated in a non-production environment.

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