Skip to content

Conversation

@ysbaddaden
Copy link
Contributor

@ysbaddaden ysbaddaden commented Mar 7, 2022

Removes a dozen unused gems, and removes the decent_exposure gem that wasn't used much. This is less gems to worry about during the upgrade. There are probably more gems that aren't used much that we could remove. For example RestClient is used for a single HTTP call!

I also tried to group gems into categories (databases, models, views, assets, ...).

Also adds support for code coverage (on demand) using simplecov to understand what features are missing tests, as well as where to focus QA for the upgrade process. We have a good average (80%) but we also have lots of fully untested or under tested controllers, which decreases the overall confidence in the upgrade.

refs #1235

@ysbaddaden ysbaddaden added dependencies Pull requests that update a dependency file tech-debt labels Mar 7, 2022
@ysbaddaden ysbaddaden self-assigned this Mar 7, 2022
@ysbaddaden ysbaddaden mentioned this pull request Mar 7, 2022
18 tasks
@ysbaddaden ysbaddaden changed the title Upgrade: cleanup before the storm Upgrade: cleanup before the storm + Rails 4.2.11.3 (latest patch release) Mar 8, 2022
@ysbaddaden ysbaddaden linked an issue Mar 8, 2022 that may be closed by this pull request
@ysbaddaden
Copy link
Contributor Author

ysbaddaden commented Mar 8, 2022

I added some backward compatible changes (ApplicationRecord, ApplicationJob, rename before|after_filter to before|after_action).

That should good to merge.

Now I'll try upgrading to Rails 5, following the fixes and gem version locks that @ftarulla did 🤞

@ysbaddaden ysbaddaden force-pushed the chore/upgrade-to-rails-5.0 branch from 9df29f0 to 981d5c4 Compare March 8, 2022 10:40
@straight-shoota
Copy link
Contributor

This is an awesome cleanup! ❤️

I'm wondering why the upgrade to 4.2.11 failed in #1472. Maybe it was really caused by one of the removed dependencies.

@ysbaddaden
Copy link
Contributor Author

The error that popped in CI was the same: the RSpec version was incompatible with Rake that got updated by Bundler for an unknown reason. Maybe you then tried more upgrades? I chose to merely downgraded Rake back to its previous version, because there was no reason for Bundler to upgrade Rake in the first place.

@ysbaddaden ysbaddaden force-pushed the chore/upgrade-to-rails-5.0 branch from 981d5c4 to 31bccc3 Compare March 11, 2022 09:21
@ysbaddaden ysbaddaden force-pushed the chore/upgrade-to-rails-5.0 branch 2 times, most recently from ae7d4ec to e7accfc Compare March 18, 2022 16:54
This removes around 10 direct dependencies, and a bunch more
dependencies. I checked each and every removed dependency, and I
couldn't find any single use of them left.

Unit and integration specs are still passing, and the app still
boots.

I also removed shoulda because we only used a single rspec matcher
(validate_presence_of) and there was only 5 occurrences of it.
It's only used in a few controllers, so the induced pattern is quite
odd compared to the whole application. We can replace the gem with a
few methods. One less dependency for less hidden magic.
This is to understand where and what tests are missing in the
application, to have a global understanding of the test quality of
the application.

As of this commit the overall coverage is 80%, which looks great,
but looking more closely we see that 9 controllers are 0% hence
totally untested, and 6 controllers are below 70% coverage.
@ysbaddaden ysbaddaden force-pushed the chore/upgrade-to-rails-5.0 branch 2 times, most recently from 556ca1c to d8580bd Compare April 7, 2022 13:45
@ysbaddaden ysbaddaden merged commit d8e340b into main Apr 7, 2022
@ysbaddaden ysbaddaden deleted the chore/upgrade-to-rails-5.0 branch April 7, 2022 17:20
@ysbaddaden ysbaddaden mentioned this pull request Nov 15, 2022
19 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file tech-debt

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade Rails from 4.2.5.2 to 4.2.11.3

3 participants