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

Added Evaluation Mode (#251) #288

Merged
merged 21 commits into from
Aug 12, 2021
Merged

Conversation

mayankbucha
Copy link
Contributor

@mayankbucha mayankbucha commented Jul 30, 2021

Hi @Coteh, evaluation mode for the issue #251 is added. I have used EVALUATION_MODE flag, which when set to true adds evaluation mode and removes uploaded image after 5 mins.
I have also converted startDatabaseClient function callbacks to promise, but they are simple promises and still looks like callbacks. Can we improve them?
Please review

@codecov
Copy link

codecov bot commented Jul 30, 2021

Codecov Report

Merging #288 (2453c9a) into development (7e30d29) will decrease coverage by 0.16%.
The diff coverage is 54.83%.

Impacted file tree graph

@@               Coverage Diff               @@
##           development     #288      +/-   ##
===============================================
- Coverage        56.00%   55.83%   -0.17%     
===============================================
  Files               15       15              
  Lines             1150     1166      +16     
===============================================
+ Hits               644      651       +7     
- Misses             506      515       +9     
Impacted Files Coverage Δ
lib/database-ops.js 55.40% <54.83%> (-0.69%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7e30d29...2453c9a. Read the comment docs.

Copy link
Owner

@Coteh Coteh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work! I have left some feedback for you to take a look at.

lib/database-ops.js Outdated Show resolved Hide resolved
lib/database-ops.js Outdated Show resolved Hide resolved
lib/database-ops.js Outdated Show resolved Hide resolved
lib/database-ops.js Outdated Show resolved Hide resolved
lib/database-ops.js Outdated Show resolved Hide resolved
lib/database-ops.js Outdated Show resolved Hide resolved
lib/database-ops.js Outdated Show resolved Hide resolved
@mayankbucha
Copy link
Contributor Author

Hi @Coteh, I have implemented the changes. Please review

@mayankbucha mayankbucha requested a review from Coteh August 4, 2021 19:43
Copy link
Owner

@Coteh Coteh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work! Got a couple more suggestions.

lib/database-ops.js Outdated Show resolved Hide resolved
lib/database-ops.js Outdated Show resolved Hide resolved
@mayankbucha mayankbucha requested a review from Coteh August 5, 2021 17:44
lib/database-ops.js Outdated Show resolved Hide resolved
lib/database-ops.js Outdated Show resolved Hide resolved
@mayankbucha mayankbucha requested a review from Coteh August 7, 2021 20:01
lib/database-ops.js Show resolved Hide resolved
lib/database-ops.js Show resolved Hide resolved
@mayankbucha mayankbucha requested a review from Coteh August 8, 2021 11:24
Copy link
Owner

@Coteh Coteh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we're almost done! Just one more thing I noticed that I didn't before, and a couple of very small adjustments in startDatabaseClient.

I think startDatabaseClient is good enough for now. If there's any more indexes or collections that need to be created in the future, then it should probably be cleaned up to be in a chain of promises or something. I think as more things get added, we can get a good idea of how it can be abstracted.

lib/database-ops.js Outdated Show resolved Hide resolved
lib/database-ops.js Show resolved Hide resolved
lib/database-ops.js Outdated Show resolved Hide resolved
@mayankbucha mayankbucha requested a review from Coteh August 8, 2021 19:25
@mayankbucha
Copy link
Contributor Author

I have updated the changes. I have mistakenly pushed bat file to start mongodb. I have deleted it and and committed the changes. I cannot figure out why the codecov/patch is failing.

Yes, for startDatabaseClient we could refactor it to be more linear when adding new indexes in future.

I am learning a lot about js, node and github by contributing to this project. Hope to continue resolving issues for the project. 😃

@Coteh
Copy link
Owner

Coteh commented Aug 8, 2021

No problem. I think codecov/patch is failing because there aren't any automated tests that cover those particular lines of code. Usually, some automated unit tests or integration tests would need to be written here to cover those cases, but since there hasn't been any tests written for database-ops yet, I'll merge the changes as-is for this particular case. I have already done some manual testing for this feature and plan on doing some more testing before it reaches mater. Adding automated tests for database-ops is something I'd like to get to at some point though, as that is the preferred and the proper approach.

Copy link
Owner

@Coteh Coteh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one more quick change I noticed and I think we should be good to go after that.

Thanks so much for the contribution, and glad you are getting some learning out of this! :D

README.md Outdated Show resolved Hide resolved
@mayankbucha mayankbucha requested a review from Coteh August 9, 2021 18:18
Copy link
Owner

@Coteh Coteh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks again for the contribution! :)

@Coteh Coteh merged commit 667f31b into Coteh:development Aug 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants