fix: show configured batch_size consistently on index and show pages - #23
Draft
PauloPhagula wants to merge 1 commit into
Draft
fix: show configured batch_size consistently on index and show pages#23PauloPhagula wants to merge 1 commit into
PauloPhagula wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@backfill_run.batches.first&.batch_size(the actual chunk size stored on each child batch byDripper) instead of@backfill_run.batch_size(the configured value the user submitted in the form).@backfill_run.batch_sizedirectly inshow.html.erb. No DB or model changes.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— newrender_viewstests forGET #indexandGET #showasserting both pages show the configured valueTest plan
bundle exec rspec— 109 examples, 0 failuresbundle exec rubocop --parallel— no offensesGET /data_drip/backfill_runs— "Batch Size" column shows the configured valueGET /data_drip/backfill_runs/:id— "Batch Size" summary matches the index value; batches table shows actual per-chunk sizes under "ITEMS PROCESSED"