Skip to content

Conversation

@Frzk
Copy link

@Frzk Frzk commented Mar 20, 2025

Related to #100

schneems and others added 5 commits March 3, 2025 22:11
…1551)

* Add a mechanism for documenting Ruby versions via automation

Our current deploy process looks like this for releasing a Ruby version:

- Manually make a PR to the Ruby buildpack with the version in the changelog
- Get it approved by another engineer
- PreRelease the buildpack via automation
- Merge the pre-release PR
- Pull changes locally and run deploy command `bundle exec rake buildpack:release`
- Then trigger S3 changes via running automations on https://github.com/heroku/docker-heroku-ruby-builder

In the future there's a desire to have the https://github.com/heroku/docker-heroku-ruby-builder generate an "inventory" file that tracks binary checksums and then the buildpack will require a PR to utilize new versions. However, that's a non-trivial amount of work and Ruby versions keep getting released on Fridays when I'm on vacation and no one else is around.

With this change the process can look like this:

- Trigger this new workflow which updates the CHANGELOG.md and runs the pre-release automation in one
- Merge that PR
- Pull changes locally and run deploy command `bundle exec rake buildpack:release`
- Then trigger S3 changes via running automations on https://github.com/heroku/docker-heroku-ruby-builder

Which is a substantial workflow savings. This task can be removed once we implement the full inventory workflow (sometime in the vague future), but this is a quality of life upgrade for the short term.

* Apply suggestions from code review

Co-authored-by: Ed Morley <[email protected]>

---------

Co-authored-by: Ed Morley <[email protected]>
* Add the ruby version to the current release

This task runs after the new version is injected into the CHANGELOG. That means that if we add something under "unreleased" at this point, then it shows up in the wrong section. This commit fixes it.

* Remove extra trailing newline
* Update default Ruby version to 3.3.6

The latest Ruby is now 3.4.x. Our ideal default policy is to use the latest release of the prior year's version. This PR updates to the latest Ruby 3.3.x version which is 3.3.6.

* Update to non-deprecated method

* Ruby 3.3.7 is now the default

* Update test apps

* s/exists?/exist?/

Fixes:

```
       -----> Building on the Heroku-24 stack
       -----> Fetching https://github.com/heroku/heroku-buildpack-ruby#schneems/default-ruby-336 buildpack...
              buildpack downloaded
       -----> Ruby app detected
       
        !
        !     undefined method `exists?' for class Dir
        !
       /tmp/buildpacks/55030ecaa578151bf5924184e8750b99212faef5/lib/language_pack/helpers/bundler_wrapper.rb:242:in `fetch_bundler': undefined method `exists?' for class Dir (NoMethodError)
           return true if Dir.exists?(bundler_path)
                             ^^^^^^^^
       Did you mean?  exist?
```

* Update tests

* Bundler default version now 2.3.x

Bundler 1.x is not able to run with Ruby 3.3 in some circumstances:

```
       remote:  !     There was an error parsing your Gemfile, we cannot continue        
       remote:  !     /tmp/d20250127-138-l8vq2r/bundler-1.17.3/gems/bundler-1.17.3/lib/bundler/shared_helpers.rb:29:in `root': undefined method `untaint' for an instance of Pathname (NoMethodError)        
       remote:  !             
       remote:  !     Pathname.new(gemfile).untaint.expand_path.parent  
```

This commit updates the default bundler version to 2.3.x.

* Update older rails versions in tests

* Update example to default bundler version

* Update fixtures

* Update fixtures

* Remove unused test

* Remove test

This asserts that we ignore invalid or incorrect patch numbers i.e. p0 in the gem file.lock is not correct:

```
RUBY VERSION
   ruby 2.5.1p0
```

We don't really need to keep and maintain this fixture.

* Fix an error

* Fix spec

* Remove bundler 1.x spec

This no longer builds on the platform:

```
       remote:  !     There was an error parsing your Gemfile, we cannot continue        
       remote:  !     /tmp/d20250204-129-9ld2nw/bundler-1.17.3/gems/bundler-1.17.3/lib/bundler/shared_helpers.rb:29:in `root': undefined method `untaint' for an instance of Pathname (NoMethodError)        
       remote:  !             
       remote:  !     Pathname.new(gemfile).untaint.expand_path.parent        
       remote:  !     ^^^^^^^^        
       remote:  !     from /tmp/d20250204-129-9ld2nw/bundler-1.17.3/gems/bundler-1.17.3/lib/bundler.rb:234:in `root'        
       remote:  !     from /tmp/d20250204-129-9ld2nw/bundler-1.17.3/gems/bundler-1.17.3/lib/bundler.rb:246:in `app_config_path'       
```

* Fix fetcher spec and test all bundler versions

* Update fixture

* CI apps that use the database need one

* Fix test

* Fix tests

* Change command so it works on bsdtar (hopefully gnutar tar too, but we will find out one way or another).

* Update tests

* Update fixtures

* Fix missing repo

* Update tests

* Update test

* Update fixture

* Fix test

* Fix test

* Update fixture

* Update fixtures

* Remove-un-needed version write

* Allow heredoc to use interpolation

* Update fixtures

* Fix ruby version

* Update test

* Update fixture

* Update fixtures

* Adjust test addon

* Fix Rails 7 sql/schema test

In Rails 7 the tasks converged into one
Co-authored-by: heroku-linguist[bot] <136119646+heroku-linguist[bot]@users.noreply.github.com>
@Frzk Frzk self-assigned this Mar 20, 2025
@Frzk Frzk requested a review from EtienneM March 20, 2025 10:19
@Frzk Frzk merged commit 95398f0 into master Mar 20, 2025
1 check passed
@Frzk Frzk deleted the deps/upstream_v294 branch March 20, 2025 10:22
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.

4 participants