-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix email template reseed problem upon updates/deletion #34
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #34 +/- ##
=======================================
Coverage 85.77% 85.77%
=======================================
Files 20 20
Lines 668 668
=======================================
Hits 573 573
Misses 95 95 ☔ View full report in Codecov by Sentry. |
…safety" This reverts commit 9fb64e9.
c3bc1fb
to
755a96b
Compare
LGTM. Seems like a lot of testing for a relatively simple code change, but that's good. The testing helps clarify that everything does, indeed, work as intended. In the future if we end up modifying anything other than the to/body fields in the Email Template seed data, the code might need to be updated to include those fields in the call to the "except" function. |
A few comments here:
In general, the seeds file should not be used for migrating data. It should only create data if it doesn't exist. |
Pivotal Tracker Link
What this PR does:
This pull request fixes the issue of duplication of Email Templates upon reseeding the database with updated seed data. Based on the special needs from Professor Ball, it does not purge old email templates that are not present in the current seed data.
Include screenshots, videos, etc.
Special needs from Professor Ball
Previous Problem - Duplication of Email Templates after Reseeding Updated Email Templates
After Fix
Who authored this PR?
How should this PR be tested?
What do the specs/features test?
The specs test the reseeding process's ability to update email template (with same hash) and keep old unchanged email templates in the database accurately.
Are there edge cases to watch out for?
Not on my mind yet.
Are there any complications to deploying this?
This PR is basically safe. If there are any potential risks, the update feature might overwrite the old email templates in the database if the hashed values are the same.
Relevant code of hashing can be found here
Checklist:
perry/187113121-fix-email-template-reseed-issue
). Any branch name will do as long as the story ID is there. You can usegit checkout -b [new-branch-name]