-
Notifications
You must be signed in to change notification settings - Fork 1
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
Fixing our build #239
Fixing our build #239
Conversation
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Philip Ermish <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Philip Ermish <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: LaShawn Toyoda <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: LaShawn Toyoda <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: LaShawn Toyoda <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* fix: add firebase service account key to env variable Prior to this change, a new developer starting server would get an error message saying private key is missing. Installed dotenv to handle environment variables in the code. Updated README with instructions on how to get a private key from firebase and how to add it to the local env file. * docs: Add instructions for setting up Firebase Service Account
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
The reason for this change is to allow users to submit incomplete information to be reviewed by moderators prior to being searchable on the website
* feat: implement mutation for addFacility * feat: implement mutation for addHealthcareProfessional * refactor: fix healthcareProfessionalService types * refactor: fix types and move function
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Philip Ermish <[email protected]>
* chore: update healthcareProfessional service * feat: add new Facility with HealthcareProfessional Ids * refactor: clean up imports * feat: add the isDeleted field to Facility and HealthcareProfessional
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: LaShawn Toyoda <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: LaShawn Toyoda <[email protected]>
* feat: implement end-to-end testing with Jest and Supertest Prior to this commit the tests that were in place were legacy tests for when our tech stack included Prisma and Postgres. Now that we're using Firestore they're no longer needed. * feat: add GitHub action to run tests * feat: add mock firebase config for jest Co-authored-by: Anissa Chadouli [email protected] * docs: update testing instructions * test: happy path is successful * refactor: separate env variables for dev and prod Co-authored-by: Philip Ermish <[email protected]> * chore: fix docker in github actions Co-authored-by: Philip Ermish <[email protected]> * chore: fix docker in github actions Co-authored-by: Philip Ermish <[email protected]> * chore: fix yarn path Co-authored-by: Philip Ermish <[email protected]> * chore: check in dev and prod env Co-authored-by: Philip Ermish <[email protected]> * Update README.md * Update __tests__/server.test.ts * Update src/index.ts --------- Co-authored-by: Philip Ermish <[email protected]>
Removed dependencies detected. Learn more about Socket for GitHub ↗︎ 🚮 Removed packages: @apollo/[email protected], @types/[email protected], [email protected], [email protected], [email protected], [email protected] |
@ermish When I run try to run
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Off to a good start! ✨ Let's separate these into different PRs since they address very different issues. Also, let's make sure that the fake data is correct before merging. We have more active members in the repo now with various skill levels and we want to make sure that everything that gets merged into main
is functional.
Also, you might want to rebase because it's showing 33 commits. |
@ermish Don't forget to include descriptive PR titles. |
import { Facility } from '../typeDefs/gqlTypes' | ||
|
||
export const fakeFacilities = () => { | ||
const facility : Facility = { | ||
nameEn: 'Zoo', | ||
nameJa: '動物園', | ||
contact: { | ||
address: { | ||
// generate fake data from type PhysicalAddress in gqlTypes.ts file | ||
addressLine1En: '1-1-1', | ||
addressLine2En: 'Ueno', | ||
cityEn: 'Taito', | ||
prefectureEn: 'Tokyo', | ||
postalCode: '100-0000' | ||
}, | ||
email: '[email protected]', | ||
phone: '08000000000', | ||
website: 'https://zoo.test.com', | ||
mapsLink: '' | ||
}, | ||
healthcareProfessionalIds: [], | ||
healthcareProfessionals: [] | ||
} | ||
|
||
return [facility] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file was removed in #227 because it wasn't being used. Is there a reason we need to reintroduce the fake data?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, we want fake data.
- this will be used for when we want to test endpoints by adding data, updating it, then deleting it.
- we will also want seed data for when we load up a fake/test database so the site isn't empty.
Keep in mind this is just a starting point and we'll need to update this iteratively.
import { HealthcareProfessional, Locale, LocaleName, Degree, | ||
Specialty, SpecialtyName, SpokenLanguage, Insurance } from '../typeDefs/gqlTypes' | ||
|
||
export const fakeHealthcareProfessionals = () => { | ||
const doctorDoctor : LocaleName = { | ||
lastName: 'Doctor', | ||
firstName: 'Doctor', | ||
middleName: 'MD', | ||
locale: Locale.English | ||
} | ||
const medicalDegree : Degree = { | ||
nameJa: 'メヂカル', | ||
nameEn: 'Medical', | ||
abbreviation: 'MD' | ||
} | ||
|
||
const japanese : SpokenLanguage = { | ||
iso639_3: 'ja', | ||
nameJa: '日本語', | ||
nameEn: 'Japanese', | ||
nameNative: 'Japanese' | ||
} | ||
|
||
const neurologyEn : SpecialtyName = { | ||
name: 'Neurology', | ||
locale: Locale.English | ||
} | ||
|
||
const neurology : Specialty = { | ||
names: [neurologyEn] | ||
} | ||
|
||
const healthcareProfessionalOne : HealthcareProfessional = { | ||
names: [doctorDoctor], | ||
degrees: [medicalDegree], | ||
spokenLanguages: [japanese], | ||
specialties: [neurology], | ||
acceptedInsurance: [Insurance.InternationalHealthInsurance], | ||
isDeleted: false | ||
} | ||
|
||
const name : LocaleName = { | ||
lastName: 'チェ', | ||
firstName: 'ジェイコブ', | ||
middleName: 'ベイヤード', | ||
locale: Locale.Japanese | ||
} | ||
const englishDegree : Degree = { | ||
nameJa: '英語', | ||
nameEn: 'English', | ||
abbreviation: 'En' | ||
} | ||
|
||
const english : SpokenLanguage = { | ||
iso639_3: 'en-US', | ||
nameJa: '英語', | ||
nameEn: 'English', | ||
nameNative: 'English' | ||
} | ||
|
||
const specialtyName : SpecialtyName = { | ||
name: 'Pandas', | ||
locale: Locale.English | ||
} | ||
|
||
const pandaSpecialty : Specialty = { | ||
names: [specialtyName] | ||
} | ||
|
||
const healthcareProfessionalTwo : HealthcareProfessional = { | ||
names: [name], | ||
degrees: [englishDegree], | ||
spokenLanguages: [english], | ||
specialties: [pandaSpecialty], | ||
acceptedInsurance: [Insurance.InternationalHealthInsurance], | ||
isDeleted: false | ||
} | ||
|
||
return [healthcareProfessionalOne, healthcareProfessionalTwo] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file was also removed in #227
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, I realized that we removed it. We shouldn't have 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ermish I asked this in the issue, but I'll ask it again here. What can this fake data do that auto-mocking from the schema can't? It seems like extra work to manually seed the db with files that will have to be updated and maintained.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
answered in the previous comment:
yes, we want fake data.
this will be used for when we want to test endpoints by adding data, updating it, then deleting it.
we will also want seed data for when we load up a fake/test database so the site isn't empty.
Keep in mind this is just a starting point and we'll need to update this iteratively.
import { addHealthcareProfessional } from './services/healthcareProfessionalService' | ||
import { addFacility } from './services/facilityService' | ||
|
||
import { fakeHealthcareProfessionals } from './fakeData/healthcareProfessional' | ||
import { fakeHealthcareProfessionals } from './fakeData/healthcareProfessionals' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to use mock data that's autogenerated instead of seed files that will have to be updated and maintained when schema changes are made. What are your thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for tests, yes, but we're likely going to want initial seed data to have the site functional beyond testing a single endpoint. So basically, we'll want both.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we should use real examples then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's what these are 😆
I'd like to keep it together as these were the changes needed to get the build working. The only part that is extra is the package updates, but it's part of my work to get the build working with up to date packages |
yup! I might put this in draft as it was working, but I rebased and have to fix it again. I'll ping you when it's actually ready to be tested. |
ok @theyokohamalife, build works again! please check |
@ermish I get the following error after your latest commit: |
hmmm I don't think you have the latest commit. It fixes that. 🤔 |
@ermish You're right. Just pulled again and it built without errors. 👍🏾 I think this is good to go after you get CI to pass. |
CI Passed! It's just the in progress workflows that are failing. I can comment them out I guess to have it pass |
ok @theyokohamalife it's ready, please approve! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Nice work!
Resolves #235
Resolves #236
Resolves #237
Resolves #238
#This PR fixes the current production build
What changed
Testing instructions
yarn prod:build
and see no errors