From b059461dc3c746796cda9a37a18f6e8cfa3b044b Mon Sep 17 00:00:00 2001 From: Mojo Talantikite Date: Wed, 19 Jul 2023 17:43:45 -0400 Subject: [PATCH] Fix statusCode return value in migrate lambdas (#1824) * move back to main * test continue on error * statuscode jq change * change return type. revert StatusCode * add comment to clarify what this step is --- .github/workflows/deploy-app-to-env.yml | 3 ++- .github/workflows/deploy.yml | 2 +- services/app-api/src/handlers/proto_to_db.ts | 9 ++++++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy-app-to-env.yml b/.github/workflows/deploy-app-to-env.yml index b414e15570..7c2a8d177b 100644 --- a/.github/workflows/deploy-app-to-env.yml +++ b/.github/workflows/deploy-app-to-env.yml @@ -137,9 +137,10 @@ jobs: run: | ./scripts/invoke-migrate-lambda.sh app-api-$STAGE_NAME-migrate \$LATEST "Migration of the database failed." - - name: invoke proto_to_db lambda + - name: invoke proto_to_db lambda -- (rates refactor migrate) id: invoke-proto_to_db working-directory: services/app-api + continue-on-error: true env: STAGE_NAME: ${{ inputs.stage_name }} run: | diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 583395812b..fc84313696 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -277,7 +277,7 @@ jobs: needs.api-unit-tests.result == 'success' && needs.build-prisma-client-lambda-layer.result == 'success' && needs.begin-deployment.result == 'success' - uses: Enterprise-CMCS/managed-care-review/.github/workflows/deploy-app-to-env.yml@ma_3212_migration_lambda + uses: Enterprise-CMCS/managed-care-review/.github/workflows/deploy-app-to-env.yml@mt-sha-to-main with: environment: dev stage_name: ${{ needs.begin-deployment.outputs.stage-name }} diff --git a/services/app-api/src/handlers/proto_to_db.ts b/services/app-api/src/handlers/proto_to_db.ts index 82ef325edc..2395036d97 100644 --- a/services/app-api/src/handlers/proto_to_db.ts +++ b/services/app-api/src/handlers/proto_to_db.ts @@ -1,4 +1,4 @@ -import { Handler } from 'aws-lambda' +import { Handler, APIGatewayProxyResultV2 } from 'aws-lambda' import { initTracer, initMeter } from '../../../uploads/src/lib/otel' import { configurePostgres } from './configuration' import { NewPostgresStore } from '../postgres/postgresStore' @@ -47,7 +47,10 @@ export const getRevisions = async ( return result } -export const main: Handler = async (event, context) => { +export const main: Handler = async ( + event, + context +): Promise => { // Check on the values for our required config const stageName = process.env.stage ?? 'stageNotSet' const serviceName = `proto_to_db_lambda-${stageName}` @@ -78,5 +81,5 @@ export const main: Handler = async (event, context) => { message: 'Lambda function executed successfully', packageId: pkgID, }), - } + } as APIGatewayProxyResultV2 }