Skip to content

Conversation

@elipe17
Copy link
Contributor

@elipe17 elipe17 commented Dec 10, 2025

Summary of Changes

  • Updated Postgres views to leverage program type for correct file querying and versioning
  • Update the remove_all_old_versions celery task to leverage program type for correct querying (also cleaned up ugly nested loops)
  • Add function to create backwards compatible Parser log file paths
  • Updated all newly parsed datafiles to leverage program type in their s3 path
  • Updated error report s3 path to leverage program type

How to Test

For local testing, to prove what was going on with delete old versions task, follow the steps below:

Creating the Error State (data loss)

  • Checkout release tag v4.4.0
  • Submit small_ssp_section1.txt and cat_4_edge_case.txt twice for the same stt on TDP v4.4.0
  • You should have 4 datafiles in the DB and a total of 54 records
  • Bring docker down but preserve volumes
  • Switch to develop and start the containers
  • Run remove_all_old_df_versions management command
  • Notice that you only have 8 records in the database now. The expected would have been 27 records.

Proving the Task Runs Correctly

  • Now destroy docker AND docker volumes
  • Checkout release tag v4.4.0
  • Submit small_ssp_section1.txt and cat_4_edge_case.txt twice for the same stt on TDP v4.4.0
  • You should have 4 datafiles in the DB and a total of 54 records
  • Bring docker down but preserve volumes
  • Switch to hotfix/program-type-dataloss and start the containers
  • Run remove_all_old_df_versions management command
  • Notice that you now have the expected 27 records and they are associated with the latest versions of the files

- Add S3 path construction function that is backwards compatible with program type change
- Update log handler to leverage new path function
- Move ParserErrorCategoryChoices into same named file
- Add program type to s3 path for all newly created datafiles
- Use new function throughout admin invocations for log file path
- Add itertools product to avoid bug ugly nested loop
Copy link
Contributor

@jtimpe jtimpe left a comment

Choose a reason for hiding this comment

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

Looks good! Thank you for your work on this.

Copy link
Collaborator

@ADPennington ADPennington left a comment

Choose a reason for hiding this comment

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

thank you @elipe17 @jtimpe

@ADPennington ADPennington merged commit 161f18d into HHS:main Dec 10, 2025
2 checks passed
@ADPennington ADPennington deleted the hotfix/program-type-dataloss branch December 10, 2025 19:43
@elipe17 elipe17 restored the hotfix/program-type-dataloss branch December 10, 2025 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants