Back to Source Monitor

conventions-audit

.vbw-planning/milestones/03-coverage-analysis-quick-wins-critical-path-test-co/phases/04-code-quality-conventions-cleanup/PLAN-01-SUMMARY.md

0.13.02.6 KB
Original Source

Plan 01 Summary: conventions-audit

What Was Done

  1. Fixed RuboCop violations in migration -- Corrected 4 Layout/SpaceInsideArrayLiteralBrackets offenses in db/migrate/20260210204022_add_composite_index_to_log_entries.rb. Codebase now has zero RuboCop violations (363 files inspected).

  2. Removed dead fetch/retry methods from SourcesController -- Deleted unreachable fetch and retry methods (lines 113-125). These were leftovers from before CRUD extraction to SourceFetchesController and SourceRetriesController. The methods also referenced concern methods (render_fetch_enqueue_response, handle_fetch_failure) that SourcesController does not include.

  3. Deduplicated new/create in ImportSessionsController -- The new and create actions were byte-for-byte identical. Replaced new body with a one-liner delegation to create.

  4. Removed duplicate test file -- Deleted test/controllers/concerns/source_monitor/sanitizes_search_params_test.rb (duplicate). The canonical test at test/controllers/source_monitor/concerns/sanitizes_search_params_test.rb provides equivalent coverage. Cleaned up empty directories.

  5. Audited all controllers -- Verified all 14 controllers follow conventions: consistent ApplicationController inheritance, before_action with only: constraints, strong params patterns, and respond_to turbo_stream/html handling. Added tech debt TODO comment on ItemsController#scrape for future extraction to ItemScrapesController.

Files Modified

  • db/migrate/20260210204022_add_composite_index_to_log_entries.rb -- RuboCop fix
  • app/controllers/source_monitor/sources_controller.rb -- Dead code removed (14 lines)
  • app/controllers/source_monitor/import_sessions_controller.rb -- Deduplicated new action
  • app/controllers/source_monitor/items_controller.rb -- Tech debt comment added
  • test/controllers/concerns/source_monitor/sanitizes_search_params_test.rb -- Deleted

Test Results

  • 363 files inspected, zero RuboCop offenses
  • 60 controller tests: 0 failures, 0 errors
  • 757 runs full suite: 2 failures (pre-existing intermittent model test state leakage, unrelated to this plan's changes -- verified by running failing tests in isolation where they pass)

Commits

  1. 44fe6b6 fix(plan-01): fix RuboCop violations in composite index migration
  2. c30a503 fix(plan-01): remove dead fetch/retry methods from SourcesController
  3. f070ea6 fix(plan-01): deduplicate new/create in ImportSessionsController
  4. 78600b5 fix(plan-01): remove duplicate sanitizes_search_params test file
  5. ec67c65 fix(plan-01): audit controllers and document scrape action tech debt