Getting Back into Ruby Solo Hackathon, day 6: Dockerhub is down 😭

OK I realised I could have been live-tooting this the whole time instead of spamming groupchats 😂

#ruby #programming

Solo #Ruby Hackathon: day 7.

Context is I've been working on upgrading Levelfly, an open-source Learning Management System https://github.com/neuronic-games/levelfly/

GitHub - neuronic-games/levelfly: Level Up Learning! A friendly Learning Management System

Level Up Learning! A friendly Learning Management System - neuronic-games/levelfly

GitHub

The codebase dates back to 2011, with #Rails 3.1.

In 2021, I upgraded it, getting as far as Rails 4 and #Ruby 2.4.

That same year, @autonomic colleage @roxxers and I containerised it to move it from Heroku to a Docker Swarm deployment (using @coopcloud ).

Since then, Levelfly has just had a couple of critical infrastructure fixes… meanwhile Rails 4 hasn't had security updates since 2017¹, and Ruby 2.4 hasn't had any since 2020².

¹ https://endoflife.date/rails
² https://endoflife.date/ruby

Ruby on Rails

Check end-of-life, release policy and support schedule for Ruby on Rails.

endoflife.date

So, over the past week I've been diving back into Levelfly – this time as the mythical drive-by open-source contributor – to try and wrangle it all the way to currently-supported #Ruby 3.2 and #Rails 7.2.

And, I'm happy to say that it's going… quite OK!

~80 commits and 7 days later, we're on #Ruby 3.0 and #Rails 6.1, preparing to upgrade to Ruby 3.1 and Rails 7 🏗️
This has involved learning/relearning a LOT of things 😅 Luckily that was the name of the game.

Most satisfying thing so far has probably been finally understanding RSpec enough to be useful – specifically getting my head further around the difference between fixtures, seeds, and factories.

(And then completely ripping out the fixtures lol)

Getting basic #RSpec coverage for the key endpoints going as soon as I'd upgraded to Rails 5 was a great move; those tests have already caught all kinds of issues with the new versions.

Part of me regrets not finding a way to test S3 sooner, because file uploads have always been a big source of bugs in Levelfly, and I built up a small version-hell nightmare for myself by not checking any of that until deep into #Rails 6.

But maybe this was an OK plan: by the time I got to it, I had a lot of practice with dealing with gem dependency issues, writing #RSpec, and writing tests that require other services – all of which turned out to be crucial to getting it going.

(For the curious, I ended up switching to the `kt-paperclip` fork, and using adobe/S3Mock in testing)
Brief aside, I tried to use the fake-s3 Rubygem but the original is deprecated and the last-active fork a) seems abandoned too and b) won't launch without a licence key, is this even allowed in Rubygems.org?! https://supso.org/projects/fake-s3/register
Purchase License for Fake S3

Current status: I borked tests by removing Pusher config from the test environment, thought that was handled automatically by pusher-fake, it is not, need to RTFM.
(Live-toot megathread inspired by @foone 🤘)
OK Pusher is happy again, #Ruby 3.1 upgrade seems to have gone smoothly… now how about #Rails 7? 👉👈
#Ruby dependency hell …. well, at least purgatory … once again – acts-as-taggable-on needs an upgrade to be compatible with activerecord > 6.2, but that seems to want a zeitwerk upgrade, and THAT seems to want Ruby 3.2. Good thing I got rbenv working! 😅

#Ruby 3.2 kinda works… but seemingly several gems in the bundle use the deprecated File.exists? method (hot take but was this alias really worth removing?).

Monkeypatching third-party gem to the rescue! https://idogawa.dev/p/2023/01/file-exists-ruby.html

File.exists? and Dir.exists? on Ruby 3.2 Workaround

File.exists? and Dir.exists? were removed in Ruby 3.2. How to fix.

While I wait for `bundle update rails` – probably the most dicey step was a #Rails upgrade that required completely deleting `Gemfile.lock`.

File under "very confused that this worked".

#Rails 7.0 🥳 Now onto #Ruby 3.3. Only one (major) version of Ruby and two versions of Rails left! The end is in sight!
JOHN SUMMIT - Mayan Warrior - Burning Man 2025

JOHN SUMMIT - Mayan Warrior - Burning Man 2025 (SPOTIFY PLAYLIST IN DESCRIPTION) SPOTIFY PLAYLIST: https://open.spotify.com/playlist/0Uf13iNASSOszBjoo8icEw?si=fc74209d69e54c53

SoundCloud

Woohoo that's #Ruby 3.3!

Are We Ready For #Rails 7.1? Let's Find Out!

Now a real head-scratcher: "DEPRECATION WARNING: Passing instance variables to `render` is deprecated."

Not as many hits on th'internet as for other deprecation warnings I've run into.

I did find a blog post about it¹ but now I'm curious why I didn't see more warnings? (Could just be limited test coverage lol 🙈)

¹ https://andycroll.com/ruby/dont-use-instance-variables-in-partials/

Don't use instance variables in partials

Containment is key

Andy Croll
Trying to rush through #Rails 7.1 upgrade before I have to go AFK for the day 🏃🌬️.
Rabbithole mental state update: I've started anthropomorphising the #Ruby gems (and feeling bad torturing them in probably very-unexpected version combinations!)
@3wordchant glad you like my workaround :)

@andi it's fantastic, thank you so much!

PS how on *earth* did you find my toot? Amazing fediverse foraging skills 👏

@3wordchant ahref found it hehe