Skip to content
This repository was archived by the owner on May 12, 2026. It is now read-only.

Commit 4c9e656

Browse files
authored
Merge pull request #18434 from CDCgov/deployment/2025-08-21
Deployment of 2025-08-21
2 parents 89e170f + ce659c5 commit 4c9e656

42 files changed

Lines changed: 1212 additions & 567 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/actions/build-backend/action.yml

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ inputs:
1818
skip-schema-validation:
1919
description: "Skip schema validation step"
2020
default: true
21+
integration-test-forks:
22+
description: "Number of parallel forks for integration tests (auto-detect if not specified)"
23+
required: false
24+
default: "auto"
2125

2226
runs:
2327
using: "composite"
@@ -147,10 +151,62 @@ runs:
147151
./gradlew :prime-router:reloadSettings
148152
shell: bash
149153

154+
- name: Configure integration test parallelization
155+
if: inputs.run-integration-tests == 'true'
156+
shell: bash
157+
run: |
158+
# Auto-detect optimal parallelization based on runner specs
159+
CORES=$(nproc)
160+
MEMORY_GB=$(free -g | grep '^Mem' | awk '{print $2}')
161+
162+
if [ "${{ inputs.integration-test-forks }}" = "auto" ]; then
163+
# Conservative approach: use half the cores, with safety limits
164+
FORKS=$((CORES / 2))
165+
FORKS=$(( FORKS > 3 ? 3 : FORKS )) # Max 3 forks to reduce external API pressure
166+
FORKS=$(( FORKS < 1 ? 1 : FORKS )) # Min 1 fork
167+
else
168+
FORKS=${{ inputs.integration-test-forks }}
169+
fi
170+
171+
# Calculate memory per fork (leave some buffer for system)
172+
MEMORY_PER_FORK=$(( (MEMORY_GB * 80 / 100) / FORKS )) # 80% of total memory
173+
MEMORY_PER_FORK=$(( MEMORY_PER_FORK > 3 ? 3 : MEMORY_PER_FORK )) # Max 3GB per fork
174+
MEMORY_PER_FORK=$(( MEMORY_PER_FORK < 1 ? 1 : MEMORY_PER_FORK )) # Min 1GB per fork
175+
176+
echo "INTEGRATION_TEST_FORKS=$FORKS" >> $GITHUB_ENV
177+
echo "INTEGRATION_TEST_MEMORY=${MEMORY_PER_FORK}g" >> $GITHUB_ENV
178+
179+
echo "🖥️ Runner specifications detected:"
180+
echo " CPU cores available: $CORES"
181+
echo " Total memory: ${MEMORY_GB}GB"
182+
echo ""
183+
echo "🧪 Integration test configuration:"
184+
echo " Parallel forks: $FORKS"
185+
echo " Memory per fork: ${MEMORY_PER_FORK}GB"
186+
echo " Expected speedup: ~$((100 - (100 / FORKS)))% (theoretical)"
187+
150188
# Integrations tests require the metadata catalog
151-
- name: Run Integration Tests
189+
- name: Run Integration Tests (Parallel with Resource Optimization)
152190
if: inputs.run-integration-tests == 'true'
153-
run: ./gradlew :prime-router:testIntegration -Pshowtests
191+
run: |
192+
# Create a temporary gradle.properties with parallel settings
193+
echo "org.gradle.parallel=true" >> gradle.properties
194+
echo "org.gradle.workers.max=$INTEGRATION_TEST_FORKS" >> gradle.properties
195+
echo "org.gradle.jvmargs=-Xmx$INTEGRATION_TEST_MEMORY -XX:+UseParallelGC" >> gradle.properties
196+
197+
echo "📝 Gradle parallel configuration:"
198+
echo " Max workers: $INTEGRATION_TEST_FORKS"
199+
echo " JVM args: -Xmx$INTEGRATION_TEST_MEMORY -XX:+UseParallelGC"
200+
echo ""
201+
202+
# Run integration tests with parallel configuration and retry logic
203+
./gradlew :prime-router:testIntegration -Pshowtests --continue || {
204+
echo "⚠️ First attempt failed, waiting 30s before retry..."
205+
sleep 30
206+
echo "🔄 Retrying integration tests with reduced parallelism..."
207+
echo "org.gradle.workers.max=1" >> gradle.properties
208+
./gradlew :prime-router:testIntegration -Pshowtests --rerun-tasks
209+
}
154210
shell: bash
155211

