Skip to content

Add Next Gemfile Support#2

Open
JuanVqz wants to merge 1 commit intomainfrom
add_gemfile_next_support
Open

Add Next Gemfile Support#2
JuanVqz wants to merge 1 commit intomainfrom
add_gemfile_next_support

Conversation

@JuanVqz
Copy link
Copy Markdown
Member

@JuanVqz JuanVqz commented Mar 21, 2024

Closes #1

We can run the next Rails version in Heroku

➜  fastruby.io git:(debug/heroku-buildpack-ruby) heroku run bash --app fastruby-staging
Running bash on ⬢ fastruby-staging... up, run.7123 (Basic)
~ $ rails --version
Rails 7.1.0
~ $ echo $BUNDLE_GEMFILE
Gemfile.next

IMPORTANT NOTES:

  • How are we going to manage this change in the long term? When the people at Heroku release new changes we are going to miss them out, is it better to keep our changes in a branch and rebase their changes as time passes? For sure, it would be better if we propose these changes to the official build pack and get merged 🤞

  • Switching between the current and next Rails versions in the same Heroku instance is not straightforward, we should run a purge or clean command to remove previously used gems and not fall on an issue. But why do we need to switch between them? is that our main reason for supporting Gemfile.next? I don't think so.

  • Even without these changes some tests were failing locally, it might be because of a misconfiguration, I wonder if we should make those tests pass and add more tests with the new implementation.

QA NOTES:

  1. Select a project that already has the dual-boot configured and running.

  2. In Heroku, go to the settings
    image

Remove the official heroku/ruby build pack and include our build pack https://github.com/fastruby/heroku-buildpack-ruby#add_gemfile_next_support

image

Notice that right now we are using this branch to test the changes.

image

  1. Again, in the settings go to the config vars section and add BUNDLE_GEMFILE as a key and Gemfile.next as a value, then click add.

Make sure Heroku picks the value you set in the config vars sometimes this takes some time.

image

  1. In the overview section you should see that you added a new config key

image

  1. Deploy the app, it should deploy the next version. since it would be hard to know what Rails version you are running with only seeing the web page, you can run heroku run bash --app your_app_name to get into the bash in Heroku.
    then run the rails --version, rails console, echo $BUNDLE_GEMFILE or any other command that helps you know you are using the next Rails version.

@stoem
Copy link
Copy Markdown

stoem commented Mar 25, 2024

@JuanVqz I can confirm that by following your steps above I was able to boot our app into Rails 4.2 (which is our Gemfile.next version) on heroku.

@JuanVqz
Copy link
Copy Markdown
Member Author

JuanVqz commented Mar 25, 2024

@stoem, awesome! anything you find please feel free to report it.

@stoem
Copy link
Copy Markdown

stoem commented Mar 25, 2024

@JuanVqz Could you briefly explain what the issue was and how you've solved it? Note I am not clued up on buildpacks.

@JuanVqz
Copy link
Copy Markdown
Member Author

JuanVqz commented Mar 25, 2024

@stoem sure!

The issue was that somehow after the heroku/ruby finished processing, it was removing the bundler gem as a consequence the fastruby/heroku-buildpack-multiple-gemfiles didn't have the bundler gem and wasn't able to install the next gems.

Therefore, we decided that a better solution would be to implement the next strategy into the official heroku/ruby buildpack instead of running a second buildpack.

@stoem
Copy link
Copy Markdown

stoem commented Mar 25, 2024

@JuanVqz Ah right, thanks for the info.

@JuanVqz JuanVqz force-pushed the add_gemfile_next_support branch from 0a7c7fc to fccc116 Compare May 24, 2024 13:25
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.

Be able to use Gemfile.next/Gemfile.next.lock

2 participants