-
Notifications
You must be signed in to change notification settings - Fork 13
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
first stab at a data backfill for StateFileArchivedIntake #5305
base: FYST-1466-prior-year-access-mvp
Are you sure you want to change the base?
Conversation
Heroku app: https://gyr-review-app-5305-3f92ceae63ac.herokuapp.com/ |
@@ -0,0 +1,74 @@ | |||
module StateFile |
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.
at a high level, i think it would be helpful to write tests for this file.
next | ||
end | ||
Rails.logger.info("Archived #{archived_ids.count} #{data_source} intakes: [#{archived_ids.join(', ')}]") | ||
@current_batch = nil # reset the batch |
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.
why is the @current_batch
set to nil for this method?
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.
ah, i think it is to exit the while
loop in the rake task.
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.
setting it to nil
to represent that the batch has been processed; those intakes are no longer eligible for archiving because they've been archived :)
next | ||
end | ||
Rails.logger.info("Archived #{archived_ids.count} #{data_source} intakes: [#{archived_ids.join(', ')}]") | ||
@current_batch = nil # reset the batch |
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.
ah, i think it is to exit the while
loop in the rake task.
archive = StateFileArchivedIntake.new(record.without('source_intake_id')) | ||
archive.submission_pdf.attach(data_source.find(record['source_intake_id']).submission_pdf.blob) | ||
archive.save! | ||
archived_ids << record['source_intake_id'] |
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 am assuming that we don't want to archive and delete in the same rake task.
maybe it would be helpful to have a method that after the archive_batch
is run, we verify that the archivable intakes now have an archivable record.
i don't if that makes sense or is easy.
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.
also how were you thinking of recording the intake IDs for deleting? or were you thinking of running the query again and then deleting them?
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.
not deleting in this task. collecting the ids for logging purposes only. we'll do the actual table truncation in a different effort.
also, the annotate error should be resolved if you merge in |
#{tax_year} AS tax_year, '#{state_code}' AS state_code, | ||
email_address, hashed_ssn, id AS source_intake_id | ||
FROM | ||
state_file_az_intakes |
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.
🤔 just realized this query is just for AZ. since this is a WIP PR, i'm sure you were gonna change this, but just pointing out for other reviewers.
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.
yeah, fixed in the next commit.
…off date configurable; this will help in testing where we won't reliably have accepted returns with transition dates before the 'real' ty23 cutoff of may-ish 2024
…ailing address syncing
a92fec4
to
746eefc
Compare
Link to pivotal/JIRA issue
FYST-1504
Is PM acceptance required? (delete one)
No - merge after code review approval
What was done?
How to test?
#query_archiveable
,#current_batch
, and#archive_batch
.