Skip to content

Commit

Permalink
merge conflicts for new changes
Browse files Browse the repository at this point in the history
  • Loading branch information
fzhao99 committed Jan 8, 2024
2 parents 5703bba + f3a3ee3 commit 183d6e4
Show file tree
Hide file tree
Showing 42 changed files with 829 additions and 1,177 deletions.
6 changes: 3 additions & 3 deletions .github/actions/post-deploy-smoke-test/action.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Smoke test post deploy
description: Invoke a script that visits a deploy smoke check page that displays whether the backend / db are healthy.
inputs:
deploy-env:
description: The environment being deployed (e.g. "prod" or "test")
base_domain_name:
description: The domain where the application is deployed (e.g. "simplereport.gov" or "test.simplereport.gov")
required: true
runs:
using: composite
Expand All @@ -12,7 +12,7 @@ runs:
working-directory: frontend
run: |
touch .env
echo REACT_APP_BASE_URL=https://${{ inputs.deploy-env }}.simplereport.gov >> .env.production.local
echo REACT_APP_BASE_URL=${{ inputs.base_domain_name }}>> .env.production.local
- name: Run smoke test script
shell: bash
working-directory: frontend
Expand Down
60 changes: 59 additions & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<<<<<<< HEAD
#name: "CodeQL"
#
#on:
Expand Down Expand Up @@ -52,4 +53,61 @@
# - name: Perform CodeQL Analysis
# uses: github/codeql-action/analyze@v2
# with:
# category: "/language:${{ matrix.language }}"
# category: "/language:${{ matrix.language }}"
=======
name: "CodeQL"

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: "45 4 * * 3"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
JAVA_VERSION: 17
JAVA_DISTRIBUTION: 'zulu'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ javascript, java ]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
queries: +security-and-quality

- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: ${{env.JAVA_VERSION}}
distribution: ${{env.JAVA_DISTRIBUTION}}

- name: Autobuild
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{ matrix.language }}"
>>>>>>> bob/7019-prod-e2e-health-check
13 changes: 8 additions & 5 deletions .github/workflows/deployProd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Deploy Prod

on:
workflow_run:
workflows: ["Deploy Stg"]
workflows: [ "Deploy Stg" ]
types:
- completed

Expand All @@ -28,6 +28,7 @@ jobs:

build_frontend:
runs-on: ubuntu-latest
environment: Production
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/build-frontend
Expand All @@ -40,11 +41,11 @@ jobs:
okta_enabled: true
okta_url: https://hhs-prime.okta.com
okta_client_id: 0oa5ahrdfSpxmNZO74h6
base_domain_name: www.simplereport.gov
base_domain_name: ${{ vars.BASE_DOMAIN_NAME }}

prerelease_backend:
runs-on: ubuntu-latest
needs: [build_frontend, build_docker]
needs: [ build_frontend, build_docker ]
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/tf-deploy
Expand Down Expand Up @@ -73,7 +74,7 @@ jobs:
environment:
name: Production
url: https://simplereport.gov
needs: [prerelease_backend]
needs: [ prerelease_backend ]
steps:
- uses: actions/checkout@v4
- name: Promote and deploy
Expand All @@ -86,7 +87,7 @@ jobs:
slack_alert:
runs-on: ubuntu-latest
if: failure()
needs: [deploy]
needs: [ deploy ]
steps:
- uses: actions/checkout@v4
- name: Send alert to Slack
Expand All @@ -97,3 +98,5 @@ jobs:
:siren-gif: Deploy to ${{ env.DEPLOY_ENV }} failed. ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} :siren-gif:
webhook_url: ${{ secrets.SR_ALERTS_SLACK_WEBHOOK_URL }}
user_map: $${{ secrets.SR_ALERTS_GITHUB_SLACK_MAP }}

