You can see where I started using Ruby Critic - between the 21.01 and 21.03 releases I break up the plugin generator code, which was the worst quality code in the project (not my code, I might add; it's a stripped down version of the Rails engine generator!) by such a wide margin that it was forcing everything else into the bottom quarter of the charts. Once I got that split up a bit, the rest of the files were able to spread out more usefully on the resulting zoomed-in scale :)
The screenshots below start with the most recent two that were in the previous post, and then head backwards in time. My milestone releases are usually on the 1st of the month, or at least in that general vicinity, so these are fairly evenly-spaced monthly snapshots for the last seven months. I've only pulled the tagged releases for now, which started in October 2020. That was one year after the project launched, and I must admit I am very curious to see how the story develops right from day one now... so I might go back and generate monthly screenshots for that first year at some point soon.
I've been using Ruby Critic to track code quality metrics for a while now (both in work projects and personal projects, although I tend to get more time for fixing the things it highlights in the personal ones). One thing that has been annoying me in this particular project is that, between the 'convention over configuration' approach of Rails, and the 'built up from common roles and patterns' approach I've tried to take with the ShinyCMS plugins, there are a few areas of the code that get a bad score from flay, the tool used by Ruby Critic to look for duplicate code.
The reason for a duplicate code scan, is that often duplicate code is a prime candidate for being factored out into a common method or similar. But in the case of ShinyCMS, most of what it's detecting is the way that, for example, a skinny Rails controller tends to have the same few RESTful actions, doing the same checks with the same consequences, and really only the names of the constants and variables tend to change sometimes. I could factor that out, but it would make those controllers much less conventional, and hence harder for other people to work on - pretty much the opposite of what I want to achieve!
So, I finally got around to looking at the flay documentation a few days ago, and then I added a `.flayignore` file to skip checking controllers and policies for duplication. This had a quite noticeable effect on the lower-scoring files in my Ruby Critic summary - the D and F grades - in fact it got rid of every single one of them.
Also added routes partials, bullet (N+1 query detection), CodeClimate coverage reporting, and the Items extension for Pagy.
Plus lots of improvements to base controllers and mailers (now in the core plugin's `app/public` area), and moved Rails Email Preview engine, rubocop config, and ShinyCMS rake tasks, from main_app into the core plugin.
Headline for this release: I moved almost all the code that was still in main_app, into a plugin! ￼:-o
I also wrote a lot more code to support the Plugins 'infrastructure' or framework or whatever you'd call it I used the Persistent Diamond immutable data structures to underpin the Plugin subsystem; so far so good, so probably more of that in future.
New plugin! ShinySEO can generate sitemaps for Googe et al (although it's not automated yet)
A quiet month, after last month's big bang of Ruby + Rails upgrades!
Bug fixes include tags on hidden content being hidden now, a fix to user profile instantiation in dev that stops the User.profile relation vanishing under stress, and more robust handling of attempts to hit non-existent non-HTML resources (usually by malware).
Various bits of work on code quality - in particular, refactoring around the User model, and moving admin 'quick search' implementation details from controllers to models. Also, properly adding Ruby Critic, and continuing to nibble away at the things it highlights.
A couple of fairly significant bumps in the dependency chain last month, with Rails going from 6.0 to 6.1, and Ruby from 2.7 to 3.0 - between them this entire release probably counts as a breaking change. Enjoy! ￼
I gave a talk at LRUG tonight. The title I went with was "Patches Welcome!", although a more prosaic title could have been "Why I do open source software development". It covered how I got started in open source and what I learned from that (professionally and philosophically), as well as what I'm currently working on (ShinyCMS, mostly!) and how I can use my own projects to help other people.
I've just added the Sidekiq::Status gem (with appropriate config), and hooked it into the jobs that rebuild the blog/news feeds and send newsletter emails.
If you have longer-running jobs (sending to a big mailing list, for instance) then while those jobs are running you'll be able to use the new 'Statuses' section of the Sidekiq web dashboard to see details of what Sidekiq and ActiveJob are doing 'mid flight'.
I recently enabled the contact form on this site, but I soon realised that I had missed out an important feature when I wrote the ShinyForms plugin. A large number of spambots were kind enough to bring this mistake to my attention, and that's why today's merged PR adds reCAPTCHA and Akismet protection to ShinyForm submissions.