✨ Support eval_gemfile
- Fixes #154
This sits on top of #250, since that PR fixes CI, and adds more Ruby engines and versions to the matrix.
ping @nickcharlton 🔶
@pboling
I think the test suite was already broken before I made any changes
I don't think so, see: https://github.com/thoughtbot/appraisal/actions/runs/10999060013, but it might be due to a change in Bundler 😢
Interesting. Actually there may only be a few minor failures. From the Ruby 3.4 build:
expected:
"# This file was generated by Appraisal\n\nsource \"[https://rubygems.org\](https://rubygems.org/)"\n\nruby({:file=>\".ruby-version\"})\n\ngem \"appraisal\", :path => \"/home/runner/work/appraisal/appraisal\"\n"
got:
"# This file was generated by Appraisal\n\nsource \"[https://rubygems.org\](https://rubygems.org/)"\n\n:ruby({file => \".ruby-version\"})\n\ngem \"appraisal\", :path => \"/home/runner/work/appraisal/appraisal\"\n"
The difference is there are spaces around the => for :file in got, but not expected. Oddly the spaces around => for :path are the same in both...
Also there is a semicolon before ruby for expected, but not for got. This seems like tests may not have been modified properly according to the way hashes print in Ruby 3.4?
@nickcharlton I tihnk some of the failures were legit broken stuff. I've fixed pretty much everything (and done some other things too) in a new PR: https://github.com/thoughtbot/appraisal/pull/249
@pboling thank you! @nickcharlton LGTM
Rebased on top of the PR that fixes the build (#250) down to Ruby 2.7.
Rebased on my lts branch again, which should make the build green here.
@nickcharlton ping!
I haven't looked at this properly yet, because it's stacked on all of the other work. But once we break that out, we can come back to this and get it merged in!
Now that I'm starting to use this more heavily, I've discovered major side benefits of eval_gemfile. I call gemfiles invoked by eval_gemfile "modular gemfiles".
- Single source of truth (when possible)
- Don't need to run
appraisal updateif the changes are only to a modular gemfile.
You can see how powerful they are here:
- https://github.com/oauth-xx/masq2/tree/main/gemfiles/modular
- https://github.com/oauth-xx/masq2/blob/main/gemfiles/rails_5_2.gemfile
- https://github.com/oauth-xx/masq2/blob/main/Gemfile
As an example I added the gem minitest-retry to my modular gemfile at gemfiles/modular/mini_testing.gemfile, and I didn't need to re-bundle my Appraisals!
CC @nickcharlton
It is clear that the community needs these fixes.
https://github.com/wwahammy/dumpcar/pull/49
I am personally implementing this branch across dozens of major projects currently.
Would Thoughtbot consider adding me as a maintainer?
Part of my reluctance in splitting this into small PRs is the long intervals spent waiting for attention from existing maintainers on the two existing PRs I submitted (which grew over time, but started out pretty small).
If the cycle time holds the split PRs may not all get merged for years, and the community will have fully splintered into hard coded dependencies on forks, which will invariably result in resistance to switching back to mainline and getting further upgrades (not least because git dependencies do not show up in many tools that check for out of date dependencies).
This tool is too important to let it die, and it might make more sense to create an appraisal org, and hard fork the gem to appraisal2, so it is untethered from thoughtbot. Status quo is not working well.
This tool is too important to let it die
I do agree
it might make more sense to create an appraisal org
Why not if it helps adding maintainers to the project. On the other hand it should not be difficult to add maintainers to the current project in thoughtbot org.
hard fork the gem to appraisal2, so it is untethered from thoughtbot.
I don't think this is a good idea. I would prefer transferring appraisal gem to appraisal org rather than doing a hard fork to avoid multiplication of official repos.
@nickcharlton let us know if we can do anything to get this PR merged. thank you!
I agree that it could live on under Thoughtbot, but only just. I don't think Thoughtbot has the level of corporate interest in this project to sustain it. If they were aware of the issue and wanted to, something would have been done already.
They've already effectively killed this project twice.
First when it remained incompatible with GHA for years, I had to rip it out of projects I migrated to GHA from other CIs.
Second, after they fixed it to work with GHA, they dropped support for old Rubies, which coupled with the general lack of development, meant my choices were to rip it out again, or fix it.
It isn't clear Thoughtbot wants this project attached to them anymore aside from a historical byline. I think it is likely that the bulk of the company's interest lies outside of Ruby now... which is perfectly valid. They don't have to hold onto it forever.
Perhaps it is time for thoughtbot to move the project to a discrete org. I'll go ahead and create one in case the ball moves in that direction, and I'll sent owner invites to invested parties.
Also, thinking more about this, appraisal2, as a gem hard fork, does have a direct path to reunification. If the two converge, appraisal2 can depend on appraisal, and have a post install message to revert the dependency back to the original. This way the upgrade path will be advertized properly by things like bundle outdated when the new version is released directing people back. I think that's actually better than the git chaos which has no tracking, and no central manner of communicating about the tool's status.
So to that end I'll fork this to the new org, and rename it to appraisal2.
- It will speed up all of my builds
- save energy, and hence the planet, a little bit
- In fact, because of the git dependency I have been forced to add and then remove the appraisal gem to each individal appraisal (with
remove_gem)... this will simplify things significantly!
:rocket:
For better or worse: https://github.com/appraisal-rb/appraisal2
@nickcharlton @n-rodriguez @deivid-rodriguez you've all been invited to the org, as the top three contributors to this project who had any involvement in the last several years.
I just realized that another mental blocker I had for redoing this PR in small parts is I actually already did a significant additional amount of work on top of it, fixing many other issues.
-
https://github.com/pboling/appraisal/pull/4
-
https://github.com/pboling/appraisal/pull/5
-
https://github.com/pboling/appraisal/pull/6
-
https://github.com/pboling/appraisal/pull/7
All of this work is going to be in appraisal2, and it all starts with this PR:
https://github.com/appraisal-rb/appraisal2/pull/1