Skip to content

fix: show configured batch_size consistently on index and show pages - #23

Draft
PauloPhagula wants to merge 1 commit into
mainfrom
fix/batch-size-show-page
Draft

fix: show configured batch_size consistently on index and show pages#23
PauloPhagula wants to merge 1 commit into
mainfrom
fix/batch-size-show-page

Conversation

@PauloPhagula

Copy link
Copy Markdown

Summary

  • The show page summary displayed a different batch size than the index — it was reading from @backfill_run.batches.first&.batch_size (the actual chunk size stored on each child batch by Dripper) instead of @backfill_run.batch_size (the configured value the user submitted in the form).
  • Fixed by reading @backfill_run.batch_size directly in show.html.erb. No DB or model changes.
  • The batches table column header is renamed from "BATCH SIZE" to "ITEMS PROCESSED" to clarify that the per-row value is the actual number of records processed in that chunk, not the configured batch size.

Changes

  • app/views/data_drip/backfill_runs/show.html.erb — summary line reads @backfill_run.batch_size; batches table header renamed to "ITEMS PROCESSED"
  • spec/controllers/data_drip/backfill_runs_controller_spec.rb — new render_views tests for GET #index and GET #show asserting both pages show the configured value

Test plan

  • bundle exec rspec — 109 examples, 0 failures
  • bundle exec rubocop --parallel — no offenses
  • GET /data_drip/backfill_runs — "Batch Size" column shows the configured value
  • GET /data_drip/backfill_runs/:id — "Batch Size" summary matches the index value; batches table shows actual per-chunk sizes under "ITEMS PROCESSED"

The show page summary was reading from the first child batch's batch_size
column (the actual chunk size yielded by find_in_batches) instead of the
parent BackfillRun#batch_size (the configured value). This caused the
index and show pages to display different numbers for the same run.

Fix by reading @backfill_run.batch_size directly in the show summary.
The per-batch actual sizes remain visible in the batches table, whose
column header is renamed from "BATCH SIZE" to "ITEMS PROCESSED" to
distinguish the two concepts without any schema changes.

Adds render_views coverage for GET #index and GET #show so this
regression cannot recur silently.
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