Skip to content

Commit

Permalink
10007: PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
rachelschneiderman committed Mar 12, 2024
1 parent dbe2c5b commit b059914
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion cypress/helpers/dynamo/getDynamoCypress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { getCypressEnv } from '../env/cypressEnvironment';
import type {
DeleteRequest,
PutRequest,
} from '../../../web-api/src/persistence/dynamo/dynamoTypes';
} from '@web-api/persistence/dynamo/dynamoTypes';

let dynamoCache: DynamoDBClient;
let documentCache: DynamoDBDocument;
Expand Down
7 changes: 6 additions & 1 deletion cypress/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
"noEmit": true,
"target": "es5",
"lib": ["es5", "dom"],
"types": ["cypress", "node"]
"types": ["cypress", "node"],
"paths": {
"@web-api/*": [
"../web-api/src/*"
],
}
},
"include": ["**/*.ts"]
}
12 changes: 6 additions & 6 deletions scripts/dynamo/set-maintenance-mode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ import { InvokeCommand, LambdaClient } from '@aws-sdk/client-lambda';

// # Arguments
// # - $1 - true to engage maintenance mode, false to disengage maintenance mode
// # - $2 - the environment to set the flag

const args = process.argv.slice(2);
const enableMaintenanceMode: boolean = args[0] === 'true';
const env: string = args[1];

const { ENV } = process.env;

if (typeof enableMaintenanceMode !== 'boolean') {
throw new Error('A value for enable maintenance mode is required.');
}
if (typeof env !== 'string') {
if (typeof ENV !== 'string') {
throw new Error('A value for env is required.');
}

Expand All @@ -29,7 +29,7 @@ async function setMaintenanceMode() {
});
const currentColorRecord = await documentClient.get({
Key: { pk: 'current-color', sk: 'current-color' },
TableName: `efcms-deploy-${env}`,
TableName: `efcms-deploy-${ENV}`,
});
const activeColor: 'blue' | 'green' | undefined =
currentColorRecord?.Item?.current;
Expand All @@ -48,11 +48,11 @@ async function setMaintenanceMode() {
});

console.log(
`Setting Maintenance mode to ${enableMaintenanceMode} for ${env}`,
`Setting Maintenance mode to ${enableMaintenanceMode} for ${ENV}`,
);

const command = new InvokeCommand({
FunctionName: `send_maintenance_notifications_${env}_${activeColor}`,
FunctionName: `send_maintenance_notifications_${ENV}_${activeColor}`,
InvocationType: 'RequestResponse',
Payload: Buffer.from(
JSON.stringify({
Expand Down
2 changes: 1 addition & 1 deletion scripts/jest-scripts.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const config: Config = {
'!dynamo/fix-race-condition-served-in-drafts.ts',
'!dynamo/read-segment.ts',
'!dynamo/set-local-migration-complete-marker.ts',
'!dynamo/set-maintenance-mode.ts',
'!elasticsearch/create-temporary-indices.ts',
'!elasticsearch/docket-entry-search.ts',
'!elasticsearch/docket-inbox.ts',
Expand All @@ -34,7 +35,6 @@ const config: Config = {
'!judge/update-judge-isSeniorJudge.ts',
'!reports/**',
'!run-once-scripts/**',
'!dynamo/set-maintenance-mode.ts',
'!upload-practitioner-application-packages.ts',
'!user/**',
],
Expand Down
4 changes: 2 additions & 2 deletions web-api/jest-unit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ const config: Config = {
'src/**/*.{js,ts}',
'workflow-terraform/migration/main/lambdas/migrations/*.{js,ts}',
'!src/applicationContext.{js,ts}',
'!src/gateways/worker/workerLocal.ts',
'!src/getPersistenceGateway.{js,ts}',
'!src/getUseCases.{js,ts}',
'!src/getUseCaseHelpers.{js,ts}',
'!src/getPersistenceGateway.{js,ts}',
'!src/getUserGateway.ts',
'!src/gateways/worker/workerLocal.ts',
'!src/**/*Handlers.{js,ts}',
'!src/**/*Lambda.{js,ts}',
'!src/app.{js,ts}',
Expand Down

0 comments on commit b059914

Please sign in to comment.