Skip to content

Commit

Permalink
Merge pull request #55 from Scalingo/deps/54/upstream_v262
Browse files Browse the repository at this point in the history
Sync with upstream v262
  • Loading branch information
Frzk authored Nov 29, 2023
2 parents 2aba137 + b84fd18 commit a657791
Show file tree
Hide file tree
Showing 10 changed files with 112 additions and 13 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

## Main (unreleased)

## v262 (2023/11/08)

- Warn when relying on default Node.js or Yarn versions (https://github.com/heroku/heroku-buildpack-ruby/pull/1401)
- Warn when default Node.js or Yarn versions change (https://github.com/heroku/heroku-buildpack-ruby/pull/1401)

## v261 (2023/11/02)

- JRuby 9.4.5.0 is now available
- JRuby 9.3.13.0 is now available
- Default Node.js version now 20.9.0

## v260 (2023/10/23)

- JRuby 9.4.4.0 is now available
Expand Down
10 changes: 5 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GEM
remote: https://rubygems.org/
specs:
ci-queue (0.37.0)
ci-queue (0.38.0)
citrus (3.0.2)
connection_pool (2.4.1)
dead_end (4.0.0)
Expand Down Expand Up @@ -30,11 +30,11 @@ GEM
heroics (~> 0.1.1)
moneta (~> 1.0.0)
rate_throttle_client (~> 0.1.0)
rake (13.0.6)
rake (13.1.0)
rate_throttle_client (0.1.2)
redis (5.0.7)
redis-client (>= 0.9.0)
redis-client (0.17.0)
redis (5.0.8)
redis-client (>= 0.17.0)
redis-client (0.18.0)
connection_pool
rrrretry (1.0.0)
rspec-core (3.12.2)
Expand Down
12 changes: 11 additions & 1 deletion buildpack.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,17 @@ ruby_version = "3.1.4"
[publish]

[publish.Ignore]
files = ["spec/"]
files = [
"changelogs/",
"spec/",
"Gemfile",
"Gemfile.lock",
"Rakefile",
"app.json",
"hatchet.json",
"hatchet.lock",
"package.toml",
]

[[publish.Vendor]]
url = "https://heroku-buildpack-ruby.s3.us-east-1.amazonaws.com/heroku-20/ruby-3.1.4.tgz"
Expand Down
10 changes: 10 additions & 0 deletions changelogs/v261/jruby_9.3.13.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## JRuby version 9.3.13.0 is now available

[JRuby v9.3.13.0](/articles/ruby-support#ruby-versions) is now available on Heroku. To run
your app using this version of Ruby, add the following `ruby` directive to your Gemfile:

```ruby
ruby "2.6.8", engine: "jruby", engine_version: "9.3.13.0"
```

The JRuby release notes can be found on the [JRuby website](https://www.jruby.org/news).
10 changes: 10 additions & 0 deletions changelogs/v261/jruby_9.4.5.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## JRuby version 9.4.5.0 is now available

[JRuby v9.4.5.0](/articles/ruby-support#ruby-versions) is now available on Heroku. To run
your app using this version of Ruby, add the following `ruby` directive to your Gemfile:

```ruby
ruby "3.1.4", engine: "jruby", engine_version: "9.4.5.0"
```

The JRuby release notes can be found on the [JRuby website](https://www.jruby.org/news).
8 changes: 8 additions & 0 deletions changelogs/v261/node_20_9_0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## Ruby apps now default to Node version 20.9.0

Applications using the `heroku/ruby` buildpack that do not already have `node` installed by another buildpack (such as the `heroku/nodejs`
buildpack) will now receive:

- Node.js version 20.9.0 (was previously 16.18.1)

These versions and instructions on how to specify a specific version of these binaries can be found on the [installed binaries section of the Heroku Ruby Support page](https://devcenter.heroku.com/articles/ruby-support#installed-binaries).
13 changes: 7 additions & 6 deletions lib/language_pack/helpers/nodebin.rb
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
require 'json'

class LanguagePack::Helpers::Nodebin
NODE_VERSION = "20.9.0"
YARN_VERSION = "1.22.19"

def self.hardcoded_node_lts
version = "16.18.1"
{
"number" => version,
"url" => "https://heroku-nodebin.s3.us-east-1.amazonaws.com/node/release/linux-x64/node-v#{version}-linux-x64.tar.gz"
"number" => NODE_VERSION,
"url" => "https://heroku-nodebin.s3.us-east-1.amazonaws.com/node/release/linux-x64/node-v#{NODE_VERSION}-linux-x64.tar.gz"
}
end

def self.hardcoded_yarn
version = "1.22.19"
{
"number" => version,
"url" => "https://heroku-nodebin.s3.us-east-1.amazonaws.com/yarn/release/yarn-v#{version}.tar.gz"
"number" => YARN_VERSION,
"url" => "https://heroku-nodebin.s3.us-east-1.amazonaws.com/yarn/release/yarn-v#{YARN_VERSION}.tar.gz"
}
end

Expand Down
46 changes: 46 additions & 0 deletions lib/language_pack/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1019,6 +1019,29 @@ def add_node_js_binary
if Pathname(build_path).join("package.json").exist? ||
bundler.has_gem?('execjs') ||
bundler.has_gem?('webpacker')

version = @node_installer.version
old_version = @metadata.fetch("default_node_version") { version }

if version != version
warn(<<~WARNING, inline: true)
Default version of Node.js changed (#{old_version} to #{version})
WARNING
end

warn(<<~WARNING, inline: true)
Installing a default version (#{version}) of Node.js.
This version is not pinned and can change over time, causing unexpected failures.
Scalingo recommends leveraging the multi-buildpack with
`https://github.com/Scalingo/nodejs-buildpack.git` and
`https://github.com/Scalingo/ruby-buildpack.git`
as it offers more comprehensive Node.js support, including the ability
to customise the Node.js version.
See https://doc.scalingo.com/platform/deployment/buildpacks/multi for further details.
WARNING

[@node_installer.binary_path]
else
[]
Expand All @@ -1029,6 +1052,29 @@ def add_yarn_binary
return [] if yarn_preinstalled?

if Pathname(build_path).join("yarn.lock").exist? || bundler.has_gem?('webpacker')

version = @yarn_installer.version
old_version = @metadata.fetch("default_yarn_version") { version }

if version != version
warn(<<~WARNING, inline: true)
Default version of Yarn changed (#{old_version} to #{version})
WARNING
end

warn(<<~WARNING, inline: true)
Installing a default version (#{version}) of Yarn
This version is not pinned and can change over time, causing unexpected failures.
Scalingo recommends leveraging the multi-buildpack with
`https://github.com/Scalingo/nodejs-buildpack.git` and
`https://github.com/Scalingo/ruby-buildpack.git`
as it offers more comprehensive Node.js support, including the ability
to customise the Node.js version.
See https://doc.scalingo.com/platform/deployment/buildpacks/multi for further details.
WARNING

[@yarn_installer.name]
else
[]
Expand Down
2 changes: 1 addition & 1 deletion lib/language_pack/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

module LanguagePack
class LanguagePack::Base
BUILDPACK_VERSION = "v260"
BUILDPACK_VERSION = "v262"
end
end
3 changes: 3 additions & 0 deletions spec/hatchet/node_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
expect(app.output).to include("bin/node is the node directory")
expect(app.output).to_not include(".heroku/node/bin/node is the node directory")

expect(app.output).to include("Installing a default version (#{LanguagePack::Helpers::Nodebin::YARN_VERSION}) of Yarn")
expect(app.output).to include("Installing a default version (#{LanguagePack::Helpers::Nodebin::NODE_VERSION}) of Node.js")

expect(app.run("which node")).to match("/app/bin/node") # We put node in bin/node
expect(app.run("which yarn")).to match("/app/vendor/yarn-") # We put yarn in /app/vendor/yarn-
end
Expand Down

0 comments on commit a657791

Please sign in to comment.