utils module is too big - break it up

Bug #2015274 reported by clayg
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
In Progress
Undecided
Unassigned

Bug Description

At last count, the swift.common.utils module is 7K lines

https://github.com/openstack/swift/blob/master/swift/common/utils.py

We want to break it up further to swift.common.utils.X

Where some examples of related utils functions/classes that might make their own module are

    - swift.common.utils.logging
    - swift.common.utils.sharding (stuff to do with shard ranges / sharding)
    - swift.common.utils.config (stuff to do with config parsing)

N.B. It might make sense to move some stuff out to existing common modules e.g. swift.common.request_helpers rather than create a new swift.common.utils.request_helpers

The most difficult part of the refactor will be avoiding circular dependencies, but that should be easily detectable (ImportError). It may be tempting to move some existing common modules under utils, or some new utils.X modules out to common.X, but we can do that more easily after we split up utils, so we should try to wait.

Revision history for this message
clayg (clay-gerrard) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to swift (master)

Reviewed: https://review.opendev.org/c/openstack/swift/+/879492
Committed: https://opendev.org/openstack/swift/commit/91db804e6f9b6713b44f7950b26925bf573cc934
Submitter: "Zuul (22348)"
Branch: master

commit 91db804e6f9b6713b44f7950b26925bf573cc934
Author: Clay Gerrard <email address hidden>
Date: Tue Apr 4 10:46:26 2023 -0500

    Start common.utils refactor

    Related-Bug: #2015274
    Change-Id: I6e7c1a19a39f51e4520dabfcfad65817534b42a2

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to swift (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/swift/+/879688

Changed in swift:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/swift/+/879721

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to swift (master)

Reviewed: https://review.opendev.org/c/openstack/swift/+/879688
Committed: https://opendev.org/openstack/swift/commit/c21256d8707aa794d0a46775806cb67bf042bb63
Submitter: "Zuul (22348)"
Branch: master

commit c21256d8707aa794d0a46775806cb67bf042bb63
Author: Tim Burke <email address hidden>
Date: Wed Apr 5 14:44:26 2023 -0700

    Pull timestamp-related functions out to a separate module

    Partial-Bug: #2015274
    Change-Id: I5b7ab3b2c150ec1513b3e6ebc4b27808d5df042c

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.opendev.org/c/openstack/swift/+/879721
Committed: https://opendev.org/openstack/swift/commit/c78a5962b5f6c9e75f154cac924a226815236e98
Submitter: "Zuul (22348)"
Branch: master

commit c78a5962b5f6c9e75f154cac924a226815236e98
Author: Tim Burke <email address hidden>
Date: Wed Apr 5 20:11:38 2023 -0700

    Pull libc-related functions out to a separate module

    Partial-Bug: #2015274
    Change-Id: I3e26f8d4e5de0835212ebc2314cac713950c85d7

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to swift (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/swift/+/883865

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to swift (master)

Reviewed: https://review.opendev.org/c/openstack/swift/+/883865
Committed: https://opendev.org/openstack/swift/commit/e29e2c3ae5fd32f6b8c3d70e6ea4db786f980151
Submitter: "Zuul (22348)"
Branch: master

commit e29e2c3ae5fd32f6b8c3d70e6ea4db786f980151
Author: Tim Burke <email address hidden>
Date: Wed May 10 22:21:27 2023 -0700

    Move IP-address-related functions out to new module

    Partial-Bug: #2015274
    Change-Id: I7ffa3a8e95d4ec456860b0484caf1dd08ff0849a

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.opendev.org/c/openstack/swift/+/914029
Committed: https://opendev.org/openstack/swift/commit/bc3a59bdd36fbd90554e73d419d8767a3845f9af
Submitter: "Zuul (22348)"
Branch: master

commit bc3a59bdd36fbd90554e73d419d8767a3845f9af
Author: Shreeya Deshpande <email address hidden>
Date: Tue Apr 2 14:33:29 2024 -0700

    Refactor utils

    - Move statsd client into it's own module
    - Move all logging functions into their own module
    - Move all config functions into their own module
    - Move all helper functions into their own module

    Partial-Bug: #2015274
    Change-Id: Ic4b5005e3efffa8dba17d91a41e46d5c68533f9a

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to swift (feature/mpu)

Fix proposed to branch: feature/mpu
Review: https://review.opendev.org/c/openstack/swift/+/917908

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to swift (feature/mpu)

Reviewed: https://review.opendev.org/c/openstack/swift/+/917908
Committed: https://opendev.org/openstack/swift/commit/ba398e15ede580f48464a213361daed749d57f5f
Submitter: "Zuul (22348)"
Branch: feature/mpu

commit bc3a59bdd36fbd90554e73d419d8767a3845f9af
Author: Shreeya Deshpande <email address hidden>
Date: Tue Apr 2 14:33:29 2024 -0700

    Refactor utils

    - Move statsd client into it's own module
    - Move all logging functions into their own module
    - Move all config functions into their own module
    - Move all helper functions into their own module

    Partial-Bug: #2015274
    Change-Id: Ic4b5005e3efffa8dba17d91a41e46d5c68533f9a

commit 51e4b6e279c9a4b50cdecbdb186252c676f2eac0
Author: OpenStack Release Bot <email address hidden>
Date: Tue Apr 30 11:06:13 2024 +0000

    reno: Update master for unmaintained/zed

    Update the zed release notes configuration to build from
    unmaintained/zed.

    Change-Id: I852953d8c06e44b4416818ae1ef1b1cf70864fb2

tags: added: in-feature-mpu
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.