156212
- name: Publish Integration Test Results

.github/dependabot.yml

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,44 @@ updates:
1111
directory: "/operations"
1212
schedule:
1313
interval: "weekly"
14+
day: "sunday"
15+
time: "05:00"
16+
timezone: "US/Eastern"
1417
- package-ecosystem: "docker"
1518
directory: "/prime-router"
1619
schedule:
17-
interval: "monthly"
20+
interval: "weekly"
21+
day: "sunday"
22+
time: "05:00"
23+
timezone: "US/Eastern"
1824
- package-ecosystem: "docker"
1925
directory: "/.environment/docker/docker-compose"
2026
schedule:
21-
interval: "monthly"
27+
interval: "weekly"
28+
day: "sunday"
29+
time: "05:00"
30+
timezone: "US/Eastern"
2231
- package-ecosystem: "docker"
2332
directory: "/frontend-react"
2433
schedule:
25-
interval: "monthly"
34+
interval: "weekly"
35+
day: "sunday"
36+
time: "05:00"
37+
timezone: "US/Eastern"
38+
- package-ecosystem: "docker"
39+
directory: "/operations/utils/postgres"
40+
schedule:
41+
interval: "weekly"
42+
day: "sunday"
43+
time: "05:00"
44+
timezone: "US/Eastern"
45+
- package-ecosystem: "docker"
46+
directory: "/operations/dnsmasq"
47+
schedule:
48+
interval: "weekly"
49+
day: "sunday"
50+
time: "05:00"
51+
timezone: "US/Eastern"
2652

2753
# slack-boltjs-app (chatops)
2854
- package-ecosystem: "gitsubmodule"

.github/workflows/snyk.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ on:
77
- main
88
paths:
99
- "prime-router/**"
10-
- "submissions/**"
1110
- "shared/**"
12-
- "auth/**"
1311

1412
jobs:
1513
pre_job:
@@ -31,7 +29,7 @@ jobs:
3129
strategy:
3230
fail-fast: false
3331
matrix:
34-
folder: [prime-router, submissions, auth, shared]
32+
folder: [prime-router, shared]
3533
steps:
3634
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
3735
- uses: snyk/actions/setup@b98d498629f1c368650224d6d212bf7dfa89e4bf
@@ -44,6 +42,6 @@ jobs:
4442
- uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808
4543
- name: Snyk Monitor
4644
working-directory: ${{ matrix.folder }}
47-
run: snyk monitor --org=prime-reportstream
45+
run: snyk monitor --org=prime-reportstream --target-reference="main"
4846
env:
4947
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
!gradle-wrapper.jar
1919
*.war
2020

21+
# act testing
22+
.act-testing/
23+
2124
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
2225
hs_err_pid*
2326

@@ -133,4 +136,4 @@ gitleaks.log
133136
storybook-static
134137

135138
# dotnet
136-
**/.config
139+
**/.config

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
org.gradle.jvmargs=-Dfile.encoding=UTF8 -Xmx2048M
22
# Set Kotlin version for all peices of the build environment
33
systemProp.kotlinVersion=2.1.0
4+
org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled

