Skip to content

STT Filenames/Section/Program Type Conflation#5850

Merged
elipe17 merged 3 commits into
developfrom
bug/section-program-conflation
May 19, 2026
Merged

STT Filenames/Section/Program Type Conflation#5850
elipe17 merged 3 commits into
developfrom
bug/section-program-conflation

Conversation

@elipe17
Copy link
Copy Markdown

@elipe17 elipe17 commented May 11, 2026

Summary of Changes

This PR fixes the remaining places where TANF-family program type and section were being treated as a single combined string after the backend model moved to separate program_type and section fields.

The main production symptom was the upcoming submission reminder email. STTs could submit their required files, but the reminder task compared submitted values like TAN Active Case Data against required filename keys like Active Case Data, concluded the files were missing, and sent Action Requested: Please submit your TANF data files anyway.

Changes included here:

  • Build missing-submission requirements as (program_type, section) pairs instead of combined strings.
  • Derive required program types from the STT:
    • Tribal STTs require TRIBAL files.
    • SSP STTs require both TAN and SSP files.
    • Other states/territories require TAN files.
  • Update reminder tests so fixtures use current section-only filename keys for TANF, SSP, and Tribal use cases.
  • Update DataFile.filename to prefer section-only filename keys, while preserving fallback support for legacy prefixed keys.
  • Update STT.num_sections to count unique normalized sections instead of relying on len(filenames) // 2 for SSP states.

Pull request closes #_

How to Test

Backend targeted tests:

task backend-pytest PYTEST_ARGS="tdpservice/email/test/test_upcoming_deadline_email.py tdpservice/data_files/test/test_models.py tdpservice/stts/test/test_models.py -q"
task backend-lint

Expected results:

  • Upcoming deadline reminders are not sent when all required (program_type, section) submissions exist.
  • A TANF submission does not satisfy SSP or Tribal requirements with the same section name.
  • SSP states require both TANF and SSP submissions.
  • Tribal STTs require Tribal submissions.
  • DataFile.filename resolves section-only filename keys and still tolerates legacy prefixed keys.
  • STT.num_sections counts sections correctly for section-only and legacy prefixed filename configs.

Deliverables

More details on how deliverables herein are assessed included here.

Deliverable 1: Accepted Features

Checklist of ACs:

  • Missing-submission reminder logic uses separate program type and section values.
  • STTs that have submitted all required files are not incorrectly emailed.
  • SSP and Tribal requirements cannot be satisfied by the wrong program type with the same section name.
  • lfrohlich and/or adpennington confirmed that ACs are met.

Deliverable 2: Tested Code

  • Are all areas of code introduced in this PR meaningfully tested?
    • If this PR introduces backend code changes, are they meaningfully tested?
    • If this PR introduces frontend code changes, are they meaningfully tested? N/A, backend-only change.
  • Are code coverage minimums met?
    • Frontend coverage: N/A
    • Backend coverage: See CodeCov Report comment in PR.

Deliverable 3: Properly Styled Code

  • Are backend code style checks passing on CircleCI? Local task backend-lint passes.
  • Are frontend code style checks passing on CircleCI? N/A, backend-only change.
  • Are code maintainability principles being followed?

Deliverable 4: Accessible

  • Does this PR complete the epic? N/A
  • Are links included to any other gov-approved PRs associated with epic? N/A
  • Does PR include documentation for Raft's a11y review? N/A
  • Did automated and manual testing with iamjolly and ttran-hub using Accessibility Insights reveal any errors introduced in this PR? N/A, backend-only change.

Deliverable 5: Deployed

  • Was the code successfully deployed via automated CircleCI process to development on Cloud.gov?

Deliverable 6: Documented

  • Does this PR provide background for why coding decisions were made?
  • If this PR introduces backend code, is that code easy to understand and sufficiently documented, both inline and overall?
  • If this PR introduces frontend code, is that code easy to understand and sufficiently documented, both inline and overall? N/A
  • If this PR introduces dependencies, are their licenses documented? N/A, no new dependencies.
  • Can reviewer explain and take ownership of these elements presented in this code review?

Deliverable 7: Secure

  • Does the OWASP Scan pass on CircleCI?
  • Do manual code review and manual testing detect any new security issues? No security-sensitive behavior changed.
  • If new issues detected, is investigation and/or remediation plan documented? N/A

Deliverable 8: User Research

N/A, backend defect fix.

… with the program type section split and sending STTs emails that they needed to submit files when they didnt need to

- Added fallback/normalization logic to other areas where that pattern in used
@elipe17 elipe17 self-assigned this May 11, 2026
@elipe17 elipe17 added bug backend raft review This issue is ready for raft review labels May 11, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 11, 2026

Codecov Report

❌ Patch coverage is 97.61905% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 94.00%. Comparing base (878746e) to head (4c3f482).
⚠️ Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
tdrs-backend/tdpservice/email/tasks.py 94.44% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #5850      +/-   ##
===========================================
+ Coverage    93.98%   94.00%   +0.01%     
===========================================
  Files          538      538              
  Lines        24618    24650      +32     
  Branches       620      620              
===========================================
+ Hits         23137    23171      +34     
+ Misses        1368     1366       -2     
  Partials       113      113              
Flag Coverage Δ
dev-backend 94.28% <97.61%> (+0.01%) ⬆️
dev-frontend 91.84% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
tdrs-backend/tdpservice/data_files/models.py 84.61% <100.00%> (+1.74%) ⬆️
...-backend/tdpservice/data_files/test/test_models.py 93.54% <100.00%> (+0.69%) ⬆️
...service/email/test/test_upcoming_deadline_email.py 100.00% <100.00%> (ø)
tdrs-backend/tdpservice/stts/models.py 100.00% <100.00%> (ø)
tdrs-backend/tdpservice/stts/test/test_models.py 100.00% <100.00%> (ø)
tdrs-backend/tdpservice/email/tasks.py 78.94% <94.44%> (+1.94%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3089730...4c3f482. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@elipe17 elipe17 merged commit a5e1f59 into develop May 19, 2026
13 checks passed
@elipe17 elipe17 deleted the bug/section-program-conflation branch May 19, 2026 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend bug raft review This issue is ready for raft review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants