Skip to content

Commit

Permalink
Val -> Prod (#139756)
Browse files Browse the repository at this point in the history
  • Loading branch information
ntsummers1 authored Aug 29, 2024
2 parents 5b25aeb + efa818b commit 7be7e9c
Show file tree
Hide file tree
Showing 45 changed files with 1,985 additions and 975 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ on:
- "!skipci*"

concurrency:
# Ensuring group key matches the destroy workflow currently in master
group: ${{ github.workflow }}-${{ github.ref_name }}
# Ensuring group key matches the destroy workflow currently in main
group: ${{ github.ref_name }}
cancel-in-progress: false

permissions:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/destroy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
description: "Name of the environment to destroy:"
required: true

concurrency:
group: ${{ inputs.environment || github.event.ref }}

permissions:
id-token: write
contents: read
Expand Down
15 changes: 0 additions & 15 deletions .github/workflows/post-deploy-slack-notification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ on:
- 'main'
- 'val'
- 'production'
- 'snyk-**'

jobs:
notify_on_failure:
Expand All @@ -24,20 +23,6 @@ jobs:
MSG_MINIMAL: true
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}

# Notify the integrations channel only when a Snyk auto merge fails
notify_failed_snyk_auto_merge:
runs-on: ubuntu-latest
#only check branch names that begin with snyk-
if: ${{ github.event.workflow_run.conclusion == 'failure' && startsWith(github.event.workflow_run.head_branch, 'snyk-') }}
steps:
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_TITLE: ":boom: A Synk auto merge has failed in ${{ github.repository }}"
SLACK_MESSAGE: "${{ github.event.workflow_run.html_url }}"
MSG_MINIMAL: true
SLACK_WEBHOOK: ${{ secrets.INTEGRATIONS_SLACK_WEBHOOK }}

# Sends a slack message to the mdct-prod-releases channel in CMS slack
notify_on_prod_release:
runs-on: ubuntu-latest
Expand Down
19 changes: 1 addition & 18 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PRNUM: ${{ github.event.pull_request.number }}
PR_AUTHOR: ${{ github.event.pull_request.user.login }}

#Notify the integrations channel only when a Snyk auto merge fails pr checks
notify_on_pr_failure:
runs-on: ubuntu-latest
needs:
- linting
- jest-frontend
- jest-backend
#only check branch names that begin with snyk-
if: ${{ failure() && startsWith(github.head_ref, 'snyk-') }}
steps:
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_TITLE: ":boom: A Synk auto merge has failed pull request checks in ${{ github.repository }}."
MSG_MINIMAL: true
SLACK_WEBHOOK: ${{ secrets.INTEGRATIONS_SLACK_WEBHOOK }}
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
24 changes: 0 additions & 24 deletions .github/workflows/snyk-auto-merge.yml

This file was deleted.

9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![Maintainability](https://api.codeclimate.com/v1/badges/f1775f53aedf747e85b2/maintainability)](https://codeclimate.com/repos/6449718c21275100df510ea9/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/f1775f53aedf747e85b2/test_coverage)](https://codeclimate.com/repos/6449718c21275100df510ea9/test_coverage)

### Integration Environment Deploy Status:
## Integration Environment Deploy Status:
| Branch | Build Status |
| ------------- | ------------- |
| main | ![deploy](https://github.com/Enterprise-CMCS/macpro-mdct-carts/actions/workflows/deploy.yml/badge.svg) |
Expand All @@ -16,7 +16,7 @@ CARTS is the CMCS MDCT application for collecting state data related to coverage

Under section 2108(a) of the Act, states must assess the operation of their separate CHIP and Medicaid expansion programs and the progress made in reducing the number of uncovered, low-income children. The results of the assessment are reported to the Secretary by January 1 following the end of the FY in the CHIP Annual Reporting Template System (CARTS). CARTS collects information about programmatic changes, performance goals, program operation, program financing, program challenges and accomplishments.

_Note: The [`main`](https://github.com/Enterprise-CMCS/macpro-mdct-carts/tree/main) branch contains CARTSv3. All code related to CARTSv2 (legacy) can be found in the [`master`](https://github.com/Enterprise-CMCS/macpro-mdct-carts/tree/master) branch._
_Note: The [`main`](https://github.com/Enterprise-CMCS/macpro-mdct-carts/tree/main) branch contains CARTSv3. All code related to CARTSv2 (legacy) can be found in the [`skipci-archive-carts-v2`](https://github.com/Enterprise-CMCS/macpro-mdct-carts/tree/skipci-archive-carts-v2) branch._

## Table of contents

Expand Down Expand Up @@ -115,10 +115,7 @@ On the SEDS side, this topic is updated on every submission of seds data, but CA
- 4th quarter data.
- The rollover for a "new year" is October, and future submissions are not recognized until that threshold

Updates outside of that time frame will need to be manually corrected in CARTS, or the integration will need to be modifed to collect data for old forms. CARTS additionally looks for the `enrollmentCounts` property which is only included in forms 21E and 64.21E (question 7), either by manual trigger or update. See SEDS files:

- [generateEnrollmentTotals](https://github.com/Enterprise-CMCS/macpro-mdct-seds/blob/master/services/app-api/handlers/state-forms/post/generateEnrollmentTotals.js)
- [updateStateForms](https://github.com/Enterprise-CMCS/macpro-mdct-seds/blob/master/services/app-api/handlers/state-forms/post/updateStateForms.js)
Updates outside of that time frame will need to be manually corrected in CARTS, or the integration will need to be modifed to collect data for old forms. CARTS additionally looks for the `enrollmentCounts` property which is only included in forms 21E and 64.21E (question 7), either by manual trigger or update.

For testing convenience, stateuser2 points at AL in CARTS and the stateuser points at AL in SEDS.

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"eslint-plugin-react": "^7.24.0",
"eslint-plugin-react-hooks": "^2.x",
"prettier": "^2.4.1",
"serverless": "^3.38.0",
"serverless": "^3.39.0",
"serverless-bundle": "^6.1.0",
"serverless-cloudfront-invalidate": "^1.12.2",
"serverless-dotenv-plugin": "^3.0.0",
Expand Down
102 changes: 0 additions & 102 deletions services/carts-bigmac-streams/handlers/configureConnectors.js

This file was deleted.

78 changes: 43 additions & 35 deletions services/carts-bigmac-streams/handlers/sinkEnrollmentCounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,47 +14,55 @@ const {
* @param {*} _callback
*/
async function myHandler(event, _context, _callback) {
const json = JSON.parse(event.value);
const sedsTopicKey = `${process.env.sedsTopic}-0`;
if (!event?.records?.[sedsTopicKey]) {
return;
}
const records = event.records[sedsTopicKey];
const currentYear = getReportingYear();
const dynamoClient = buildClient();

if (
json.NewImage.enrollmentCounts &&
json.NewImage.enrollmentCounts.year >= currentYear - 1 &&
json.NewImage.quarter === 4
) {
try {
// eslint-disable-next-line no-console
console.log("Sink message received", json);
const indexToUpdate =
json.NewImage.enrollmentCounts.year === currentYear ? 2 : 1;
let typeOfEnrollment = "Medicaid Expansion CHIP";
let typeKey = "medicaid_exp_chip";
if (json.NewImage.enrollmentCounts.type === "separate") {
typeOfEnrollment = "Separate CHIP";
typeKey = "separate_chip";
}
const stateId = json.NewImage.state_id;
const createdTime = new Date().toLocaleString();
for (const record of records) {
const decodedValue = atob(record.value);
const value = JSON.parse(decodedValue);
if (
value.NewImage.enrollmentCounts &&
value.NewImage.enrollmentCounts.year >= currentYear - 1 &&
value.NewImage.quarter === 4
) {
try {
// eslint-disable-next-line no-console
console.log("Sink message received", value);
const indexToUpdate =
value.NewImage.enrollmentCounts.year === currentYear ? 2 : 1;
let typeOfEnrollment = "Medicaid Expansion CHIP";
let typeKey = "medicaid_exp_chip";
if (value.NewImage.enrollmentCounts.type === "separate") {
typeOfEnrollment = "Separate CHIP";
typeKey = "separate_chip";
}
const stateId = value.NewImage.state_id;
const createdTime = new Date().toLocaleString();

const pk = `${stateId}-${currentYear}`;
const entryKey = `${typeKey}-${indexToUpdate}`;
const pk = `${stateId}-${currentYear}`;
const entryKey = `${typeKey}-${indexToUpdate}`;

const enrollmentEntry = {
filterId: `${currentYear}-02`,
typeOfEnrollment,
indexToUpdate,
stateId,
yearToModify: currentYear,
enrollmentCount: json.NewImage.enrollmentCounts.count,
createdTime,
lastSynced: json.NewImage.lastSynced,
};
const enrollmentEntry = {
filterId: `${currentYear}-02`,
typeOfEnrollment,
indexToUpdate,
stateId,
yearToModify: currentYear,
enrollmentCount: value.NewImage.enrollmentCounts.count,
createdTime,
lastSynced: value.NewImage.lastSynced ?? "",
};

await updateEnrollment(pk, entryKey, enrollmentEntry, dynamoClient);
} catch (error) {
// eslint-disable-next-line no-console
console.log(error);
await updateEnrollment(pk, entryKey, enrollmentEntry, dynamoClient);
} catch (error) {
// eslint-disable-next-line no-console
console.log(error);
}
}
}
}
Expand Down
8 changes: 2 additions & 6 deletions services/carts-bigmac-streams/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,8 @@
"description": "",
"dependencies": {
"@aws-sdk/client-dynamodb": "^3.621.0",
"@aws-sdk/client-ecs": "^3.621.0",
"@aws-sdk/lib-dynamodb": "^3.621.0",
"@aws-sdk/util-dynamodb": "^3.621.0",
"kafkajs": "^1.15.0",
"lodash": "^4.17.21",
"uuid": "^8.3.2"
},
"devDependencies": {}
"kafkajs": "^1.15.0"
}
}
Loading

0 comments on commit 7be7e9c

Please sign in to comment.