Skip to content

Grep .rspec for deprecation behavior in Step 2#101

Merged
etagwerker merged 2 commits into
mainfrom
fix/silence-check-grep-dot-rspec
Jul 4, 2026
Merged

Grep .rspec for deprecation behavior in Step 2#101
etagwerker merged 2 commits into
mainfrom
fix/silence-check-grep-dot-rspec

Conversation

@JuanVqz

@JuanVqz JuanVqz commented May 5, 2026

Copy link
Copy Markdown
Member

Closes #100
Related ombulabs/claude-code_dual-boot-skill#20

Summary

  • Add a "sweep for deprecation-behavior overrides" substep (2a) to rails-upgrade/workflows/test-suite-verification-workflow.md so the silence/raise/disallow check covers .rspec, spec/.rspec, spec/spec_helper.rb, spec/rails_helper.rb, Rakefile, and spec/support/, not just config/.
  • Mirror the same guidance in rails-upgrade/references/deprecation-warnings.md under "Finding Deprecation Warnings", with the canonical -r raise_errors_for_deprecations example.

Note for the maintainer

The originating report referenced workflows/deprecation-triage-workflow.md Step 2, but that exact file does not exist in this repo. I landed the change in the two closest spots: test-suite-verification-workflow.md (Step 2 = "Run the Test Suite") and references/deprecation-warnings.md ("Finding Deprecation Warnings"). Happy to relocate or split if there's a better target.

Test plan

  • Docs-only change. Verified while exercising the skill on a legacy Rails app where .rspec autoloaded raise_errors_for_deprecations and the original silence-check guidance would have missed it.
  • grep recipe in the change exercised against that codebase and surfaces the .rspec autoload and the RSpec.configure hook.

@JuanVqz JuanVqz force-pushed the fix/silence-check-grep-dot-rspec branch from 032bb23 to 0dc41db Compare May 5, 2026 17:37
Add a silence-check sweep to test-suite-verification Step 2 and to the
'Finding Deprecation Warnings' reference, covering autoloaded files
that the previous guidance missed: .rspec, spec/.rspec, spec/spec_helper.rb,
spec/rails_helper.rb, Rakefile, and spec/support. A single
'-r raise_errors_for_deprecations' line in .rspec can install a
raise-on-deprecation hook that nothing under config/ would surface.

Also document the precedence interaction between
raise_errors_for_deprecations! and DeprecationTracker: when the tracker
is enabled (DEPRECATION_TRACKER=save|compare) the project-level raise
hook must yield to the tracker, otherwise the raise bypasses the
tracker's compare/save path.

Refs #100
@JuanVqz JuanVqz force-pushed the fix/silence-check-grep-dot-rspec branch from 0dc41db to 60cf70b Compare May 5, 2026 17:42
@JuanVqz JuanVqz self-assigned this May 5, 2026
@JuanVqz JuanVqz marked this pull request as ready for review May 5, 2026 18:04
@JuanVqz JuanVqz requested review from arielj and etagwerker May 5, 2026 18:04
@etagwerker

Copy link
Copy Markdown
Member

Thanks for catching the .rspec autoload trap, that one is easy to miss.

I have a few patterns the recipe does not currently surface, and I would love your take on whether any of them feel worth adding or out of scope.

  1. The env DSL form, config.active_support.deprecation = :silence in config/environments/*.rb, has been the canonical way to configure deprecation behavior since Rails 3, and I suspect it is the form most apps actually use. Would you be open to extending the regex with config\.active_support\.(deprecation|disallowed_deprecation|disallowed_deprecation_warnings|report_deprecations)\s*=?

  2. The Rails 7.1+ deprecators registry: Rails.application.deprecators.behavior =, .silence do, plus per-framework deprecators like ActiveRecord.deprecator.silence do. Since the skill goes up through 8.1, would it make sense to include those? Something like (Rails\.application\.deprecators|[A-Z]\w*\.deprecator)\.(behavior|disallowed_behavior|silenced)\s*= with the matching \.silence\b form.

  3. Minitest-shaped apps. The current paths are RSpec-centric. For apps without spec/, would it help to also sweep test/test_helper.rb, test/support/, and test/minitest/? The 2>/dev/null already absorbs "no such file" noise.

  4. A short version-context note. Would a one-liner mapping each pattern to the Rails version where it appeared help readers interpret results? Mostly thinking of someone running this against a Rails 5 app who would otherwise wonder why no deprecators calls turn up.

One open question: if a single comprehensive recipe feels like it is collapsing too many concerns into one grep, would a tiered approach read more cleanly to you, a baseline check plus a follow-up for 7.1+ apps? I am leaning toward the single recipe since grep is cheap, but happy to defer.

@JuanVqz JuanVqz marked this pull request as draft June 16, 2026 16:23
…itest, version context

Fold in review suggestions on the Step 2 grep recipe:

- env DSL form: config.active_support.deprecation / disallowed_deprecation /
  disallowed_deprecation_warnings / report_deprecations
- Rails 7.1+ deprecators registry: Rails.application.deprecators and per-framework
  <Framework>.deprecator (behavior / disallowed_behavior / silenced / silence)
- Minitest paths: test/test_helper.rb, test/support/, test/minitest/
- version-context note so a Rails 5-7.0 app with no deprecators hits reads as
  expected rather than a gap

Kept a single recipe (grep is cheap) to avoid drift across the two files.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@etagwerker

Copy link
Copy Markdown
Member

Went ahead and pushed my own suggestions into the branch so this isn't blocked on you, @JuanVqz — shout if any of it feels off and I'll happily revert or adjust.

Folded all four into the single Step 2 recipe (kept it as one grep rather than tiering it, since grep is cheap and one block is easier to keep in sync across the two files):

  1. env DSL form — added the config.active_support.deprecation / disallowed_deprecation / disallowed_deprecation_warnings / report_deprecations branch. Agreed this is probably the form most apps actually use.
  2. Rails 7.1+ deprecators registry — folded Rails.application.deprecators and per-framework <Framework>.deprecator (e.g. ActiveRecord.deprecator) into the behavior / disallowed_behavior / silenced / .silence branches. Verified it catches all three shapes.
  3. Minitest apps — added test/test_helper.rb, test/support/, test/minitest/ to the path list.
  4. Version context — added a short "which forms appear depends on Rails version" note so someone running this against a Rails 5–7.0 app sees "no deprecators hits" as expected rather than a gap.

I sanity-checked the regex against fixtures for each form, and confirmed a bare :silenced symbol does not false-positive. Ready for another look whenever you have a minute.

@etagwerker etagwerker marked this pull request as ready for review July 4, 2026 00:34
@etagwerker etagwerker merged commit 9fafac0 into main Jul 4, 2026
@etagwerker etagwerker deleted the fix/silence-check-grep-dot-rspec branch July 4, 2026 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants