Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test → val #11824

Merged
merged 6 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,30 @@ env:
node: true
jest/globals: true
cypress/globals: true
parser: '@typescript-eslint/parser'
parser: "@typescript-eslint/parser"
plugins:
- '@typescript-eslint'
- 'jest'
- 'cypress'
- "@typescript-eslint"
- "jest"
- "cypress"
parserOptions:
ecmaVersion: 6
sourceType: module
ecmaFeatures:
modules: true
extends:
- 'eslint:recommended'
- "eslint:recommended"

rules:
no-const-assign: error
no-duplicate-imports: error
no-unreachable: error
no-unused-vars: off
'@typescript-eslint/no-unused-vars':
"@typescript-eslint/no-unused-vars":
- error
- argsIgnorePattern: "^_"
no-console: error
no-empty: error
no-extra-semi: error
multiline-comment-style:
- error
- starred-block
- starred-block
2 changes: 1 addition & 1 deletion .github/audit-account.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ get_topics () {
TOPICS+=($(echo '{"TOPIC":"'${T}'","STAGE":"'${STAGE}'"}'))
done

jq -s '{TOPICS:.}' <<< ${TOPICS[*]}
jq -s '{TOPICS:.}' <<< ${TOPICS[*]-}
}

#Produce a report with all topics and associated resource tags
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/audit-account.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,19 @@ jobs:
echo "Reports with no entries will be omitted"
CI_ACTIVE="$(./audit-account.sh ci_active resources.json)"
[[ $(jq -r 'length' <<< "${CI_ACTIVE}") -gt 0 ]] && jq -r '(.[0]
| keys_unsorted) as $keys | $keys, map([.[ $keys[] ]])[] | @csv' <<< "${CI_ACTIVE}" > reports/ci_active.csv
| keys_unsorted) as $keys | $keys, map([.[ $keys[] ]])[] | @csv' <<< "${CI_ACTIVE}" > reports/ci_active.csv || :
CI_INACTIVE="$(./audit-account.sh ci_inactive resources.json)"
[[ $(jq -r 'length' <<< "${CI_INACTIVE}") -gt 0 ]] && jq -r '(.[0]
| keys_unsorted) as $keys | $keys, map([.[ $keys[] ]])[] | @csv' <<< "${CI_INACTIVE}" > reports/ci_inactive.csv
| keys_unsorted) as $keys | $keys, map([.[ $keys[] ]])[] | @csv' <<< "${CI_INACTIVE}" > reports/ci_inactive.csv || :
CF_OTHER="$(./audit-account.sh cf_other resources.json)"
[[ $(jq -r 'length' <<< "${CF_OTHER}") -gt 0 ]] && jq -r '(.[0]
| keys_unsorted) as $keys | $keys, map([.[ $keys[] ]])[] | @csv' <<< "${CF_OTHER}" > reports/cf_other.csv
| keys_unsorted) as $keys | $keys, map([.[ $keys[] ]])[] | @csv' <<< "${CF_OTHER}" > reports/cf_other.csv || :
UNTAGGED="$(./audit-account.sh untagged resources.json)"
[[ $(jq -r 'length' <<< "${UNTAGGED}") -gt 0 ]] && jq -r '(.[0]
| keys_unsorted) as $keys | $keys, map([.[ $keys[] ]])[] | @csv' <<< "${UNTAGGED}" > reports/untagged.csv
| keys_unsorted) as $keys | $keys, map([.[ $keys[] ]])[] | @csv' <<< "${UNTAGGED}" > reports/untagged.csv || :
TOPICS="$(./audit-account.sh orphaned_topics)"
[[ $(jq -r 'length' <<< "${TOPICS}") -gt 0 ]] && jq -r '(.[0]
| keys_unsorted) as $keys | $keys, map([.[ $keys[] ]])[] | @csv' <<< "${TOPICS}" > reports/orphaned_topics.csv
| keys_unsorted) as $keys | $keys, map([.[ $keys[] ]])[] | @csv' <<< "${TOPICS}" > reports/orphaned_topics.csv || :
- name: Upload reports
uses: actions/upload-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"homepage": "https://github.com/Enterprise-CMCS/macpro-mdct-mcr#readme",
"dependencies": {
"@enterprise-cmcs/serverless-waf-plugin": "^1.4.0",
"fast-xml-parser": "4.4.0",
"fast-xml-parser": "4.4.1",
"loader-utils": "2.0.4"
},
"devDependencies": {
Expand Down
18 changes: 9 additions & 9 deletions services/app-api/forms/mcpar.json
Original file line number Diff line number Diff line change
Expand Up @@ -1598,11 +1598,11 @@
"choices": [
{
"id": "hzfe4WnueXTUDk0FoFcJcq1G",
"label": "State"
"label": "MCO"
},
{
"id": "v6woH8xYbE59VMs82VxJlisF",
"label": "MCO"
"label": "State"
},
{
"id": "vbuAOFC6DSx397ZoibATdonl",
Expand All @@ -1629,7 +1629,7 @@
"validation": {
"type": "radio",
"nested": true,
"parentFieldName": "program_isThisProgramTypeComprehensiveMCO",
"parentFieldName": "program_doesThisProgramIncludeMCOs",
"parentOptionId": "A4uFU0YyU9useo3DsWjnH264"
},
"props": {
Expand Down Expand Up @@ -1711,7 +1711,7 @@
"validation": {
"type": "date",
"nested": true,
"parentFieldName": "program_isThisProgramTypeComprehensiveMCO",
"parentFieldName": "program_doesThisProgramIncludeMCOs",
"parentOptionId": "A4uFU0YyU9useo3DsWjnH264"
},
"props": {
Expand All @@ -1725,7 +1725,7 @@
"validation": {
"type": "date",
"nested": true,
"parentFieldName": "program_isThisProgramTypeComprehensiveMCO",
"parentFieldName": "program_doesThisProgramIncludeMCOs",
"parentOptionId": "A4uFU0YyU9useo3DsWjnH264"
},
"props": {
Expand All @@ -1739,7 +1739,7 @@
"validation": {
"type": "radio",
"nested": true,
"parentFieldName": "program_isThisProgramTypeComprehensiveMCO",
"parentFieldName": "program_doesThisProgramIncludeMCOs",
"parentOptionId": "A4uFU0YyU9useo3DsWjnH264"
},
"props": {
Expand Down Expand Up @@ -1777,7 +1777,7 @@
"validation": {
"type": "radio",
"nested": true,
"parentFieldName": "program_isThisProgramTypeComprehensiveMCO",
"parentFieldName": "program_doesThisProgramIncludeMCOs",
"parentOptionId": "A4uFU0YyU9useo3DsWjnH264"
},
"props": {
Expand Down Expand Up @@ -1841,7 +1841,7 @@
"validation": {
"type": "radio",
"nested": true,
"parentFieldName": "program_isThisProgramTypeComprehensiveMCO",
"parentFieldName": "program_doesThisProgramIncludeMCOs",
"parentOptionId": "A4uFU0YyU9useo3DsWjnH264"
},
"props": {
Expand Down Expand Up @@ -3986,7 +3986,7 @@
"children": [
{
"type": "html",
"content": "This program is missing plans. You won't be able to complete this section until you've added all the plans that serve enrollees in the program. "
"content": "This program is missing plans. You won't be able to complete this section until you've added all the managed care plans that serve enrollees in the program. "
},
{
"type": "internalLink",
Expand Down
2 changes: 1 addition & 1 deletion services/app-api/handlers/reports/archive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const archiveReport = handler(async (event, context) => {

try {
await dynamoDb.put(reportMetadataParams);
} catch (err) {
} catch {
return {
status: StatusCodes.SERVER_ERROR,
body: error.DYNAMO_UPDATE_ERROR,
Expand Down
11 changes: 5 additions & 6 deletions services/app-api/handlers/reports/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {
reportBuckets,
} from "../../utils/constants/constants";
import { getOrCreateFormTemplate } from "../../utils/formTemplates/formTemplates";
import { logger } from "../../utils/debugging/debug-lib";
import {
copyFieldDataFromSource,
makePCCMModifications,
Expand Down Expand Up @@ -78,16 +77,16 @@ export const createReport = handler(async (event, _context) => {

const julyMcparRelease = unvalidatedMetadata?.julyMcparRelease;

// eslint-disable-next-line no-useless-catch
try {
({ formTemplate, formTemplateVersion } = await getOrCreateFormTemplate(
reportBucket,
reportType,
isProgramPCCM,
julyMcparRelease
));
} catch (err) {
logger.error(err, "Error getting or creating template");
throw err;
} catch (e) {
throw e;
}

// Return MISSING_DATA error if missing unvalidated data or validators.
Expand Down Expand Up @@ -148,7 +147,7 @@ export const createReport = handler(async (event, _context) => {

try {
await s3Lib.put(fieldDataParams);
} catch (err) {
} catch {
return {
status: StatusCodes.SERVER_ERROR,
body: error.S3_OBJECT_CREATION_ERROR,
Expand Down Expand Up @@ -185,7 +184,7 @@ export const createReport = handler(async (event, _context) => {

try {
await dynamoDb.put(reportMetadataParams);
} catch (err) {
} catch {
return {
status: StatusCodes.SERVER_ERROR,
body: error.DYNAMO_CREATION_ERROR,
Expand Down
2 changes: 1 addition & 1 deletion services/app-api/handlers/reports/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export const fetchReport = handler(async (event, _context) => {
fieldData,
},
};
} catch (err) {
} catch {
return {
status: StatusCodes.NOT_FOUND,
body: error.NO_MATCHING_RECORD,
Expand Down
8 changes: 4 additions & 4 deletions services/app-api/handlers/reports/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const releaseReport = handler(async (event) => {

try {
reportMetadata = await dynamoDb.get(reportMetadataParams);
} catch (err) {
} catch {
return {
status: StatusCodes.NOT_FOUND,
body: error.NO_MATCHING_RECORD,
Expand Down Expand Up @@ -137,7 +137,7 @@ export const releaseReport = handler(async (event) => {
any
>;
formTemplate = (await s3Lib.get(getFormTemplateParameters)) as FormJson;
} catch (err) {
} catch {
return {
status: StatusCodes.SERVER_ERROR,
body: error.DYNAMO_UPDATE_ERROR,
Expand Down Expand Up @@ -179,7 +179,7 @@ export const releaseReport = handler(async (event) => {

try {
await dynamoDb.put(putReportMetadataParams);
} catch (err) {
} catch {
return {
status: StatusCodes.SERVER_ERROR,
body: error.DYNAMO_UPDATE_ERROR,
Expand All @@ -198,7 +198,7 @@ export const releaseReport = handler(async (event) => {
};

await s3Lib.put(putObjectParameters);
} catch (err) {
} catch {
return {
status: StatusCodes.SERVER_ERROR,
body: error.S3_OBJECT_CREATION_ERROR,
Expand Down
10 changes: 5 additions & 5 deletions services/app-api/handlers/reports/submit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export const submitReport = handler(async (event, _context) => {
};
try {
await dynamodbLib.put(submitReportParams);
} catch (err) {
} catch {
return {
status: StatusCodes.SERVER_ERROR,
body: error.DYNAMO_UPDATE_ERROR,
Expand All @@ -131,7 +131,7 @@ export const submitReport = handler(async (event, _context) => {
string,
any
>;
} catch (err) {
} catch {
return {
status: StatusCodes.SERVER_ERROR,
body: error.NOT_IN_DATABASE,
Expand Down Expand Up @@ -164,7 +164,7 @@ export const submitReport = handler(async (event, _context) => {
string,
any
>;
} catch (err) {
} catch {
return {
status: StatusCodes.SERVER_ERROR,
body: error.NOT_IN_DATABASE,
Expand All @@ -173,7 +173,7 @@ export const submitReport = handler(async (event, _context) => {

try {
await s3Lib.put(updateFieldDataParams);
} catch (err) {
} catch {
return {
status: StatusCodes.SERVER_ERROR,
body: error.S3_OBJECT_UPDATE_ERROR,
Expand All @@ -190,7 +190,7 @@ export const submitReport = handler(async (event, _context) => {
},
},
};
} catch (err) {
} catch {
return {
status: StatusCodes.NOT_FOUND,
body: error.NO_MATCHING_RECORD,
Expand Down
6 changes: 3 additions & 3 deletions services/app-api/handlers/reports/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const updateReport = handler(async (event, context) => {
body: error.INVALID_DATA,
};
}
} catch (err) {
} catch {
return {
status: StatusCodes.BAD_REQUEST,
body: error.INVALID_DATA,
Expand Down Expand Up @@ -197,7 +197,7 @@ export const updateReport = handler(async (event, context) => {

try {
await s3Lib.put(updateFieldDataParams);
} catch (err) {
} catch {
return {
status: StatusCodes.SERVER_ERROR,
body: error.S3_OBJECT_UPDATE_ERROR,
Expand Down Expand Up @@ -243,7 +243,7 @@ export const updateReport = handler(async (event, context) => {

try {
await dynamoDb.put(reportMetadataParams);
} catch (err) {
} catch {
return {
status: StatusCodes.SERVER_ERROR,
body: error.DYNAMO_UPDATE_ERROR,
Expand Down
12 changes: 6 additions & 6 deletions services/app-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
"typescript": "^4.5.4"
},
"dependencies": {
"@aws-sdk/client-dynamodb": "^3.596.0",
"@aws-sdk/client-s3": "^3.490.0",
"@aws-sdk/client-ssm": "^3.490.0",
"@aws-sdk/lib-dynamodb": "^3.577.0",
"@aws-sdk/s3-request-presigner": "^3.490.0",
"@aws-sdk/util-dynamodb": "^3.602.0",
"@aws-sdk/client-dynamodb": "^3.621.0",
"@aws-sdk/client-s3": "^3.621.0",
"@aws-sdk/client-ssm": "^3.621.0",
"@aws-sdk/lib-dynamodb": "^3.621.0",
"@aws-sdk/s3-request-presigner": "^3.621.0",
"@aws-sdk/util-dynamodb": "^3.621.0",
"aws-jwt-verify": "^3.1.0",
"date-fns": "^2.26.0",
"date-fns-tz": "^1.2.2",
Expand Down
2 changes: 1 addition & 1 deletion services/app-api/utils/validation/completionStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const calculateCompletionStatus = async (
areAllFieldsValid =
(await validateFieldData(validationJson, fieldsToBeValidated)) !==
undefined;
} catch (err) {
} catch {
// Silently ignore error, will result in false
}
return areAllFieldsValid;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const validateData = async (
stripUnknown: true,
...options,
});
} catch (e: any) {
} catch {
throw new Error(error.INVALID_DATA);
}
};
2 changes: 1 addition & 1 deletion services/app-api/utils/validation/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const validateData = async (
stripUnknown: true,
...options,
});
} catch (e: any) {
} catch {
throw new Error(error.INVALID_DATA);
}
};
Expand Down
Loading