Skip to content

Commit

Permalink
Merge pull request #15901 from CDCgov/deployment/2024-09-17
Browse files Browse the repository at this point in the history
Deployment of 2024-09-17
  • Loading branch information
thetaurean authored Sep 17, 2024
2 parents 9c5f74f + b563b3e commit 411ff7d
Show file tree
Hide file tree
Showing 19 changed files with 381 additions and 66 deletions.
1 change: 1 addition & 0 deletions .environment/gitleaks/gitleaks-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ title = "PRIME ReportStream Gitleaks Configuration"
'authority\", \"extension\"', # FHIR extension URL also shows up in normal FHIR test data
'ApiKeyCredential\(\"flexion\"',
'authType: \"two-legged\"',
'authType == "two-legged"',
'\"apiKey\"',
'api-key\" to \"oracle123\"',
'Authorization-Type: \"username/password\"',
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/build-backend/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ runs:
distribution: "temurin"
cache: "gradle"

- uses: gradle/actions/setup-gradle@16bf8bc8fe830fa669c3c9f914d3eb147c629707
- uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808

- name: Lint
if: inputs.run-integration-tests == 'true'
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/build-submissions/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ runs:
distribution: "temurin"
cache: "gradle"

- uses: gradle/actions/setup-gradle@16bf8bc8fe830fa669c3c9f914d3eb147c629707
- uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808

- name: Lint
if: inputs.run-integration-tests == 'true'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/frontend_chromatic_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
run: yarn install --immutable

- name: Run Chromatic
uses: chromaui/action@95f238da20415287a1a877fecec79290ad2a7e0c
uses: chromaui/action@6eca23b4399151ac2cfc17fa95190d807c7e9519
with:
workingDir: frontend-react
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/frontend_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ jobs:

- name: Run Chromatic
id: chromatic
uses: chromaui/action@95f238da20415287a1a877fecec79290ad2a7e0c
uses: chromaui/action@6eca23b4399151ac2cfc17fa95190d807c7e9519
with:
workingDir: frontend-react
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/snyk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
java-version: "17"
distribution: "temurin"
cache: "gradle"
- uses: gradle/actions/setup-gradle@16bf8bc8fe830fa669c3c9f914d3eb147c629707
- uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808
- name: Snyk Monitor
working-directory: ${{ matrix.folder }}
run: snyk monitor --org=prime-reportstream
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:

- name: "Get changed files with yaml"
id: changed-files-yaml
uses: tj-actions/changed-files@e9772d140489982e0e3704fea5ee93d536f1e275
uses: tj-actions/changed-files@48d8f15b2aaa3d255ca5af3eba4870f807ce6b3c
with:
files_yaml: |
frontend:
Expand All @@ -70,7 +70,7 @@ jobs:

- name: Gradle setup
if: steps.changed-files-yaml.outputs.backend_any_changed == 'true' || steps.branch-name.outputs.is_default == 'true'
uses: gradle/actions/setup-gradle@16bf8bc8fe830fa669c3c9f914d3eb147c629707
uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808

- name: Spin up build containers
if: steps.changed-files-yaml.outputs.backend_any_changed == 'true' || steps.branch-name.outputs.is_default == 'true'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/validate_terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332

- name: Run Checkov action
uses: bridgecrewio/checkov-action@08a0f072354cdd9c009ce7c5c6174491834cec08
uses: bridgecrewio/checkov-action@15c964c5bee933376cc576908ccfad6687718c8e
with:
directory: operations/app/terraform
skip_check: CKV_AZURE_139,CKV_AZURE_137,CKV_AZURE_103,CKV_AZURE_104,CKV_AZURE_102,CKV_AZURE_130,CKV_AZURE_121,CKV_AZURE_67,CKV_AZURE_56,CKV_AZURE_17,CKV_AZURE_63,CKV_AZURE_18,CKV_AZURE_88,CKV_AZURE_65,CKV_AZURE_13,CKV_AZURE_66,CKV_AZURE_33,CKV_AZURE_35,CKV_AZURE_36,CKV_AZURE_98,CKV2_AZURE_1,CKV2_AZURE_15,CKV2_AZURE_21,CKV_AZURE_213,CKV_AZURE_59,CKV2_AZURE_33,CKV2_AZURE_32,CKV2_AZURE_28,CKV_AZURE_206,CKV_AZURE_42,CKV_AZURE_110,CKV_AZURE_109,CKV_AZURE_166,CKV2_AZURE_38,CKV2_AZURE_40,CKV2_AZURE_41,CKV_AZURE_235
12 changes: 12 additions & 0 deletions frontend-react/e2e/pages/authenticated/organization.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { expect } from "@playwright/test";
import { RSOrganizationSettings } from "../../../src/config/endpoints/settings";
import { MOCK_GET_ORGANIZATION_SETTINGS_LIST } from "../../mocks/organizations";
import { BasePage, BasePageTestArgs, type RouteHandlerFulfillEntry } from "../BasePage";

export class OrganizationPage extends BasePage {
static readonly API_ORGANIZATIONS = "/api/settings/organizations";
protected _organizationSettings: RSOrganizationSettings[];

constructor(testArgs: BasePageTestArgs) {
super(
{
Expand Down Expand Up @@ -38,4 +40,14 @@ export class OrganizationPage extends BasePage {
},
];
}

async testTableHeaders() {
await expect(this.page.locator(".usa-table th").nth(0)).toHaveText(/Name/);
await expect(this.page.locator(".usa-table th").nth(1)).toHaveText(/Description/);
await expect(this.page.locator(".usa-table th").nth(2)).toHaveText(/Jurisdiction/);
await expect(this.page.locator(".usa-table th").nth(3)).toHaveText(/State/);
await expect(this.page.locator(".usa-table th").nth(4)).toHaveText(/County/);

return true;
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {expect} from "@playwright/test";
import {readFileSync} from "node:fs";
import {join} from "node:path";
import {fileURLToPath} from "node:url";
import {MOCK_GET_ORGANIZATION_SETTINGS_LIST} from "../../../../mocks/organizations";
import {OrganizationPage} from "../../../../pages/authenticated/organization";
import {test as baseTest} from "../../../../test";
import { expect } from "@playwright/test";
import { readFileSync } from "node:fs";
import { join } from "node:path";
import { fileURLToPath } from "node:url";
import { MOCK_GET_ORGANIZATION_SETTINGS_LIST } from "../../../../mocks/organizations";
import { OrganizationPage } from "../../../../pages/authenticated/organization";
import { test as baseTest } from "../../../../test";

const __dirname = fileURLToPath(import.meta.url);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ const SMOKE_RECEIVERS = [TEST_ORG_UP_RECEIVER_UP, TEST_ORG_CP_RECEIVER_CP, TEST_
test.describe(
"Daily Data page - user flow smoke tests",
{
// TODO: Investigate Daily Data page - user flow smoke tests › admin user › ignore org - FULL_ELR receiver › filter › on 'Apply' › clears 'Report ID'
//tag: "@smoke",
tag: "@smoke",
},
() => {
test.describe("admin user", () => {
Expand Down Expand Up @@ -239,7 +238,6 @@ test.describe(
filterStatusText = filterStatus([
TEST_ORG_UP_RECEIVER_UP,
`${format(fromDate, "MM/dd/yyyy")}${format(toDate, "MM/dd/yyyy")}`,
`${defaultStartTime}${defaultEndTime}`,
]);
await expect(dailyDataPage.page.getByTestId("filter-status")).toContainText(
filterStatusText,
Expand Down Expand Up @@ -340,7 +338,6 @@ test.describe(
let filterStatusText = filterStatus([
TEST_ORG_UP_RECEIVER_UP,
`${format(fromDate, "MM/dd/yyyy")}${format(toDate, "MM/dd/yyyy")}`,
`${defaultStartTime}${defaultEndTime}`,
]);
await expect(dailyDataPage.page.getByTestId("filter-status")).toContainText(filterStatusText);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
import { expect } from "@playwright/test";
import { tableRows } from "../../../helpers/utils";
import { MOCK_GET_ORGANIZATION_SETTINGS_LIST } from "../../../mocks/organizations";
import { OrganizationPage } from "../../../pages/authenticated/organization";
import { test as baseTest } from "../../../test";


export interface OrganizationPageFixtures {
organizationPage: OrganizationPage;
}

const test = baseTest.extend<OrganizationPageFixtures>({
organizationPage: async (
{
page: _page,
isMockDisabled,
adminLogin,
senderLogin,
receiverLogin,
storageState,
frontendWarningsLogPath,
isFrontendWarningsLog,
},
use,
) => {
const page = new OrganizationPage({
page: _page,
isMockDisabled,
adminLogin,
senderLogin,
receiverLogin,
storageState,
frontendWarningsLogPath,
isFrontendWarningsLog,
});
await page.goto();
await use(page);
},
});

test.describe("Admin Organization Settings Page - user flow smoke tests", {
tag: "@smoke",
}, () => {
test.describe("admin user", () => {
test.use({storageState: "e2e/.auth/admin.json"});

test.describe("header", () => {
test("has correct title + heading", async ({organizationPage}) => {
await organizationPage.testHeader();
});
});

test.describe("table", () => {
test.beforeEach(async ({organizationPage}) => {
await organizationPage.page.locator(".usa-table tbody").waitFor({state: "visible"});
});

test("has correct headers", async ({organizationPage}) => {
const result = await organizationPage.testTableHeaders();
expect(result).toBe(true);
});

test("displays data", async ({organizationPage}) => {
const rowCount = await tableRows(organizationPage.page).count();
// Heading with result length
await expect(
organizationPage.page.getByRole("heading", {
name: `Organizations (${rowCount})`,
}),
).toBeVisible();
});

test("filtering works as expected", async ({organizationPage}) => {
const table = organizationPage.page.getByRole("table");
const {description, name, jurisdiction, stateCode} = MOCK_GET_ORGANIZATION_SETTINGS_LIST[2];
const filterBox = organizationPage.page.getByRole("textbox", {
name: "Filter:",
});

await expect(filterBox).toBeVisible();

await filterBox.fill(name);
const rows = await table.getByRole("row").all();
expect(rows).toHaveLength(2);
const cols = rows[1].getByRole("cell").allTextContents();
const expectedColContents = [
name,
description ?? "",
jurisdiction ?? "",
stateCode ?? "",
"",
"SetEdit",
];

for (const [i, col] of (await cols).entries()) {
expect(col).toBe(expectedColContents[i]);
}
});

test('selecting "Set" updates link label in navigation', async ({organizationPage}) => {
const firstDataRow = organizationPage.page.getByRole("table").getByRole("row").nth(1);
const firstDataRowName = (await firstDataRow.getByRole("cell").nth(0).textContent()) ?? "INVALID";
const setButton = firstDataRow.getByRole("button", {
name: "Set",
});

await expect(setButton).toBeVisible();
await setButton.click();

const orgLink = organizationPage.page.getByRole("link", {
name: firstDataRowName,
});
await expect(orgLink).toBeVisible();
await expect(orgLink).toHaveAttribute("href", "/admin/settings");
});
});
});
});
4 changes: 2 additions & 2 deletions prime-router/settings/STLTs/MN/mn-doh.yml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@
processingModeFilter: []
reverseTheQualityFilter: false
conditionFilter:
# RSV: 55735004 (+), COVID: 840539006 (+), FLU (A or B by Antigen): 6142004 (+), FLU (A or B by Culture and Identification Method),: 541131000124102, They also want MPOX but, we are not ready to send MPOX yet.
- "%resource.where(interpretation.coding.code = 'A').code.coding.extension('https://reportstream.cdc.gov/fhir/StructureDefinition/condition-code').value.where(code in ('55735004'|'840539006'|'6142004'|'541131000124102')).exists()"
# RSV: 55735004 (+), COVID: 840539006 (+), FLU (A or B by Antigen): 541131000124102, They also want MPOX but, we are not ready to send MPOX yet.
- "%resource.where(interpretation.coding.code = 'A').code.coding.extension('https://reportstream.cdc.gov/fhir/StructureDefinition/condition-code').value.where(code in ('55735004'|'840539006')).exists()"
mappedConditionFilter: []
deidentify: false
deidentifiedValue: ""
Expand Down
6 changes: 3 additions & 3 deletions prime-router/src/main/kotlin/Report.kt
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ data class ReportStreamFilterResult(
val filteredTrackingElement: String,
val filterType: ReportStreamFilterType?,
val filteredObservationDetails: String? = null,
override val scope: ActionLogScope = ActionLogScope.translation,
) : ActionLogDetail {
override val scope = ActionLogScope.translation
override val errorCode = ErrorCode.UNKNOWN

companion object {
Expand All @@ -145,8 +145,8 @@ data class ReportStreamFilterResult(

override val message = """
For $receiverName, filter $filterName$filterArgs filtered out item $filteredTrackingElement.
$filteredObservationDetails
}
Filter Type: $filterType Filter Args: $filterArgs
Filtered Observation Details: $filteredObservationDetails
""".trimIndent()

// Used for deserializing to a JSON response
Expand Down
Loading

0 comments on commit 411ff7d

Please sign in to comment.