Skip to content

Commit

Permalink
Val -> Prod (#822)
Browse files Browse the repository at this point in the history
  • Loading branch information
jessabean authored Dec 13, 2024
2 parents 11a3ac3 + 71d2c72 commit 4a12813
Show file tree
Hide file tree
Showing 141 changed files with 7,194 additions and 6,570 deletions.
5 changes: 3 additions & 2 deletions .github/branch-name-validation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
set -e

local_branch=${1}
[ -z "${1}" ] && local_branch=$(git rev-parse --abbrev-ref HEAD)

valid_branch='^[a-z][a-z0-9-]*$'

Expand All @@ -15,7 +16,7 @@ join_by() { local IFS='|'; echo "$*"; }
#creates glob match to check for reserved words used in branch names which would trigger failures
glob=$(join_by $(for i in ${reserved_words[@]}; do echo "^$i-|-$i$|-$i-|^$i$"; done;))

if [[ ! $local_branch =~ $valid_branch ]] || [[ $local_branch =~ $glob ]] || [[ ${#local_branch} -gt 64 ]]; then
if [[ ! $local_branch =~ $valid_branch ]] || [[ $local_branch =~ $glob ]] || [[ ${#local_branch} -gt 20 ]]; then
echo """
------------------------------------------------------------------------------------------------------------------------------
ERROR: Please read below
Expand All @@ -28,7 +29,7 @@ if [[ ! $local_branch =~ $valid_branch ]] || [[ $local_branch =~ $glob ]] || [[
Therefore, the branch name must be a valid service name. Branch name must be all lower case with no spaces and no underscores.
From Serverless:
A service name should only contain alphanumeric (case sensitive) and hyphens. It should start with an alphabetic character and shouldnt exceed 128 characters.
A service name should only contain alphanumeric (case sensitive) and hyphens. It should start with an alphabetic character and shouldnt exceed 20 characters.
For Github Actions support, please push your code to a new branch with a name that meets Serverless' service name requirements.
So, make a new branch with a name that begins with a letter and is made up of only letters, numbers, and hyphens... then delete this branch.
------------------------------------------------------------------------------------------------------------------------------
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: "3.10"
- name: Configure pre-commit to skip branch name validation
run: |
echo "SKIP=branch-name-validation" >> $GITHUB_ENV
- uses: pre-commit/[email protected]
- uses: actions/setup-node@v4
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ services/database/local_buckets
/playwright-report/
/blob-report/
/playwright/.cache/
playwright/.auth
9 changes: 7 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ repos:
args:
- --exclude-files
- .*test\.json
- --exclude-files
- .*\.postman_collection\.json
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.0.272
Expand All @@ -49,3 +47,10 @@ repos:
rev: v8.12.0
hooks:
- id: gitleaks
- repo: local
hooks:
- id: branch-name-validation
name: branch-name-validation
entry: .github/branch-name-validation.sh
language: script
pass_filenames: false
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ MFP is the CMCS MDCT application for collecting state data related to the [Money

The MFP demonstration supports state efforts for rebalancing their long-term services and supports system so that individuals have a choice of where they live and receive services. From the start of the program in 2008 through the end of 2020, states have transitioned over 107,000 people to community living under MFP.

Project Goals:
- Increase the use of home and community-based services (HCBS) in the Medicaid program
- Eliminate barriers or mechanisms that prevent or restrict the flexible use of Medicaid funds to enable Medicaid-eligible individuals to receive support for appropriate and necessary long-term services and supports in the settings of their choice
- Increase the ability of state Medicaid programs to assure continued provision of HCBS to eligible individuals who choose to transition from an institutional to a community setting
- Ensure that procedures are in place to provide quality assurance for eligible individuals receiving Medicaid HCBS and to provide for continuous quality improvement in such services

## Table of Contents

- [Quick Start](#quick-start)
Expand Down Expand Up @@ -90,8 +96,6 @@ Local dev is built around the Serverless plugin [serverless-offline](https://git

Local authorization bypasses Cognito. The frontend mimics login in local storage with a mock user and sends an id in the `cognito-identity-id` header on every request. `serverless-offline` expects that and sets it as the cognitoId in the requestContext for your lambdas, just like Cognito would in AWS.

The [postman folder](./postman/) contains a full API collection and environment for this application. See the [README](./postman/README.md) for more information.

## Testing

### Unit Testing
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"devDependencies": {
"@axe-core/playwright": "^4.10.0",
"@faker-js/faker": "^8.4.1",
"@playwright/test": "^1.44.0",
"@playwright/test": "^1.48.0",
"@serverless/compose": "^1.3.0",
"@stratiformdigital/serverless-stage-destroyer": "^2.0.0",
"@types/dotenv": "^8.2.0",
Expand Down
6 changes: 6 additions & 0 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,15 @@ export default defineConfig({

/* Configure projects for major browsers */
projects: [
{
name: "setup",
use: { ...devices["Desktop Chrome"] },
testMatch: /.*\.setup\.ts/,
},
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
dependencies: ["setup"],
},
],

Expand Down
667 changes: 0 additions & 667 deletions postman/MFP.postman_collection.json

This file was deleted.

51 changes: 0 additions & 51 deletions postman/MFP.postman_environment.json

This file was deleted.

60 changes: 0 additions & 60 deletions postman/README.md

This file was deleted.

14 changes: 12 additions & 2 deletions services/app-api/db/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
/* eslint-disable no-console */
export const createdLog = (obj: any, type: string): void => {
export const createdLog = (obj: any, action: string, type: string): void => {
const { id, submissionName } = obj;
console.log(`${type} created: ${submissionName} (${id})`);
if (id) {
console.log(`${action} ${type} created: ${submissionName} (${id})`);
} else {
console.log(`ℹ️ ${obj}`);
console.log(
`⚠️ Could not create ${action.toLowerCase()} ${type} for reporting period.`
);
}
};

export const expandedLog = (json: any): void => {
console.log(JSON.stringify(json, null, 2));
};

export const generateReportingPeriod = (year: number, period: number) =>
`${year} Period ${period}`;
53 changes: 53 additions & 0 deletions services/app-api/db/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import { Choice } from "prompts";
import {
getSemiAnnualReportsByState,
getWorkPlansByState,
state,
} from "../../../tests/seeds/options";
import { SeedReportShape } from "../../../tests/seeds/types";
import { generateReportingPeriod } from "./helpers";

export const workPlanChoices = async (): Promise<Choice[]> => {
try {
Expand All @@ -28,3 +30,54 @@ export const semiAnnualReportChoices = async (): Promise<Choice[]> => {
process.exit();
}
};

export const backToMenu = {
title: "Back to Menu",
value: "back",
};

export const generateChoices = (
type: string,
year: number,
period: number
): Choice[] => {
const reportingPeriod = generateReportingPeriod(year, period);

const choices = [
{
title: `Create base ${type}: ${reportingPeriod}`,
value: `create${type}`,
},
{
title: `Create filled ${type}: ${reportingPeriod}`,
value: `createFilled${type}`,
},
{
title: `Create submitted ${type}: ${reportingPeriod}`,
value: `createSubmitted${type}`,
},
{
title: `Create locked ${type}: ${reportingPeriod}`,
value: `createLocked${type}`,
},
{
title: `Create archived ${type}: ${reportingPeriod}`,
value: `createArchived${type}`,
},
{ title: `Get ${type} by id`, value: `get${type}ById` },
{
title: `Get ${type}s by state: ${state}`,
value: `get${type}sByState`,
},
backToMenu,
];

if (type === "WP") {
choices.splice(3, 0, {
title: `Create approved ${type}: ${reportingPeriod}`,
value: `createApproved${type}`,
});
}

return choices;
};
Loading

0 comments on commit 4a12813

Please sign in to comment.