Skip to content

Fix NoMethodError in deprecations run - #198

Merged
JuanVqz merged 2 commits into
mainfrom
fix/deprecations-run-nomethoderror
Aug 3, 2026
Merged

Fix NoMethodError in deprecations run#198
JuanVqz merged 2 commits into
mainfrom
fix/deprecations-run-nomethoderror

Conversation

@JuanVqz

@JuanVqz JuanVqz commented Aug 3, 2026

Copy link
Copy Markdown
Member

deprecations run raised NoMethodError on every invocation: it calls DeprecationTracker.sanitize_mode, which lived in deprecation_tracker.rb, while the CLI only requires valid_modes.

Moves sanitize_mode to valid_modes.rb, next to valid_mode?. deprecation_tracker.rb already requires that file, so tracker behavior is unchanged and exe/deprecations needs no change. Requiring the whole tracker from the CLI was the other option, but that prepends KernelWarnTracker onto Object and Kernel at require time.

Adds a subprocess smoke spec for the executable, the first thing that exercises exe/ at all. Verified it fails with the original NoMethodError when sanitize_mode is removed again.

JuanVqz added 2 commits August 3, 2026 11:32
`run` called DeprecationTracker.sanitize_mode, which lived in
deprecation_tracker.rb, but the CLI only required valid_modes and shard_merger.
Every invocation of run mode raised NoMethodError before reaching any of its own
logic.

Move sanitize_mode to valid_modes.rb, next to valid_mode? and
valid_modes_display, rather than making the CLI require the whole tracker.
deprecation_tracker.rb already requires valid_modes, so tracker behavior is
unchanged, and the CLI keeps its two narrow requires. That matters because
requiring deprecation_tracker.rb prepends KernelWarnTracker onto Object and
Kernel at require time: a summary-printing CLI has no business patching
Kernel#warn, and doing so also misattributes any `warn ..., uplevel:` in the
process to the tracker's wrapper instead of the real caller.

Also resolve "next_rails/tint" relatively in deprecation_tracker.rb. Unrelated
to this bug, but requiring the tracker by absolute path from outside a checkout
raised LoadError without it.

Adds the smoke spec that would have caught this. It executes the real script in
a subprocess, which is the only thing that exercises exe/ at all; verified to
fail with NoMethodError when sanitize_mode is removed again.
@JuanVqz
JuanVqz marked this pull request as ready for review August 3, 2026 17:44
@JuanVqz
JuanVqz merged commit 992ca57 into main Aug 3, 2026
11 checks passed
@JuanVqz
JuanVqz deleted the fix/deprecations-run-nomethoderror branch August 3, 2026 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant