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

Check submission table when computing submission history #16200

Merged

Conversation

thetaurean
Copy link
Collaborator

This PR updates the submission history code to check the new submission table in azure storage when a submissionId is not found in the primary postgres database.

Test Steps:

  1. Run integration test suite

Changes

  • Updated submission history code to check azure storage table
  • Added timestamp field and JSON annotations to shared Submission class

Checklist

Testing

  • Tested locally?
  • Ran ./prime test or ./gradlew testSmoke against local Docker ReportStream container?
  • Added tests?

Linked Issues

@thetaurean thetaurean added the platform Platform Team label Oct 11, 2024
@thetaurean thetaurean requested a review from a team as a code owner October 11, 2024 14:46
Copy link

github-actions bot commented Oct 11, 2024

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Manifest Files

Copy link

github-actions bot commented Oct 11, 2024

Test Results

1 246 tests  +1   1 242 ✅ +1   7m 42s ⏱️ -14s
  162 suites ±0       4 💤 ±0 
  162 files   ±0       0 ❌ ±0 

Results for commit 80a4e91. ± Comparison against base commit a14e8ee.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Oct 11, 2024

Integration Test Results

 53 files   53 suites   27m 25s ⏱️
411 tests 402 ✅ 9 💤 0 ❌
414 runs  405 ✅ 9 💤 0 ❌

Results for commit 80a4e91.

♻️ This comment has been updated with latest results.

@thetaurean thetaurean force-pushed the platform/thetaurean/15822-submission-history-sources branch from 7e96b98 to 3a4225d Compare October 11, 2024 16:04
Copy link
Collaborator

@david-navapbc david-navapbc left a comment

Choose a reason for hiding this comment

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

there is a test failure when I run this on my workstation that does not happen when I do the same in master branch.

      at gov.cdc.prime.router.history.azure.DeliveryFunctionTests.test delivery details(DeliveryFunctionTests.kt:465)


return if (submission == null) {
logger.error(ex)
HttpUtilities.notFoundResponse(request, ex.message)
Copy link
Collaborator

Choose a reason for hiding this comment

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

why return the exception message to the caller?

The project is open source so it's not really an OWASP issue in the way it would be were our project proprietary. As such feel free to leave this alone if you feel strongly.

my view is - in general - to not return anything to the caller directly tied to a facet of system state and/or implementation detail unless the caller needs to have that information for some specific reason.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I agree with you however this was pre-existing code so I didn't feel comfortable changing it.

For the most part this is catching exceptions that we throw, so the error messages are things we set. Though IllegalStateException is pretty broad and could probably occur unexpectedly.

Copy link
Collaborator

@david-navapbc david-navapbc left a comment

Choose a reason for hiding this comment

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

tests now pass for me locally - nice work!

Copy link
Collaborator

@arnejduranovic arnejduranovic left a comment

Choose a reason for hiding this comment

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

Changes look good. In the background will work to put up a follow-up PR to use dependency injection with SubmissionTableService

Copy link

sonarcloud bot commented Oct 17, 2024

@arnejduranovic arnejduranovic merged commit 58332ab into master Oct 17, 2024
22 checks passed
@arnejduranovic arnejduranovic deleted the platform/thetaurean/15822-submission-history-sources branch October 17, 2024 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform Platform Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Submission History reads azure storage table when report not found in postgresql database
3 participants