-
Notifications
You must be signed in to change notification settings - Fork 112
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
LG-14320 Add deactivate IPP cancelled profiles task #11180
Conversation
enrollment.profile = profile | ||
enrollment.save! | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For Run the backfill script to backup data without updating profiles
- we are just running that to 1. confirm batches are working and 2. ensure the print out is working as expected, correct? What do you think about adding a sentence on the testing plan to confirm both? (I am adding it here so it can be resolved.)
@@ -0,0 +1,86 @@ | |||
# frozen_string_literal: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think we should create data that should not be updated to ensure/check that we are not updating establishing, pending, and passed enrollments and/or those enrollments that don't have a timestamp for the profile? What are your thoughts on this? Overkill?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this idea if it's not too much trouble!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it doesn't exist already, can we make a follow-up ticket to remove these extra tasks once it's been run successfully in production?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we have a ticket for this yet. I will make sure it is created.
I just wanted to note that I am going to delete |
I created LG-14391 Clean up Backfill In Person Pending At Rake Task to delete this script so it would not get forgotten. |
@@ -75,4 +75,67 @@ namespace :profiles do | |||
|
|||
warn "backfill_in_person_verification_pending_at left #{profiles.count} rows" | |||
end | |||
|
|||
## | |||
# Usage: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked prod on 09/04/24 at approx. 11:30ET
- Expired (3786), Cancelled *813), Failed (587) - Total 5186 in prod
- Establishing 1313
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ran through the testing plan and the tasks work as described. Looks great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't manually test this, but I reviewed it and everything looks good. Approved. ✅
|
||
warn "Updating #{profile_data.count} records" | ||
profile_data.in_groups_of(1000, false) do |batch| | ||
batch.each do |profile_datum| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice use of datum. 👏🏻
bd9f471
to
48326e0
Compare
I did locally testing- and it worked as expected. I also worked through this with Shane a bit so happy others approved. |
60a5e0f
to
94eb061
Compare
I did a squash and removed commits from my branch. I removed the seed file that was added testing. Need a quick double check then I can merge. |
@shanechesnutt-ft I did a once-over just now. Looks good. 👍🏻 |
94eb061
to
a3fc305
Compare
Ran through the test plan again after your changes. Looks good, script works as described! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
5c86f8a
to
be63601
Compare
timestamp = profile.in_person_verification_pending_at | ||
|
||
warn "#{profile.id},#{profile.deactivation_reason},#{timestamp}" | ||
if update_profiles |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBH I wouldn't change it at this point, but I feel like it would be a tiny bit more ideal if the warn
on line 101 occurred inside this conditional, or there was otherwise some indication if update_profiles
was false. It'd otherwise be easy to miss that this script didn't change anything if the environment variable wasn't set.
But, it looks like this has already been extensively tested, so it doesn't feel like it's worth changing. I'd just make sure someone confirms the script was successful, which was probably part of the plan all along anyway. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good callout! I did add checks in the roll plan for verifying the data.
changelog: Internal, Data Normalization, Add a backfill script to deactivate all profiles consider to be in ipp verfication cancelled state. co-authored-by: Andrew Duthie <andrew.duthie@gsa.gov>
be63601
to
367fe4e
Compare
🎫 Ticket
Link to the relevant ticket:
LG-14320
🛠 Summary of changes
Added a script to deactivate profiles that are considered to be IPP verification cancelled state.
📜 Testing Plan
Scenario: Running backfill script
seed_users_with_profiles.rb
seed filebundle exec rake seed:broken_profiles
Note: It might be good to setup the seeder to create a few pending profiles for testing to ensure those do not get updated.
bundle exec rake profiles:backfill_deactivated_ipp_verification_cancelled UPDATE_PROFILES=false
bundle exec rake profiles:backfill_deactivated_ipp_verification_cancelled UPDATE_PROFILES=true
Scenario: Running rollback script