Skip to content
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

Issue 753: Updating MongoDB #762

Merged
merged 5 commits into from
Oct 27, 2018
Merged

Issue 753: Updating MongoDB #762

merged 5 commits into from
Oct 27, 2018

Conversation

steaward
Copy link
Contributor

@steaward steaward commented Oct 23, 2018

Hey,

This PR is in respect to issue 753
I've updated the code to fit with MongoDB v3.
Only two things that I noticed that needed changing was the fact the DB is now passed back to the client during the initial connection. I don't know what Trustroots DB name is, so it's left blank by default. The collection 'agendaJobs' is then grabbed.

Ran all tests as well as the scripts to populate the DB with fake data and it's failing on the profile picture tests. However, the master branch from my fork fails on this too?

@simison simison self-requested a review October 23, 2018 19:23
@simison
Copy link
Contributor

simison commented Oct 24, 2018

Thanks!

Looks like package.json and package-lock.json are still out of sync and thus npm ci fails tests in Travis.

Running npm install should update the lock file and you can push changes to it here.

@simison
Copy link
Contributor

simison commented Oct 27, 2018

Thanks for working on this!

I know this might've been a confusingly small task but I like to leave these out there for the community during the Hactoberfest.

Only two things that I noticed that needed changing was the fact the DB is now passed back to the client during the initial connection.

Yap, only the background job worker script uses native driver directly for Agenda's connection (job runner library) — the server app itself uses Mongoose ODM at all levels.

Agenda supports re-using Mongoose connection so we should harmonise the setup as a future iteration.

I don't know what Trustroots DB name is, so it's left blank by default. The collection 'agendaJobs' is then grabbed.

Trustroots DB name depends on environment config and is different for prod, dev and test envs. It's the last bit in these URIs:

uri: 'mongodb://' + (process.env.DB_1_PORT_27017_TCP_ADDR || 'localhost') + '/trustroots-dev',

uri: 'mongodb://' + (process.env.DB_1_PORT_27017_TCP_ADDR || 'localhost') + '/trustroots',

uri: 'mongodb://' + (process.env.DB_1_PORT_27017_TCP_ADDR || 'localhost') + '/trustroots-test',

Worker script gets this via config.db.uri so we're all good. 👌

@simison
Copy link
Contributor

simison commented Oct 27, 2018

Ran all tests as well as the scripts to populate the DB with fake data and it's failing on the profile picture tests.

This could be due missing imagemagic in your computer?

They don't seem to fail on Travis CI currently (this branch shows up green as well).

@simison simison merged commit d1695a4 into Trustroots:master Oct 27, 2018
trmendes pushed a commit to trmendes/trustroots that referenced this pull request Nov 2, 2018
The driver is used by the background job worker script.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants