Skip to content

Silence-check should grep .rspec (and similar autoloaded files) for deprecation behavior overrides #100

@JuanVqz

Description

@JuanVqz

Context

While exercising the skill on a legacy Rails app, I found a gap in the silence-check guidance for deprecation triage. The skill's current guidance (in workflows that call out where to look for deprecation-silencing settings, e.g. test-suite-verification-workflow.md and references/deprecation-warnings.md) implicitly directs users to inspect config/environments/*.rb and config/application.rb for things like config.active_support.deprecation = :silence or :raise. It does not call out .rspec and other autoloaded config files (e.g. Rakefile, spec/.rspec, spec/spec_helper.rb, spec/rails_helper.rb, Bundler-loaded paths) where deprecation behavior can be installed via -r autoloads or test-helper hooks.

Note: the original report referenced workflows/deprecation-triage-workflow.md Step 2. There is no file by that exact name in this repo. The closest matches are rails-upgrade/workflows/test-suite-verification-workflow.md (Step 2 = "Run the Test Suite") and rails-upgrade/references/deprecation-warnings.md ("Finding Deprecation Warnings"). The fix should land wherever the maintainer feels the silence-check guidance is most discoverable, possibly both.

What I almost missed

The target app auto-requires raise_errors_for_deprecations via its .rspec file:

# .rspec
-r raise_errors_for_deprecations

That single line installs an RSpec hook that raises on every ActiveSupport::Deprecation.warn. Without checking .rspec, the skill could miss a quietly-installed deprecation-related behavior change (test failures attributed to "the upgrade" when in fact raise_errors_for_deprecations! was already turning every warning into a failure pre-upgrade).

Recommendation

Add .rspec and similar autoloaded config files to the grep list for the silence/behavior check. Specifically, sweep:

  • .rspec
  • spec/.rspec
  • spec/spec_helper.rb
  • spec/rails_helper.rb
  • Rakefile
  • Any Bundler-loaded paths where RSpec.configure { |c| c.raise_errors_for_deprecations! } (or equivalent ActiveSupport::Deprecation.behavior = overrides) might live (e.g. gems required from the test group, support files under spec/support/**).

Suggested grep:

grep -rnE "raise_errors_for_deprecations|ActiveSupport::Deprecation\.(behavior|disallowed_behavior|silenced)\s*=" \
  .rspec spec/.rspec spec/spec_helper.rb spec/rails_helper.rb Rakefile \
  config/ spec/support/ 2>/dev/null

Why this matters

The silence check is supposed to establish "what is the project's deprecation behavior right now?" before we change it. Missing .rspec means we miss an entire category of pre-installed behavior, and we can mis-diagnose post-upgrade test failures.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions