diff --git a/buildpacks/ruby/src/layers/bundle_install_layer.rs b/buildpacks/ruby/src/layers/bundle_install_layer.rs index ad64798a..833c99bf 100644 --- a/buildpacks/ruby/src/layers/bundle_install_layer.rs +++ b/buildpacks/ruby/src/layers/bundle_install_layer.rs @@ -231,7 +231,7 @@ impl Layer for BundleInstallLayer<'_> { match cache_state(old.clone(), now) { Changed::Nothing => { - log_step("Loading cache"); + log_step("Loading cached gems"); keep_and_run } diff --git a/buildpacks/ruby/src/layers/ruby_install_layer.rs b/buildpacks/ruby/src/layers/ruby_install_layer.rs index a1641d47..cd6f90cd 100644 --- a/buildpacks/ruby/src/layers/ruby_install_layer.rs +++ b/buildpacks/ruby/src/layers/ruby_install_layer.rs @@ -159,7 +159,7 @@ impl<'a> Layer for RubyInstallLayer<'a> { match cache_state(old.clone(), now) { Changed::Nothing => { - log_step("Using cached version"); + log_step("Using cached Ruby version"); Ok(ExistingLayerStrategy::Keep) } diff --git a/buildpacks/ruby/src/target_id.rs b/buildpacks/ruby/src/target_id.rs index b58759ee..974f252e 100644 --- a/buildpacks/ruby/src/target_id.rs +++ b/buildpacks/ruby/src/target_id.rs @@ -9,8 +9,8 @@ pub(crate) struct TargetId { } const DISTRO_VERSION_STACK: &[(&str, &str, &str)] = &[ + ("ubuntu", "20.04", "heroku-20"), ("ubuntu", "22.04", "heroku-22"), - ("ubuntu", "24.04", "heroku-24"), ]; #[derive(Debug, thiserror::Error)] diff --git a/buildpacks/ruby/tests/integration_test.rs b/buildpacks/ruby/tests/integration_test.rs index 61decac6..44ef78a9 100644 --- a/buildpacks/ruby/tests/integration_test.rs +++ b/buildpacks/ruby/tests/integration_test.rs @@ -11,6 +11,34 @@ use std::thread; use std::time::{Duration, Instant}; use ureq::Response; +// Test that: +// - Cached data "stack" is preserved and will be successfully migrated to "targets" +#[test] +#[ignore = "integration test"] +fn test_migrating_metadata() { + let builder = "heroku/builder:22"; + let app_dir = "tests/fixtures/default_ruby"; + + TestRunner::default().build( + BuildConfig::new(builder, app_dir).buildpacks([BuildpackReference::Other( + "docker://docker.io/heroku/buildpack-ruby:2.1.2".to_string(), + )]), + |context| { + println!("{}", context.pack_stdout); + context.rebuild( + BuildConfig::new(builder, app_dir).buildpacks([BuildpackReference::CurrentCrate]), + |rebuild_context| { + println!("{}", rebuild_context.pack_stdout); // Needed to get full failure as `rebuild` truncates stdout + + assert_contains!(rebuild_context.pack_stdout, "Using cached Ruby version"); + assert_contains!(rebuild_context.pack_stdout, "Loading cached gems"); + panic!("disco"); + }, + ); + }, + ); +} + #[test] #[ignore = "integration test"] fn test_default_app() {