prime-router/build.gradle.kts

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,14 @@ tasks.test {
215215

216216
tasks.javadoc.configure {
217217
actions.clear()
218-
dependsOn(tasks.dokkaHtml)
218+
dependsOn(tasks.dokkaGenerate)
219219
}
220220

221-
tasks.dokkaHtml.configure {
221+
dokka {
222222
val docsDir = File(buildDir, "/docs/dokka")
223-
outputDirectory.set(docsDir)
223+
dokkaPublications.html {
224+
outputDirectory.set(docsDir)
225+
}
224226
}
225227

226228
tasks.jacocoTestReport {
@@ -358,6 +360,13 @@ tasks.register<Copy>("copyApiSwaggerUI") {
358360

359361
tasks.withType<Test>().configureEach {
360362
maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).takeIf { it > 0 } ?: 1
363+
if ("AzureWebJobsStorage" !in System.getenv()) {
364+
environment["AzureWebJobsStorage"] = "test-AzureWebJobsStorage"
365+
println(
366+
"'AzureWebJobsStorage' was not defined for testing and has been set to: " +
367+
environment["AzureWebJobsStorage"]
368+
)
369+
}
361370
}
362371

363372
tasks.processResources {
@@ -622,7 +631,7 @@ tasks.register("quickPackage") {
622631
tasks["compileTestKotlin"].enabled = false
623632
tasks["migrate"].enabled = false
624633
tasks["flywayMigrate"].enabled = false
625-
tasks["dokkaHtml"].enabled = false
634+
tasks["dokkaGenerate"].enabled = false
626635
}
627636

628637
/**
@@ -688,7 +697,7 @@ tasks.register("quickRun") {
688697
tasks["compileTestKotlin"].enabled = false
689698
tasks["migrate"].enabled = false
690699
tasks["flywayMigrate"].enabled = false
691-
tasks["dokkaHtml"].enabled = false
700+
tasks["dokkaGenerate"].enabled = false
692701
}
693702

694703
tasks.register("tiQuickRun") {

prime-router/src/main/kotlin/Receiver.kt

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
package gov.cdc.prime.router
22

33
import com.fasterxml.jackson.annotation.JsonIgnore
4-
import gov.cdc.prime.router.azure.BlobAccess
54
import gov.cdc.prime.router.common.DateUtilities
6-
import gov.cdc.prime.router.common.Environment
75
import gov.cdc.prime.router.fhirengine.translation.hl7.FhirToHl7Converter
86
import gov.cdc.prime.router.fhirengine.translation.hl7.SchemaException
7+
import gov.cdc.prime.router.fhirengine.translation.hl7.utils.helpers.SchemaReferenceResolverHelper
98
import java.time.LocalTime
109
import java.time.OffsetDateTime
1110
import java.time.ZoneId
@@ -174,7 +173,7 @@ open class Receiver(
174173
*
175174
* @param operation MERGE will combine all reports in the batch into a single batch
176175
* @param numberPerDay Number of batches per day must be 1 to 3600
177-
* @param initialTime The time of the day to first send. Must be format of hh:mm.
176+
* @param initialTime The time of the day to first send. Must be of format of hh:mm.
178177
* @param timeZone the time zone of the initial sending
179178
* @param timeBetweenBatches the delay interval in seconds to apply between consecutive batches, if specified
180179
*/
@@ -263,11 +262,11 @@ open class Receiver(
263262
if (this.topic.isUniversalPipeline) {
264263
try {
265264
FhirToHl7Converter(
266-
translation.schemaName,
267-
BlobAccess.BlobContainerMetadata.build(
268-
"metadata",
269-
Environment.get().storageEnvVar
270-
)
265+
SchemaReferenceResolverHelper.retrieveHl7SchemaReference(translation.schemaName),
266+
strict = false,
267+
terser = null,
268+
errors = mutableListOf(),
269+
warnings = mutableListOf(),
271270
)
272271
} catch (e: SchemaException) {
273272
return e.message
@@ -283,15 +282,15 @@ open class Receiver(
283282
}
284283

285284
companion object {
286-
const val fullNameSeparator = "."
285+
const val FULL_NAME_SEPARATOR = "."
287286

288287
/** Global function to create receiver fullNames using
289288
* the [organizationName] and the [receiverName].
290289
*/
291290
fun createFullName(
292291
organizationName: String,
293292
receiverName: String,
294-
): String = "$organizationName$fullNameSeparator$receiverName"
293+
): String = "$organizationName$FULL_NAME_SEPARATOR$receiverName"
295294

296295
fun parseFullName(fullName: String): Pair<String, String> {
297296
val splits = fullName.split(Sender.fullNameSeparator)

prime-router/src/main/kotlin/azure/SendFunction.kt

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -326,10 +326,6 @@ class SendFunction(
326326
}
327327

328328
val fileSize = content?.size ?: 0
329-
// The last mile failure event has a slightly different pattern because we do not generate a child
330-
// report as an output for this event so the childReport is the input to the send step and the
331-
// parent report is the input to the batch step
332-
val parentReport = workflowEngine.db.fetchFirstParentReport(report.reportId)
333329

334330
reportEventService.sendReportEvent(
335331
eventName = ReportStreamEventName.REPORT_LAST_MILE_FAILURE,
@@ -346,9 +342,10 @@ class SendFunction(
346342
ReportStreamEventProperties.FILENAME to externalFileName
347343
)
348344
)
349-
if (parentReport != null) {
350-
parentReportId(parentReport.reportId)
351-
}
345+
// The last mile failure event has a slightly different pattern because we do not generate a child
346+
// report as an output for this event so the childReport is the input to the send step and the
347+
// parent report is the input to the batch step
348+
parentReportId(report.reportId)
352349
}
353350

354351
actionHistory.trackItemSendState(

prime-router/src/main/kotlin/azure/observability/event/ReportStreamEventBuilder.kt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ abstract class AbstractReportStreamEventBuilder<T : AzureCustomEvent>(
9696
queueMessage
9797
)
9898

99+
abstract fun getSubmissionEventData(): SubmissionEventData
100+
99101
fun send() {
100102
val event = buildEvent()
101103
sendToAzure(event)
@@ -140,8 +142,14 @@ open class ReportStreamReportEventBuilder(
140142

141143
override fun buildEvent(): ReportStreamReportEvent = ReportStreamReportEvent(
142144
getReportEventData(),
145+
getSubmissionEventData(),
143146
theParams
144147
)
148+
149+
override fun getSubmissionEventData(): SubmissionEventData = reportEventService.getSubmissionEventData(
150+
0,
151+
theParentReportId
152+
)
145153
}
146154

147155
/**
@@ -199,8 +207,15 @@ open class ReportStreamItemEventBuilder(
199207
)
200208
}
201209

210+
override fun getSubmissionEventData(): SubmissionEventData = reportEventService.getSubmissionEventData(
211+
theChildIndex,
212+
theParentReportId,
213+
true
214+
)
215+
202216
override fun buildEvent(): ReportStreamItemEvent = ReportStreamItemEvent(
203217
getReportEventData(),
218+
getSubmissionEventData(),
204219
getItemEventData(),
205220
theParams
206221
)
@@ -231,6 +246,7 @@ class ReportStreamReportProcessingErrorEventBuilder(
231246
) {
232247
override fun buildEvent(): ReportStreamReportEvent = ReportStreamReportEvent(
233248
getReportEventData(),
249+
getSubmissionEventData(),
234250
theParams + mapOf(ReportStreamEventProperties.PROCESSING_ERROR to error)
235251
)
236252
}
@@ -260,6 +276,7 @@ class ReportStreamItemProcessingErrorEventBuilder(
260276
) {
261277
override fun buildEvent(): ReportStreamItemEvent = ReportStreamItemEvent(
262278
getReportEventData(),
279+
getSubmissionEventData(),
263280
getItemEventData(),
264281
theParams + mapOf(ReportStreamEventProperties.PROCESSING_ERROR to error)
265282
)

0 commit comments

Comments
 (0)