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

Fix for accessToken from Message Testing API request #17081

Merged
merged 3 commits into from
Jan 14, 2025

Conversation

lucero-v
Copy link
Collaborator

This PR uses the Bearer token from the API request and passes it over to the CLI functions and removes unnecessary flags for filter validation results.

Test Steps:

  1. Fhirdata CLI commands should still work. example:
fhirdata
--input-file
src/testIntegration/resources/datatests/FHIR_to_HL7/sample_ME_20240806-0001.fhir
--output-format
HL7
-r
azure:/hl7_mapping/receivers/STLTs/ME/ME-receiver-transform.yml
--output-file
/Users/lucero/Documents/GIT/prime-reportstream/prime-router/junk/testing/me-test.hl7
  1. Calling processFhirDataRequest outside of the CLI context should work as long as we pass in a valid bearer token. For this we can use a unit test:
    @Test
    fun `processFhirDataRequest nonCLI request in staging with valid accessToken`() {
        val file = File("src/testIntegration/resources/datatests/FHIR_to_HL7/sample_ME_20240806-0001.fhir")
          ProcessFhirCommands().processFhirDataRequest(
              file,
              Environment.get("staging"),
              "full-elr",
              "me-phd",
              "classpath:/metadata/fhir_transforms/senders/SimpleReport/simple-report-sender-transform.yml",
              false,
              "Bearer YOUR-STAGING-BEARER-TOKEN"
          )
    }

Changes

  • Added accessToken as a parameter to use when calling functions outside of the CLI context
  • removed all boolean flags from the result. We can flag ourselves by looking at the size of the corresponding arrays.

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

@lucero-v lucero-v self-assigned this Jan 14, 2025
@lucero-v lucero-v requested a review from a team as a code owner January 14, 2025 21:30
Copy link
Contributor

github-actions bot commented Jan 14, 2025

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 Jan 14, 2025

Test Results

1 271 tests  ±0   1 267 ✅ ±0   7m 57s ⏱️ +51s
  165 suites ±0       4 💤 ±0 
  165 files   ±0       0 ❌ ±0 

Results for commit 48d61da. ± Comparison against base commit 20905dd.

This pull request removes 2 and adds 2 tests. Note that renamed tests count towards both.
gov.cdc.prime.router.azure.ReportFunctionTests ‑ getReceiver()
gov.cdc.prime.router.azure.ReportFunctionTests ‑ processFhirDataRequest no environment, receiver name, or org name and output format blank()
gov.cdc.prime.router.azure.ReportFunctionTests ‑ processFhirDataRequest nonCLI request in staging without access token should fail()
gov.cdc.prime.router.azure.ReportFunctionTests ‑ processFhirDataRequest receiver name, or org name and output format blank()

♻️ This comment has been updated with latest results.

@lucero-v lucero-v enabled auto-merge (squash) January 14, 2025 22:15
Copy link
Collaborator

@victor-chaparro victor-chaparro left a comment

Choose a reason for hiding this comment

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

NICE

Copy link
Contributor

github-actions bot commented Jan 14, 2025

Integration Test Results

 60 files   60 suites   43m 50s ⏱️
428 tests 418 ✅ 10 💤 0 ❌
431 runs  421 ✅ 10 💤 0 ❌

Results for commit 48d61da.

♻️ This comment has been updated with latest results.

Copy link

Quality Gate Failed Quality Gate failed

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

See analysis details on SonarQube Cloud

@lucero-v lucero-v merged commit 83a644e into main Jan 14, 2025
22 of 23 checks passed
@lucero-v lucero-v deleted the engagement/lucero/message-testing-api-auth-fix branch January 14, 2025 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants