Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schneems/remove deprecated interfaces #338

Closed
wants to merge 38 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
01dc6aa
Switch to struct API
schneems Oct 30, 2024
bfe31af
Remove unused import
schneems Oct 30, 2024
b74d649
Remove deprecation allowance
schneems Oct 30, 2024
d8cb9ec
Deprecate api for configuring environment variables
schneems Oct 30, 2024
13c2890
Rename metadata struct
schneems Oct 30, 2024
20bad91
Make metadata internals accessible and PartialEq
schneems Oct 30, 2024
a8ac879
Replace layer trait with struct layer
schneems Oct 30, 2024
4f6a36a
Remove deprecation allowance
schneems Oct 30, 2024
cff989b
Remove unused code
schneems Oct 30, 2024
26c9841
Move Metadata struct
schneems Oct 30, 2024
d5fa831
Remove previously deprecated interface
schneems Oct 30, 2024
ed5cd8f
Deprecate BuildLog
schneems Oct 31, 2024
9aff821
Remove style guide (since it's deprecated)
schneems Oct 31, 2024
ea77d73
Allow deprecated in internal code
schneems Oct 31, 2024
6db4696
Deprecate fmt
schneems Oct 31, 2024
25abfd7
Deprecate section log
schneems Oct 31, 2024
ddca26b
Replace output constant with bulletstream style
schneems Oct 31, 2024
f7452f7
Replace output fmt functions with bulletstream style
schneems Oct 31, 2024
5adbe9b
Replace output module with bullet_stream
schneems Oct 31, 2024
5f9cff6
Pass bullet_stream to error output
schneems Oct 31, 2024
13e3e4b
Replace output with bullet_stream
schneems Oct 31, 2024
ad97562
Replace output with bullet_stream
schneems Oct 31, 2024
5f6688c
Replace output with bullet_stream
schneems Oct 31, 2024
b643d1d
Replace output with bullet_stream
schneems Oct 31, 2024
9ba83b4
Replace output with bullet_stream
schneems Oct 31, 2024
75606bf
Replace output with bullet_stream
schneems Oct 31, 2024
3c5676f
Replace output with bullet_stream
schneems Oct 31, 2024
0dfa291
Prepare to update debug command invocation
schneems Oct 31, 2024
fbbf0c6
Update debug_cmd calls to use bullet_stream
schneems Oct 31, 2024
32b3d19
Update debug_cmd calls to use bullet_stream
schneems Oct 31, 2024
eb9c4fe
Remove unused code
schneems Oct 31, 2024
b23df6c
Remove unused imports
schneems Oct 31, 2024
ab48f13
Clippy
schneems Oct 31, 2024
53626f7
Indentation
schneems Oct 31, 2024
3b245f5
Indentation
schneems Oct 31, 2024
b4d1894
Indentation
schneems Oct 31, 2024
029fc3d
Indentation
schneems Oct 31, 2024
32ab2b7
Indentation
schneems Oct 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,19 +95,3 @@ jobs:
run: pack build my-image --force-color --builder heroku/builder:24 --trust-extra-buildpacks --buildpack heroku/nodejs-engine --buildpack packaged/${{ matrix.target }}/debug/heroku_ruby --path tmp/ruby-getting-started --pull-policy never
- name: "PRINT: Cached getting started guide output"
run: pack build my-image --force-color --builder heroku/builder:24 --trust-extra-buildpacks --buildpack heroku/nodejs-engine --buildpack packaged/${{ matrix.target }}/debug/heroku_ruby --path tmp/ruby-getting-started --pull-policy never

print-style-guide:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install musl-tools
run: sudo apt-get install musl-tools --no-install-recommends
- name: Update Rust toolchain
run: rustup update
- name: Install Rust linux-musl target
run: rustup target add x86_64-unknown-linux-musl
- name: Rust Cache
uses: Swatinem/[email protected]
- name: "PRINT: Style guide"
run: cargo run --quiet --bin print_style_guide
49 changes: 28 additions & 21 deletions buildpacks/ruby/src/steps/default_env.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use crate::{RubyBuildpack, RubyBuildpackError};
use commons::layer::DefaultEnvLayer;
use libcnb::layer::UncachedLayerDefinition;
use libcnb::layer_env::{LayerEnv, ModificationBehavior};
use libcnb::{
build::BuildContext,
data::{layer_name, store::Store},
Expand All @@ -9,7 +10,6 @@ use libcnb::{
use rand::Rng;

// Set default environment values
#[allow(deprecated)]
pub(crate) fn default_env(
context: &BuildContext<RubyBuildpack>,
platform_env: &Env,
Expand All @@ -24,25 +24,32 @@ pub(crate) fn default_env(
}

let (default_secret_key_base, store) = fetch_secret_key_base_from_store(&context.store);

let env_defaults_layer = context //
.handle_layer(
layer_name!("env_defaults"),
DefaultEnvLayer::new(
[
("SECRET_KEY_BASE", default_secret_key_base.as_str()),
("JRUBY_OPTS", "-Xcompile.invokedynamic=false"),
("RACK_ENV", "production"),
("RAILS_ENV", "production"),
("RAILS_SERVE_STATIC_FILES", "enabled"),
("RAILS_LOG_TO_STDOUT", "enabled"),
("MALLOC_ARENA_MAX", "2"),
("DISABLE_SPRING", "1"),
]
.into_iter(),
),
)?;
env = env_defaults_layer.env.apply(Scope::Build, &env);
let layer_ref = context.uncached_layer(
layer_name!("env_defaults"),
UncachedLayerDefinition {
build: true,
launch: true,
},
)?;
let env = layer_ref
.write_env({
[
("SECRET_KEY_BASE", default_secret_key_base.as_str()),
("JRUBY_OPTS", "-Xcompile.invokedynamic=false"),
("RACK_ENV", "production"),
("RAILS_ENV", "production"),
("RAILS_SERVE_STATIC_FILES", "enabled"),
("RAILS_LOG_TO_STDOUT", "enabled"),
("MALLOC_ARENA_MAX", "2"),
("DISABLE_SPRING", "1"),
]
.iter()
.fold(LayerEnv::new(), |layer_env, (name, value)| {
layer_env.chainable_insert(Scope::All, ModificationBehavior::Default, name, value)
})
})
.and_then(|()| layer_ref.read_env())?
.apply(Scope::Build, &env);

Ok((env, store))
}
Expand Down
Loading