Skip to content
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

Feat/2646 total errors aggregates #2800

Merged
merged 25 commits into from
Feb 28, 2024

Conversation

jtimpe
Copy link

@jtimpe jtimpe commented Jan 5, 2024

Summary of Changes

Pull request closes #2646

  • Implements a new total_errors_by_month aggregation function, implemented for section 3+4 submissions
  • Updates the frontend SubmissionHistory component structure to be more readable and limit conditional rendering. some small code duplications and inefficiencies can be ironed out if necessary

How to Test

List the steps to test the PR
These steps are generic, please adjust as necessary.

cd tdrs-backend && docker-compose up
cd tdrs-frontend && docker-compose up --build
  1. Open http://localhost:3000/ and sign in.
  2. Submit data files for all sections to test the frontend restructuring
  3. Submit data files for sections 3+4 and validate the "Total Errors" column in the submission history

Deliverables

More details on how deliverables herein are assessed included here.

Deliverable 1: Accepted Features

Checklist of ACs:

  • A DataFileSummary created for a submission has case_aggregates populated with the correct data for the section
  • 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?
  • Are code coverage minimums met?
    • Frontend coverage: [insert coverage %] (see CodeCov Report comment in PR)
    • Backend coverage: [insert coverage %] (see CodeCov Report comment in PR)

Deliverable 3: Properly Styled Code

  • Are backend code style checks passing on CircleCI?
  • Are frontend code style checks passing on CircleCI?
  • Are code maintainability principles being followed?

Deliverable 4: Accessible

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

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?
  • If this PR introduces dependencies, are their licenses documented?
  • 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?
  • If new issues detected, is investigation and/or remediation plan documented?

Deliverable 8: User Research

Research product(s) clearly articulate(s):

  • the purpose of the research
  • methods used to conduct the research
  • who participated in the research
  • what was tested and how
  • impact of research on TDP
  • (if applicable) final design mockups produced for TDP development

Copy link

codecov bot commented Jan 19, 2024

Codecov Report

Attention: Patch coverage is 77.92208% with 17 lines in your changes are missing coverage. Please review.

Project coverage is 93.56%. Comparing base (0619329) to head (b0e063a).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2800      +/-   ##
===========================================
- Coverage    93.62%   93.56%   -0.06%     
===========================================
  Files          262      265       +3     
  Lines         6055     6080      +25     
  Branches       508      510       +2     
===========================================
+ Hits          5669     5689      +20     
- Misses         291      298       +7     
+ Partials        95       93       -2     
Flag Coverage Δ
dev-backend 93.75% <75.00%> (-0.07%) ⬇️
dev-frontend 92.62% <78.68%> (-0.03%) ⬇️

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

Files Coverage Δ
...components/SubmissionHistory/SubmissionHistory.jsx 100.00% <100.00%> (+16.21%) ⬆️
tdrs-backend/tdpservice/scheduling/parser_task.py 50.00% <50.00%> (-2.64%) ⬇️
tdrs-backend/tdpservice/parsers/aggregates.py 91.48% <78.57%> (-5.49%) ⬇️
...mponents/SubmissionHistory/CaseAggregatesTable.jsx 81.25% <81.25%> (ø)
...ponents/SubmissionHistory/TotalAggregatesTable.jsx 66.66% <66.66%> (ø)
...ntend/src/components/SubmissionHistory/helpers.jsx 82.75% <82.75%> (ø)

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 0619329...b0e063a. Read the comment docs.

@jtimpe jtimpe self-assigned this Jan 19, 2024
@jtimpe jtimpe added the raft review This issue is ready for raft review label Jan 19, 2024
@@ -27,6 +27,8 @@ def parse(data_file_id):

if "Case Data" in data_file.section:

Choose a reason for hiding this comment

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

not related to this PR but we should have had "Case Data" as a CONSTANT, and I would put it in .DataFile.py

@jtimpe jtimpe requested a review from raftmsohani January 23, 2024 19:11
Copy link

@elipe17 elipe17 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!

month_int = month_to_int(month)
rpt_month_year = int(f"{calendar_year}{month_int}")

error_count = ParserError.objects.filter(

Choose a reason for hiding this comment

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

we should be able to query all ParserErrors before running the for loop, and have the counts in a table.

Another note: as we are parsing more and more files, this query would take forever to run, the problem is df is indexed easily but the rpt_month_year will be slow.

Copy link
Author

Choose a reason for hiding this comment

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

i pulled the main ParserError.objects.all() out of the loop - are you suggesting grouping by rpt_month_year or something to that effect as well?

Copy link

@raftmsohani raftmsohani left a comment

Choose a reason for hiding this comment

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

more efficient query!

@ADPennington
Copy link
Collaborator

@jtimpe did this fall off my radar?

@jtimpe
Copy link
Author

jtimpe commented Feb 13, 2024

@jtimpe did this fall off my radar?

nope! i am still addressing PR feedback and getting approvals - once i've done so i'll follow back up with you

@jtimpe jtimpe requested review from raftmsohani and andrew-jameson and removed request for andrew-jameson February 13, 2024 18:23
Copy link

@raftmsohani raftmsohani left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Collaborator

@andrew-jameson andrew-jameson left a comment

Choose a reason for hiding this comment

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

Good to go!

@andrew-jameson andrew-jameson added QASP Review and removed raft review This issue is ready for raft review labels Feb 20, 2024
@ADPennington
Copy link
Collaborator

@jtimpe there is a merge conflict here. can you ping me when its ready again?

@ADPennington ADPennington added the Blocked Label for Pull Requests that are currently blocked by a dependency label Feb 26, 2024
@ADPennington ADPennington added Deploy with CircleCI-qasp Deploy to https://tdp-frontend-qasp.app.cloud.gov through CircleCI and removed Blocked Label for Pull Requests that are currently blocked by a dependency labels Feb 26, 2024
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.

lgtm @jtimpe 🚀

  • Section 3 and 4 total errors for tanf, tribal, and ssp get populated with 0 or non-zero values when status != Rejected
  • there are a couple of edge cases that I presume will be addressed in later tickets (let me know if this is not the case):
    • Accepted with errors status and only error detected is in trailer record: Total Errors == 0 ⚠️ (maybe Cat1 Cleanup will resolve this )
    • any Partially Accepted with Errors status: Total Errors == 0 – this status only comes up when at least one data record (not header/trailer) is not correct length to parse. stratum and aggregate data files only have one data record. so this status does not make sense. ⚠️ will be addressed in #2754

test notes here

@ADPennington ADPennington added Ready to Merge and removed QASP Review Deploy with CircleCI-qasp Deploy to https://tdp-frontend-qasp.app.cloud.gov through CircleCI labels Feb 27, 2024
@andrew-jameson andrew-jameson merged commit c8d0934 into develop Feb 28, 2024
25 checks passed
@andrew-jameson andrew-jameson deleted the feat/2646-total-errors-aggregates branch February 28, 2024 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Populate DataFileSummary.case_aggregates differently for each section
5 participants