# a post-prod health check workflow is defined in smokeTestDeployProd. See the Alert response wiki page for more details
2 changes: 1 addition & 1 deletion .github/workflows/e2eRemote.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
- name: Archive cypress failures
if: failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: cypress-results
path: |
Expand Down
30 changes: 18 additions & 12 deletions .github/workflows/ghcrCleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,38 +11,44 @@ jobs:
steps:
# backend, cypress, database, frontend, frontend-lighthouse, nginx
- uses: actions/delete-package-versions@v4
with:
package-name: 'backend'
with:
package-name: 'prime-simplereport/backend'
package-type: 'container'
min-versions-to-keep: 10
delete-only-untagged-versions: 'true'
- uses: actions/delete-package-versions@v4
with:
package-name: 'cypress'
with:
package-name: 'prime-simplereport/cypress'
package-type: 'container'
min-versions-to-keep: 10
delete-only-untagged-versions: 'true'
- uses: actions/delete-package-versions@v4
with:
package-name: 'database'
with:
package-name: 'prime-simplereport/database'
package-type: 'container'
min-versions-to-keep: 10
delete-only-untagged-versions: 'true'
- uses: actions/delete-package-versions@v4
with:
package-name: 'frontend'
with:
package-name: 'prime-simplereport/db'
package-type: 'container'
min-versions-to-keep: 10
delete-only-untagged-versions: 'true'
- uses: actions/delete-package-versions@v4
with:
package-name: 'frontend-lighthouse'
with:
package-name: 'prime-simplereport/frontend'
package-type: 'container'
min-versions-to-keep: 10
delete-only-untagged-versions: 'true'
- uses: actions/delete-package-versions@v4
with:
package-name: 'nginx'
with:
package-name: 'prime-simplereport/frontend-lighthouse'
package-type: 'container'
min-versions-to-keep: 10
delete-only-untagged-versions: 'true'
- uses: actions/delete-package-versions@v4
with:
package-name: 'prime-simplereport/nginx'
package-type: 'container'
min-versions-to-keep: 10
delete-only-untagged-versions: 'true'
2 changes: 1 addition & 1 deletion .github/workflows/lighthouse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,4 @@
# if: always()
# with:
# name: lighthouse-results
# path: lighthouse/*
# path: lighthouse/*
2 changes: 1 addition & 1 deletion .github/workflows/maintenance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
working-directory: ./frontend
steps:
- uses: actions/checkout@v4
- uses: actions/[email protected].0
- uses: actions/[email protected].1
with:
node-version: ${{env.NODE_VERSION}}
- uses: azure/login@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/smokeTestDeployProd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
slack_alert:
runs-on: ubuntu-latest
if: failure()
needs: [ smoke-test-front-and-back-end ]
needs: [smoke-test-front-and-back-end]
steps:
- uses: actions/checkout@v4
- name: Send alert to Slack
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
path: backend/build/**
key: ${{ runner.os }}-backend-coverage-${{ github.run_id }}-${{ github.run_attempt }}
- name: Archive failed test results
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure()
with:
name: backend-test-report
Expand All @@ -75,7 +75,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/[email protected].0
uses: actions/[email protected].1
with:
node-version: ${{ env.NODE_VERSION }}
- name: Cache yarn
Expand Down Expand Up @@ -112,7 +112,7 @@ jobs:
ops/services/app_functions/report_stream_batched_publisher/functions/coverage/**
key: ${{ runner.os }}-function-coverage-${{ github.run_id }}-${{ github.run_attempt }}
- name: Archive function coverage results
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: function-coverage
path: ops/services/app_functions/report_stream_batched_publisher/functions/coverage
Expand Down Expand Up @@ -199,7 +199,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/[email protected].0
uses: actions/[email protected].1
with:
node-version: ${{ env.NODE_VERSION }}
- name: Cache yarn
Expand Down
2 changes: 1 addition & 1 deletion backend/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ dependencies {
runtimeOnly 'org.springframework.session:spring-session-jdbc'

// App insights instrumentation
implementation 'com.microsoft.azure:applicationinsights-core:3.4.17'
implementation 'com.microsoft.azure:applicationinsights-core:3.4.18'

// Twilio for SMS
implementation 'com.twilio.sdk:twilio:9.14.0'
Expand Down
2 changes: 1 addition & 1 deletion backend/gradle.lockfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ com.graphql-java:graphql-java-extended-validation:20.0=compileClasspath,runtimeC
com.graphql-java:graphql-java:20.2=compileClasspath,runtimeClasspath
com.graphql-java:java-dataloader:3.2.0=compileClasspath,runtimeClasspath
com.ibm.icu:icu4j:72.1=compileClasspath,runtimeClasspath
com.microsoft.azure:applicationinsights-core:3.4.17=compileClasspath,runtimeClasspath
com.microsoft.azure:applicationinsights-core:3.4.18=compileClasspath,runtimeClasspath
com.nimbusds:content-type:2.2=compileClasspath,runtimeClasspath
com.nimbusds:lang-tag:1.7=compileClasspath,runtimeClasspath
com.nimbusds:nimbus-jose-jwt:9.24.4=compileClasspath,runtimeClasspath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@
public class BackendAndDatabaseHealthIndicator implements HealthIndicator {
private final FeatureFlagRepository _ffRepo;
private final OktaRepository _oktaRepo;
public static final String ACTIVE_LITERAL = "ACTIVE";

@Override
public Health health() {
try {
_ffRepo.findAll();
String oktaStatus = _oktaRepo.getApplicationStatusForHealthCheck();

if (oktaStatus.equals("ACTIVE")) {
log.info("Okta status didn't return active, instead returned %s", oktaStatus);
if (!ACTIVE_LITERAL.equals(oktaStatus)) {
log.info("Okta status didn't return ACTIVE, instead returned " + oktaStatus);
return Health.down().build();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package gov.cdc.usds.simplereport.idp.repository;

import static gov.cdc.usds.simplereport.api.heathcheck.BackendAndDatabaseHealthIndicator.ACTIVE_LITERAL;

import com.okta.sdk.resource.model.UserStatus;
import gov.cdc.usds.simplereport.api.CurrentTenantDataAccessContextHolder;
import gov.cdc.usds.simplereport.api.model.errors.ConflictingUserException;
Expand Down Expand Up @@ -434,7 +436,6 @@ public Integer getUsersInSingleFacility(Facility facility) {

@Override
public String getApplicationStatusForHealthCheck() {
String FAKE_STATUS = "ACTIVE";
return FAKE_STATUS;
return ACTIVE_LITERAL;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public ZoneId getZoneIdByLookup(Lookup lookup) {
try {
timezoneInfo = getTimezoneInfoByLookup(lookup);
} catch (InvalidAddressException | IllegalGraphqlArgumentException exception) {
log.error("Unable to find timezone by testing lab address", exception);
log.error("Unable to find timezone with provided address", exception);
}
if (timezoneInfo == null) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,14 +236,6 @@ private Map<String, String> transformCsvRow(Map<String, String> row) {
var updatedSpecimenType =
modifyRowSpecimenNameToSNOMED(row.get(SPECIMEN_TYPE_COLUMN_NAME).toLowerCase());

var testingLabAddress =
new StreetAddress(
row.get("testing_lab_street"),
row.get("testing_lab_street2"),
row.get("testing_lab_city"),
row.get("testing_lab_state"),
row.get("testing_lab_zip_code"),
null);
var providerAddress =
new StreetAddress(
row.get("ordering_provider_street"),
Expand All @@ -255,9 +247,7 @@ private Map<String, String> transformCsvRow(Map<String, String> row) {

var testResultDate =
convertToZonedDateTime(
row.get(TEST_RESULT_DATE_COLUMN_NAME),
resultsUploaderCachingService,
testingLabAddress);
row.get(TEST_RESULT_DATE_COLUMN_NAME), resultsUploaderCachingService, providerAddress);

var orderTestDate =
convertToZonedDateTime(
Expand All @@ -276,15 +266,15 @@ private Map<String, String> transformCsvRow(Map<String, String> row) {
? convertToZonedDateTime(
row.get(TESTING_LAB_SPECIMEN_RECEIVED_DATE_COLUMN_NAME),
resultsUploaderCachingService,
testingLabAddress)
providerAddress)
: orderTestDate;

var dateResultReleased =
StringUtils.isNotBlank(row.get(DATE_RESULT_RELEASED_COLUMN_NAME))
? convertToZonedDateTime(
row.get(DATE_RESULT_RELEASED_COLUMN_NAME),
resultsUploaderCachingService,
testingLabAddress)
providerAddress)
: testResultDate;

row.put(SPECIMEN_TYPE_COLUMN_NAME, updatedSpecimenType);
Expand Down
4 changes: 2 additions & 2 deletions backend/src/main/resources/application-azure-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ twilio:
from-number: "+14045312484"
features:
hivEnabled: false
singleEntryRsvEnabled: false
singleEntryRsvEnabled: true
agnosticEnabled: false
testCardRefactorEnabled: false
testCardRefactorEnabled: true
agnosticBulkUploadEnabled: false
2 changes: 1 addition & 1 deletion backend/src/main/resources/application-azure-stg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ simple-report:
experian:
enabled: true
features:
testCardRefactorEnabled: false
testCardRefactorEnabled: true
Loading

0 comments on commit 183d6e4

Please sign in to comment.