Skip to content

Get latest delivery configuration on submission - #2438

Closed
DavidBiddle wants to merge 3 commits into
mainfrom
get-latest-delivery-configuration-on-submission
Closed

DavidBiddle wants to merge 3 commits into
mainfrom
get-latest-delivery-configuration-on-submission

Conversation

@DavidBiddle

Copy link
Copy Markdown
Contributor

What problem does this pull request solve?

Trello card:

Things to consider when reviewing

  • Ensure that you consider the wider context.
  • Does it work when run on your machine?
  • Is it clear what the code is doing?
  • Do the commit messages explain why the changes were made?
  • Are there all the unit tests needed?
  • Do the end to end tests need updating before these changes will pass?
  • Has all relevant documentation been updated?

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Existing submissions can lose pending batch deliveries without a backfill or fallback, and two configuration-removal tests no longer exercise their intended scenarios.

3 open issues
What changed in this PR

This PR snapshots the latest delivery configurations when a form is submitted, separating delivery settings from the stored form document.

Changes:

  • Adds a JSONB column for submission delivery configurations.
  • Uses the saved configurations for immediate delivery and daily/weekly batch selection.
  • Updates service expectations and batch-selection fixtures.
File Description
spec/​services/​form_submission_service_spec.rb Expects delivery configurations in the saved submission.
spec/​lib/​batch_submissions_selector_spec.rb Moves batch configuration fixtures onto submissions.
db/​schema.rb Records the new delivery configurations column.
db/​migrate/​20261023083239_add_delivery_configuration_to_submissions.rb Adds the JSONB column to submissions.
app/​services/​form_submission_service.rb Fetches and saves current configurations, then uses them for immediate delivery.
app/​lib/​batch_submissions_selector.rb Selects batches using submission-level configurations.

Review effort: Balanced

@@ -0,0 +1,5 @@
class AddDeliveryConfigurationToSubmissions < ActiveRecord::Migration[8.1]
def change
add_column :submissions, :delivery_configurations, :jsonb
Comment thread spec/lib/batch_submissions_selector_spec.rb Outdated
Comment thread spec/lib/batch_submissions_selector_spec.rb Outdated
@DavidBiddle
DavidBiddle force-pushed the get-latest-delivery-configuration-on-submission branch from 1e12bc7 to 6e540f5 Compare October 23, 2026 11:00
@github-actions

Copy link
Copy Markdown
Contributor

🎉 A review copy of this PR has been deployed! It is made of up two components

  1. A review copy of forms-runner
  2. A production copy of forms-admin

It may take 5 minutes or so for the application to be fully deployed and working. If it still isn't ready
after 5 minutes, there may be something wrong with the ECS task. You will need to go to the integration AWS account
to debug, or otherwise ask an infrastructure person.

For the sign in details and more information, see the review apps wiki page.

@DavidBiddle

Copy link
Copy Markdown
Contributor Author

This was an alternative to #2399 but we're sticking with the original approach

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.

2 participants