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

Add support for pre-release ruby versions #372

Merged
merged 3 commits into from
Dec 16, 2024
Merged

Conversation

schneems
Copy link
Contributor

Pre-releases in ruby use either - or . and touch the last number, versus patch identifiers start with p. This commit now captures identifiers such as .rc1 or .preview2

The state of tooling is confusing, as different tools manipulate values differently:

$ cat Gemfile
source 'https://rubygems.org'
ruby "3.4.0-rc1"
gem 'rake'
⛄️ 3.4.0 🚀 /private/tmp/aa82068ba3124d84c76d7faf156888a5 (main)
$ cat Gemfile.lock
GEM
  remote: https://rubygems.org/
  specs:
    rake (13.2.1)

PLATFORMS
  arm64-darwin-23
  ruby

DEPENDENCIES
  rake

RUBY VERSION
   ruby 3.4.0.rc1

BUNDLED WITH
   2.5.23

Here's some more context:

Our versions are stored on S3 like this:

s3://heroku-buildpack-ruby/heroku-24/arm64/ruby-3.4.0.rc1.tgz

Pre-releases in ruby use either `-` or `.` and touch the last number, versus patch identifiers start with `p`. This commit now captures identifiers such as `.rc1` or `.preview2`

The state of tooling is confusing, as different tools manipulate values differently:

```
$ cat Gemfile
source 'https://rubygems.org'
ruby "3.4.0-rc1"
gem 'rake'
⛄️ 3.4.0 🚀 /private/tmp/aa82068ba3124d84c76d7faf156888a5 (main)
$ cat Gemfile.lock
GEM
  remote: https://rubygems.org/
  specs:
    rake (13.2.1)

PLATFORMS
  arm64-darwin-23
  ruby

DEPENDENCIES
  rake

RUBY VERSION
   ruby 3.4.0.rc1

BUNDLED WITH
   2.5.23
```

Here's some more context:

- https://github.com/heroku/docker-heroku-ruby-builder/blob/175b5c15104cb809e1a0adc2c2a9902f94083954/lib/version_parts.rb#L1-L57
- https://github.com/heroku/docker-heroku-ruby-builder/blob/a41f31c72a74df6bcb4f9266e12192b0af83da98/shared/src/download_ruby_version.rs#L73-L93

Our versions are stored on S3 like this:

```
s3://heroku-buildpack-ruby/heroku-24/arm64/ruby-3.4.0.rc1.tgz
```
@schneems schneems force-pushed the schneems/ruby-pre-release branch from 65637ba to eef02fb Compare December 13, 2024 23:14
@schneems schneems marked this pull request as ready for review December 13, 2024 23:21
@schneems schneems requested a review from a team as a code owner December 13, 2024 23:21
commons/src/gemfile_lock.rs Show resolved Hide resolved
@schneems schneems merged commit ef32c0b into main Dec 16, 2024
6 checks passed
@schneems schneems deleted the schneems/ruby-pre-release branch December 16, 2024 15:11
heroku-linguist bot added a commit that referenced this pull request Dec 16, 2024
## heroku/ruby

### Fixed

- Ruby pre-release verssions like `3.4.0.rc1` now work as expected. ([#372](#372))
- Layer metadata deserialization to Rust structs is now using `#[serde(deny_unknown_fields)]` this prevents the accidental scenario where metadata containing a superset of fields could accidentally be deserialized to the wrong struct. It's unlikely this is currently happening with the current buildpack, but it's a possibly-observable difference so it's being listed ([#371](#371))
@heroku-linguist heroku-linguist bot mentioned this pull request Dec 16, 2024
heroku-linguist bot added a commit to heroku/cnb-builder-images that referenced this pull request Dec 16, 2024
## heroku/ruby

### Fixed

- Ruby pre-release verssions like `3.4.0.rc1` now work as expected. ([#372](heroku/buildpacks-ruby#372))
- Layer metadata deserialization to Rust structs is now using `#[serde(deny_unknown_fields)]` this prevents the accidental scenario where metadata containing a superset of fields could accidentally be deserialized to the wrong struct. It's unlikely this is currently happening with the current buildpack, but it's a possibly-observable difference so it's being listed ([#371](heroku/buildpacks-ruby#371))
heroku-linguist bot added a commit to heroku/cnb-builder-images that referenced this pull request Dec 16, 2024
## heroku/ruby

### Fixed

- Ruby pre-release verssions like `3.4.0.rc1` now work as expected. ([#372](heroku/buildpacks-ruby#372))
- Layer metadata deserialization to Rust structs is now using `#[serde(deny_unknown_fields)]` this prevents the accidental scenario where metadata containing a superset of fields could accidentally be deserialized to the wrong struct. It's unlikely this is currently happening with the current buildpack, but it's a possibly-observable difference so it's being listed ([#371](heroku/buildpacks-ruby#371))

Co-authored-by: heroku-linguist[bot] <136119646+heroku-linguist[bot]@users.noreply.github.com>
@schneems schneems restored the schneems/ruby-pre-release branch December 16, 2024 22:04
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.

2 participants