Skip to content

Use DeliveryConfigurations instead of old form attributes#2942

Merged
stephencdaly merged 7 commits into
mainfrom
prepare-to-drop-submission-type-and-submission-format
Jul 21, 2026
Merged

Use DeliveryConfigurations instead of old form attributes#2942
stephencdaly merged 7 commits into
mainfrom
prepare-to-drop-submission-type-and-submission-format

Conversation

@stephencdaly

@stephencdaly stephencdaly commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

What problem does this pull request solve?

Trello card: https://trello.com/c/WMnjLlJV

The following columns have been replaced by the delivery_configurations table, and are no longer used by forms-runner

  • submission_type
  • submission_format
  • send_daily_submission_batch
  • send_weekly_submission_batch

Replace places where we were reading and updating these attributes with only reading and updating the DeliveryConfigurations.

This is in preparation to ignore and drop these columns.

This PR does not update the rake tasks for configuring whether S3 submissions are enabled, this will be done in the next PR.

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?

@stephencdaly
stephencdaly force-pushed the prepare-to-drop-submission-type-and-submission-format branch 2 times, most recently from 5a2b297 to ae1c707 Compare July 20, 2026 10:26
@stephencdaly stephencdaly changed the title Prepare to drop old columns that have been replaced by DeliveryConfigurations Use DeliveryConfigurations in all places Jul 20, 2026
@stephencdaly stephencdaly changed the title Use DeliveryConfigurations in all places Use DeliveryConfigurations in all places and ignore old columns Jul 20, 2026
@stephencdaly
stephencdaly force-pushed the prepare-to-drop-submission-type-and-submission-format branch 4 times, most recently from 4310610 to c9c4760 Compare July 20, 2026 11:45
@stephencdaly
stephencdaly marked this pull request as ready for review July 20, 2026 12:30
@stephencdaly
stephencdaly marked this pull request as draft July 20, 2026 12:33
@stephencdaly
stephencdaly force-pushed the prepare-to-drop-submission-type-and-submission-format branch from c9c4760 to 77ae907 Compare July 20, 2026 12:36
@stephencdaly
stephencdaly marked this pull request as ready for review July 20, 2026 12:38
Now that a form can send submissions by multiple delivery methods, we
cannot have columns for "Submission type" and "Submission formats" in
the report CSV.

Replace these by a single "Delivery methods" column which lists all
the delivery methods and their formats for the form.
Update reports to use the `delivery_configurations` rather than the
deprecated `submission_type`,
`submission_format`,`send_daily_submission_batch` and
`send_weekly_submission_batch` attributes.
When enabling/disabling CSV/JSON submission attachments, only read
and upate the immediate email delivery configuration, rather than
the deprecated submission_type and submission_format fields on the
form.

The task isn't available if the submission email hasn't been set, so
show an error to the user if the email DeliveryConfiguration doesn't
exist.
@stephencdaly
stephencdaly force-pushed the prepare-to-drop-submission-type-and-submission-format branch from 77ae907 to 8648566 Compare July 20, 2026 14:15
Only read and update the form's DeliveryConfigurations when updating
whether daily/weekly batch submission emails are enabled. This will
allow us to remove the `send_daily_submission_batch` and
`send_weekly_submission_batch` attributes from the Form model.
These translations are for an input object that no longer exists
Use delivery_configurations instead of deprectated submission_type,
submission_format, send_daily_submission_batch and
send_weekly_submission_batch fields on the live form page.
@stephencdaly
stephencdaly force-pushed the prepare-to-drop-submission-type-and-submission-format branch from 8648566 to fb77bf6 Compare July 20, 2026 14:21
Use delivery_configurations rather than the deprected attributes when
determining whether the tasks for email attachments and batch
submissions are complete.

The submission attachments (CSV or JSON) task should not be shown when
only S3 submissions are enabled. If there are no delivery
configurations because the submission email has not yet been set, show
the task but with a status of "cannot start".
@stephencdaly
stephencdaly force-pushed the prepare-to-drop-submission-type-and-submission-format branch from fb77bf6 to 1727c89 Compare July 20, 2026 14:26
@stephencdaly stephencdaly changed the title Use DeliveryConfigurations in all places and ignore old columns Use DeliveryConfigurations in all places Jul 20, 2026
@stephencdaly stephencdaly changed the title Use DeliveryConfigurations in all places Use DeliveryConfigurations instead of old form attributes Jul 20, 2026
@github-actions

Copy link
Copy Markdown

🎉 A review copy of this PR has been deployed! You can reach it at: https://pr-2942.admin.review.forms.service.gov.uk/

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.

@stephencdaly
stephencdaly requested a review from a team July 20, 2026 15:06

@DavidBiddle DavidBiddle left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Commits are well organised, code change makes sense and I can see the change working in the report, task list and the live form page 🎉

@stephencdaly
stephencdaly added this pull request to the merge queue Jul 21, 2026
Merged via the queue into main with commit c3225a8 Jul 21, 2026
7 checks passed
@stephencdaly
stephencdaly deleted the prepare-to-drop-submission-type-and-submission-format branch July 21, 2026 10:37
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