-
Notifications
You must be signed in to change notification settings - Fork 25
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
Fix/api dbs #2113
Fix/api dbs #2113
Conversation
Does this resolve our discussion on issue #2098? If so let's close. |
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.
Thanks for the notes @chrismclarke, seems like a big headache. I haven't dived into all the code, but I am able to run the e2e tests with positive results:
I did have an issue with the umzug
package when I initially ran yarn workspace api start
I resolved this by resetting the required version of umzug
in packages/api/package.json
to "umzug": "3.2.1"
(this PR otherwise bumps up the version number to "^3.3.1"
). I'm not sure why that would cause issues on my machine and not yours. Looking at the package's release notes, there were some issues with release 3.3.0
but I'm not sure if that's relevant
Thanks for the review @jfmcquade . Weird issue with umzug, but glad you could get working locally. @esmeetewinkel - just to clarify on the related issue. This PR should indeed fix, however only once the code has been deployed to the server. I think it would probably be best to wait until next week after the additional pr #2115 raised/reviewed/merged (to allow for some extra testing), although if that PR gets stalled or needed urgently then we could make separate server updates for each PR |
PR Checklist
Description
Review Notes
I doubt the code changes will make much sense (a suuuper deep dive into nestJS/sequelize issues), but it might be useful if you are able to confirm that you can at least setup the e2e tests (see notes in updated documentation) and run the test suite to confirm similar outcomes.
Dev Notes
This issue was really awful to debug, so many moving pieces on top of a lot of layers of obscurity with how nest-js -> sequelize-typescript -> sequelize -> postgres, with various levels at which services are instantiated (sometimes globally, sometimes per request, not always as expected (e.g. global services still created per-request when interacted with via middleware).
The new testing infrastructure should hopefully help a lot moving forwards, but it still feels like what we're trying to achieve with the database goes far beyond what the system really should be used for.
Ultimately there were a few core issues which should now be resolved, namely:
Follow-up Tasks (Post Merge)
new User(...)
), in favour of deployment service methods (e.g.this.model.create(...)
Git Issues
Closes #2098
Screenshots/Videos
Set of tests created (passing)
Example output - 5 users written concurrently to 5 different databases
Responses above additionally verified by specific db queries, e.g. query all rows for
test_e2e_ad695a_2