Reduce PyMongo Code Duplication Through Source Code Extraction

XMLWordPrintableJSON

    • Type: Epic
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Infrastructure
    • None
    • Extract and Consolidate Duplicate Source Code
    • Python Drivers
    • Not Needed
    • To Do
    • 0
    • 0
    • 0
    • 100
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Summary

      Extract pure logic from async driver files into shared modules that both async and sync inherit from. Purely sync methods and properties can be hoisted.  Care should be taken to balance readability and maintainability with deduplication when hoisting.  synchro.py continues to run but transforms far less code.

      Motivation

      PyMongo maintains async and sync driver implementations in parallel. The synchro script auto-generates pymongo/synchronous/, gridfs/synchronous and most of test/ from their async counterparts, making it hard to reason about whether a change affects one mode or both and causing contributors to edit generated files by mistake.

      Who is the affected end user?

      Developers

      How does this affect the end user?

      Developers constantly get caught up in the rigamarole of implementing changes in the async/sync versions of the code

      How likely is it that this problem or use case will occur?

      It happens often

      If the problem does occur, what are the consequences and how severe are they?

      Continued annoyance and slowed workflow from the team

      Is this issue urgent?

      No

      Is this ticket required by a downstream team?

      No

      Is this ticket only for tests?

      No

      Cast of Characters

      Engineering Lead: jib.adegunloye@mongodb.com 
      Document Author: steve.silvester@mongodb.com 
      POCers:
      Product Owner:
      Program Manager:
      Stakeholders:

      Channels & Docs

      Slack Channel

      Scope Document

      [Technical Design Document|some.url]

            Assignee:
            Unassigned
            Reporter:
            Jib Adegunloye
            None
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              None
              None
              None
              None
              None
              None