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

Add GMT+12 MOJURO TimeZone to ReportStream #16864

Merged

Conversation

oslynn
Copy link
Collaborator

@oslynn oslynn commented Dec 20, 2024

This PR adds MOJURO timezone to reportStream since Marshall Island needs GMT+ 12 (MAJURO) timezone to be added to their message if we receive a message that has a date filed with a timezone. However, ReportStream doesn't support or allow to setting the timezone, yet.

Test Steps:

  1. git pull
  2. in prime-reportstream directory run:
    ./gradlew prime-router:test --tests "gov.cdc.prime.router.ReceiverTests.test MAJURO receiver timezone"

Changes

  • Include a comprehensive list of changes in this PR
  • (For web UI changes) Include screenshots/video of changes

Checklist

Testing

  • Tested locally?
  • Ran ./prime test or ./gradlew testSmoke against local Docker ReportStream container?
  • (For Changes to /frontend-react/...) Ran npm run lint:write?
  • Added tests?

Process

  • Are there licensing issues with any new dependencies introduced?
  • Includes a summary of what a code reviewer should test/verify?
  • Updated the release notes?
  • Database changes are submitted as a separate PR?
  • DevOps team has been notified if PR requires ops support?

Linked Issues

To Be Done

Create GitHub issues to track the work remaining, if any

  • #issue

Specific Security-related subjects a reviewer should pay specific attention to

  • Does this PR introduce new endpoints?
    • new endpoint A
    • new endpoint B
  • Does this PR include changes in authentication and/or authorization of existing endpoints?
  • Does this change introduce new dependencies that need vetting?
  • Does this change require changes to our infrastructure?
  • Does logging contain sensitive data?
  • Does this PR include or remove any sensitive information itself?

If you answered 'yes' to any of the questions above, conduct a detailed Review that addresses at least:

  • What are the potential security threats and mitigations? Please list the STRIDE threats and how they are mitigated
    • Spoofing (faking authenticity)
      • Threat T, which could be achieved by A, is mitigated by M
    • Tampering (influence or sabotage the integrity of information, data, or system)
    • Repudiation (the ability to dispute the origin or originator of an action)
    • Information disclosure (data made available to entities who should not have it)
    • Denial of service (make a resource unavailable)
    • Elevation of Privilege (reduce restrictions that apply or gain privileges one should not have)
  • Have you ensured logging does not contain sensitive data?
  • Have you received any additional approvals needed for this change?

@oslynn oslynn added the onboarding-ops Work related to onboarding with a partner. Addressed by the Onboarding & Operations team in RS. label Dec 20, 2024
@oslynn oslynn self-assigned this Dec 20, 2024
Copy link
Contributor

github-actions bot commented Dec 20, 2024

Dependency Review

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

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Manifest Files

Copy link
Contributor

github-actions bot commented Dec 20, 2024

Test Results

1 268 tests  +2   1 264 ✅ +2   7m 38s ⏱️ -13s
  164 suites ±0       4 💤 ±0 
  164 files   ±0       0 ❌ ±0 

Results for commit e6e2ef9. ± Comparison against base commit 55854a0.

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Dec 20, 2024

Integration Test Results

 60 files  ±0   60 suites  ±0   37m 15s ⏱️ +13s
425 tests ±0  415 ✅ ±0  10 💤 ±0  0 ❌ ±0 
428 runs  ±0  418 ✅ ±0  10 💤 ±0  0 ❌ ±0 

Results for commit e6e2ef9. ± Comparison against base commit 55854a0.

♻️ This comment has been updated with latest results.

@@ -273,4 +274,11 @@ internal class ReceiverTests {
val receiver = Receiver("elr", "IGNORE", Topic.COVID_19, CustomerStatus.INACTIVE, translatorConfig)
assertThat(receiver.transportType.type).isEqualTo("NULL")
}

@Test
fun `test MOJURO receiver timezone`() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Minor: test name typo.

Also, why is it testing isNotEqualTo if it's creating a time in MHT and comparing it to what appears to be the same datetime?

Copy link
Collaborator Author

@oslynn oslynn Dec 23, 2024

Choose a reason for hiding this comment

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

Thank you very much, Andrew. It is fixed.

@oslynn oslynn marked this pull request as ready for review December 23, 2024 15:56
@oslynn oslynn requested a review from a team as a code owner December 23, 2024 15:56
val shouldWork1 =
ZonedDateTime.of(2024, 12, 20, 0, 0, 0, 0, ZoneId.of(USTimeZone.MAJURO.zoneId)).toOffsetDateTime()
assertThat(shouldWork1).isNotEqualTo("2024-12-20T00:00+12:00")
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is this test actually testing? Is testing that it works or that it doesn't work?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Test to see, it is working.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't it be testing that the date gets converted to MAJURO than?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh yes, are you correct. I will test the date get converted to MAJURO as well. Thanks.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added the test the date get converted to MAJURO. Done.

Copy link
Contributor

Branch deployed to Chromatic 🚀.

  • ⚠️ Detected 0 tests with visual changes.
  • ✅ All tests passed.

View via:

Copy link
Contributor

⚠️ Broken Links ⚠️

https://www.cdc.gov/od/foia

Error: Request failed with status code 403


https://www.hhs.gov/vulnerability-disclosure-policy/index.html

Error: Request failed with status code 403


https://www.cdc.gov/poxvirus/mpox/lab-personnel/report-results.html

Error: Request failed with status code 404


Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
50.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@oslynn oslynn merged commit cd454b9 into main Dec 24, 2024
32 of 35 checks passed
@oslynn oslynn deleted the oo/oslynn/16825/Add_GMT+12_MOJURO_TimeZone_To_ReportStream branch December 24, 2024 19:08
jack-h-wang pushed a commit that referenced this pull request Dec 26, 2024
* Add GMT+12 MOJURO TimeZone to ReportStream

* Added the enrichment schema for MAJURO timezone

* Fixed Test name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
onboarding-ops Work related to onboarding with a partner. Addressed by the Onboarding & Operations team in RS.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants