Skip to content

Commit

Permalink
Merge branch 'main' into jl-rate-history-flaky-test-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonLin0991 committed Nov 8, 2023
2 parents 40e7366 + 8daa36d commit df2584a
Show file tree
Hide file tree
Showing 50 changed files with 5,907 additions and 603 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ jobs:
- name: Check out repository
uses: actions/checkout@v4

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: yarn
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/promote.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
- name: Check out repository
uses: actions/checkout@v4

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
Expand Down
5 changes: 3 additions & 2 deletions docs/technical-design/howto-update-state-programs.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ The source of truth for that file comes from a CSV maintained by product and des

1. Download the latest version of csv from google docs when prompted by product/design.
2. Run the script following the command listed in the `import-programs.ts`.
3. Overwrite existing state programs JSON with the new output. Your usage of the script will likely look something like this: `cd scripts && yarn tsc && node import-programs.js ~/Desktop/State\ programs,\ population,\ and\ nicknames.csv > ../services/app-web/src/common-code/data/statePrograms.json`
3. Overwrite existing state programs JSON with the new output. Your usage of the script will likely look something like this: `cd scripts && yarn tsc && node import-programs.js path/to/data.csv > ../services/app-web/src/common-code/data/statePrograms.json`
4. Double check the diff. It's important not to delete any programs that have already been used for a submission because although programs are not in the database, we still store references to the program ID in postgres as if they are stable. Also, we want to be sure we are only changing programs expected to change.
5. Make a PR to update the statePrograms file in the codebase
5. For any newly created programs, manually populate the `id` field usings a UUID generator
6. Make a PR to update the statePrograms file in the codebase
5 changes: 4 additions & 1 deletion scripts/import-programs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@
This script is used to generate a list of MC-Review state programs. To read more about this script and why it's used see "How to update state programs" technical design docs.
To run:
yarn tsc && node ./import-programs.js path/to/data.csv
yarn tsc && node ./import-programs.js path/to/data.csv > ../services/app-web/src/common-code/data/statePrograms.json
The input file is expected to be a valid CSV with at least the following columns:
1 State (two-character state code, uppercase)
2 Program (full program name)
3 Nickname (acronym or abbreviation e.g. "CME")
Documentation for this script can be found here:
https://github.com/Enterprise-CMCS/managed-care-review/blob/main/docs/technical-design/howto-update-state-programs.md
Additional columns aren't used and should be ignored.
*/

Expand Down
5 changes: 4 additions & 1 deletion services/app-api/src/resolvers/attributeHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ export function setResolverDetailsOnActiveSpan(
user: Context['user'],
span: Context['span']
): void {
if (!span) return
if (!span) {
console.info(`No span set on ${name} call`)
return
}
span.setAttributes({
[SemanticAttributes.ENDUSER_ID]: user.email,
[SemanticAttributes.ENDUSER_ROLE]: user.role,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ export function indexHealthPlanPackagesResolver(
): QueryResolvers['indexHealthPlanPackages'] {
return async (_parent, _args, context) => {
const { user, span } = context
setResolverDetailsOnActiveSpan('fetchHealthPlanPackage', user, span)

setResolverDetailsOnActiveSpan('indexHealthPlanPackages', user, span)

const ratesDatabaseRefactor = await launchDarkly.getFeatureFlag(
context,
Expand All @@ -70,7 +71,7 @@ export function indexHealthPlanPackagesResolver(

if (contractsWithHistory instanceof Error) {
const errMessage = `Issue finding contracts with history by stateCode: ${user.stateCode}. Message: ${contractsWithHistory.message}`
logError('fetchHealthPlanPackage', errMessage)
logError('indexHealthPlanPackages', errMessage)
setErrorAttributesOnActiveSpan(errMessage, span)

if (contractsWithHistory instanceof NotFoundError) {
Expand Down Expand Up @@ -111,7 +112,7 @@ export function indexHealthPlanPackagesResolver(

if (contractsWithHistory instanceof Error) {
const errMessage = `Issue finding contracts with history by submit info. Message: ${contractsWithHistory.message}`
logError('fetchHealthPlanPackage', errMessage)
logError('indexHealthPlanPackages', errMessage)
setErrorAttributesOnActiveSpan(errMessage, span)

if (contractsWithHistory instanceof NotFoundError) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('currentUser', () => {

expect(res.data?.fetchCurrentUser.email).toBe('james@example.com')
expect(res.data?.fetchCurrentUser.state.code).toBe('FL')
expect(res.data?.fetchCurrentUser.state.programs).toHaveLength(6)
expect(res.data?.fetchCurrentUser.state.programs).toHaveLength(5)
})

it('returns programs for MI', async () => {
Expand Down
1 change: 1 addition & 0 deletions services/app-proto/src/health_plan_form_data.proto
Original file line number Diff line number Diff line change
Expand Up @@ -315,4 +315,5 @@ enum StateCode {
STATE_CODE_WI = 50;
STATE_CODE_WV = 51;
STATE_CODE_WY= 52;
STATE_CODE_KY = 53;
}
4 changes: 4 additions & 0 deletions services/app-web/src/assets/icons/ky-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit df2584a

Please sign in to comment.