Rubocop performance gem warning

AI-generated summary

Users reported a warning during Discourse rebuilds about RuboCop’s Performance Cops being deprecated and moved to the rubocop-performance gem. Initially, there was confusion about whether this was expected, since RuboCop was thought to be limited to development/test environments Falco. However, pfaffman confirmed seeing the message in production rebuilds, and cpradio shared a screenshot confirming the issue. tgxworld investigated and discovered that test gems were accidentally being installed in production environments — a long-standing bug. The issue was promptly fixed in two commits: discourse_docker and docker_manager. A new base image will be released soon to resolve the issue for users upon rebuild. pfaffman expressed surprise at having uncovered a real bug and asked where to monitor for future base image updates requiring command-line upgrades — a question left open for community or staff response.

Hey, @tgxworld, I’m guessing that this is on your radar, but rebuilds include this:

Post-install message from rubocop:
Performance Cops will be removed from RuboCop 0.68. Use rubocop-performance gem instead.
                                
Put this in your Gemfile.
                                                                                                                              
  gem 'rubocop-performance'     

Do you see that in rebuilds? Last I checked rubocop was only in development/test environments.

Yup. I saw that message in a rebuild on a Standard install that I did today. I started noticing it a few days ago.

Where are you seeing the message? I looked through the code paths where we run bundle install and those paths are correctly including --without test --without development.

I’ve seen it as well, this is what I’m seeing:

Ouch this was a bad one. We’ve been installing test gems in production since forever.

Fixed in

https://github.com/discourse/discourse_docker/commit/b8866fb9bbda41b643dd1acf9798b230b75ddb62

https://github.com/discourse/docker_manager/commit/79aa85a88a15836ec881bb91c321978434c2f85a

We’re releasing a new base image soon to fix this issue once you rebuild.

Wow! I found a real problem!

Here’s a question that I should know the answer to, but don’t.

What do I watch to know when there is a new image that requires a command line upgrade?