Fix Ruby SSI deployment lockfiles#7174
Draft
lloeki wants to merge 3 commits into
Draft
Conversation
Move the Ruby SSI Rails sample apps to dispatch Gemfiles with committed per-Ruby lockfiles. This makes each runtime use a reproducible dependency graph instead of sharing one lockfile across the matrix. Keep Ruby 3.1 on i18n < 1.15 because i18n 1.15.0 advertises Ruby 3.1 support but uses Fiber.[], which is only available on Ruby 3.2 and newer.
Select the lockfile matching the installed Ruby minor before running Bundler in Ruby SSI and lib-injection Rails Dockerfiles. This keeps deployment mode realistic while avoiding bundle lock --update during image builds, which made the apps resolve newly published transitive dependencies from Rubygems.
Re-enable RB31 for ruby-app-deployment-mode now that the Dockerfiles install from committed per-Ruby lockfiles instead of updating dependencies during image builds.
Contributor
|
|
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
ruby-app-deployment-modewas temporarily disabled on Ruby 3.1 because the deployment-mode Dockerfile ranbundle lock --updateduring image builds. That made the test app resolve latest transitive dependencies from Rubygems and pick upi18n 1.15.0, which advertises Ruby 3.1 support but usesFiber.[], a Ruby 3.2+ API.These SSI apps should be reproducible and should not update dependency graphs while building test images.
Changes
gemfiles/.Gemfilefiles as convenience dispatch shims based on the current Ruby minor.i18n < 1.15only for the Ruby 3.1 Rails 7 app lockfile.bundle install.bundle lock --updatepath from deployment-mode Dockerfiles.RB31forruby-app-deployment-modein the Docker SSI matrix.Validation
python3 -m json.tool utils/scripts/ci_orchestrators/docker_ssi.jsongit diff --check origin/main...HEADghcr.io/datadog/images-rb/engines/ruby:<minor>images.i18n 1.14.8:docker run ... ghcr.io/datadog/images-rb/engines/ruby:3.1 ... bundle config set --local deployment true && bundle install && bundle exec ruby -e ...lib-injection/build/docker/ruby/dd-lib-ruby-init-test-rails-bundle-deploy/Dockerfilesuccessfully.nix develop -c bash -lc "unset IN_NIX_SHELL; ./format.sh --check"gets through mypy and ruff, then fails on an unrelated pre-existingyamlfmtdiff inmanifests/python.yml.Workflow
🚀 Once your PR is reviewed and the CI green, you can merge it!
🛟 #apm-shared-testing 🛟
Reviewer checklist
tests/ormanifests/is modified ? I have the approval from R&P teambuild-XXX-imagelabel is present