Skip to content

Stop use of "mail_status" and "sent_at" in Submissions model#1549

Merged
theseanything merged 1 commit into
mainfrom
theseanything/drop-old-submission-column-use
Jul 31, 2025
Merged

Stop use of "mail_status" and "sent_at" in Submissions model#1549
theseanything merged 1 commit into
mainfrom
theseanything/drop-old-submission-column-use

Conversation

@theseanything
Copy link
Copy Markdown
Contributor

These columns had be deprecated and the existing data replicated into the new columns "delivery_status" and "last_delivery_attempt".

This removes the use of the columns from the code base in preparation for the column to be dropped.

@theseanything theseanything force-pushed the theseanything/remove-migration-rake-task branch from 12d688f to b1898bb Compare July 28, 2025 15:47
Base automatically changed from theseanything/remove-migration-rake-task to main July 29, 2025 09:56
@theseanything theseanything requested review from a team and Copilot July 29, 2025 09:58
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR removes usage of deprecated columns mail_status and sent_at from the Submissions model, replacing them with the newer delivery_status and last_delivery_attempt columns. The changes prepare the codebase for eventual removal of the deprecated columns.

  • Updates submission factory to only use the new delivery_status column
  • Removes duplicate enum methods and scopes that referenced both old and new columns
  • Updates all test cases to use simplified enum values (pending/bounced instead of delivery_pending/delivery_bounced)

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
app/models/submission.rb Adds ignored columns directive and removes deprecated enum/methods
app/jobs/send_submission_job.rb Updates job to only set new delivery status columns
app/jobs/delete_submissions_job.rb Simplifies query to only use last_delivery_attempt column
spec/factories/submissions.rb Removes mail_status from factory definition
spec/models/submission_spec.rb Updates tests to use new enum values and removes deprecated tests
spec/services/form_submission_service_spec.rb Updates expectation to use last_delivery_attempt
spec/jobs/send_submission_job_spec.rb Updates test to check last_delivery_attempt instead of sent_at
spec/jobs/receive_submission_deliveries_job_spec.rb Updates test data to use new enum values
spec/jobs/receive_submission_bounces_and_complaints_job_spec.rb Updates test data to use new enum values
spec/jobs/delete_submissions_job_spec.rb Removes test cases for deprecated columns and updates expectations
spec/lib/tasks/submissions.rake_spec.rb Updates all test cases to use new enum values

Comment thread app/models/submission.rb
@theseanything theseanything force-pushed the theseanything/drop-old-submission-column-use branch from 5bdf6fd to c23ad92 Compare July 29, 2025 11:43
@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

Important

Not all of the functionality of forms-runner is present in review apps.
Functionality such as sending emails, file upload, and S3 submission types are
deliberately disabled for the sake of simplifying review apps.

You should use the full dev environment to test the functionality which is disabled here.

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.

Copy link
Copy Markdown
Contributor

@DavidBiddle DavidBiddle left a comment

Choose a reason for hiding this comment

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

Changes make sense to me. Have tested locally and the submission process still works for me

This removes references and usage on the old column names.
@theseanything theseanything force-pushed the theseanything/drop-old-submission-column-use branch from c23ad92 to acdeb71 Compare July 31, 2025 12:50
@theseanything theseanything enabled auto-merge July 31, 2025 12:50
@sonarqubecloud
Copy link
Copy Markdown

@theseanything theseanything merged commit 947328c into main Jul 31, 2025
9 of 10 checks passed
@theseanything theseanything deleted the theseanything/drop-old-submission-column-use branch July 31, 2025 12:53
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.

3 participants