huskyCI icon indicating copy to clipboard operation
huskyCI copied to clipboard

Update Deprecated "mgo" Module to "mongo-driver"

Open fguisso opened this issue 2 years ago • 9 comments

  1. Problem Description:

    • The "mgo" Golang module is deprecated, and we need to migrate to the "mongo-driver" module.
  2. Steps to Reproduce:

    • N/A (This might not be applicable for this particular update, as it's more of a library replacement.)
  3. Expected Behavior:

    • After the migration, we expect the application to maintain its current functionality while utilizing the "mongo-driver" module for MongoDB operations.
  4. Current Behavior:

    • The "mgo" module is deprecated and will not receive updates or support, which might lead to compatibility issues or security vulnerabilities.
  5. Proposed Changes:

    • Replace all instances of "mgo" with the equivalent functionality provided by the "mongo-driver" module.
  6. Dependencies:

    • Confirm that the project's dependencies are up-to-date.
    • Update the Go module file (go.mod) to include the latest version of "mongo-driver."
    • Confirm the dockerfile in deployments and test local using make install
  7. Testing:

    • Test the application thoroughly to ensure that all MongoDB-related functionalities are working as expected.
    • Suggested test cases:
      • Basic CRUD operations
      • Connection handling
      • Error scenarios
  8. Documentation Updates:

    • Update project documentation to reflect the change in the MongoDB module. Include any additional setup steps or considerations for developers.
  9. Expected Impact:

    • This update ensures that the project remains compatible with the latest MongoDB drivers, addressing any potential security vulnerabilities or compatibility issues.

fguisso avatar Oct 17 '23 03:10 fguisso

hi, what if we move to using qmgo ?

codenoid avatar Oct 17 '23 17:10 codenoid

@codenoid thanks for the indication, but at this point our core maintainers team choose to use mongo-drive. Maybe in the future I will look again to qmgo.

fguisso avatar Oct 19 '23 16:10 fguisso

@fguisso I'll work on this. Can you assign it to me?

michelaquino avatar Oct 28 '23 16:10 michelaquino

https://github.com/codenoid/huskyCI

might help anyone who contribute to this, I can't really find free time to continue work on this

codenoid avatar Nov 03 '23 04:11 codenoid

Hi @fguisso, to have confidence when changing the driver, I would like to add integration tests for MongoDB in GitHub Actions. These tests consist of turning up a MongoDB instance, running the tests focused on the queries, and turning down the MongoDB instance.

Do you think it is a good idea? There is an issue related to the Github Actions, that is correct? If so, this issue must be closed before adding integration tests?

michelaquino avatar Nov 07 '23 16:11 michelaquino

very good @michelaquino but this issue is for another case, I will open another for your case.

here #579

fguisso avatar Nov 08 '23 13:11 fguisso

Ok, thank you. Can you assign this issue to me as well?

michelaquino avatar Nov 08 '23 13:11 michelaquino

@michelaquino you need to comment in that issue to be part of assigns list

fguisso avatar Nov 08 '23 13:11 fguisso