Re: Copy & paste of code in mgr modules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 30 Nov 2018, Sebastian Wagner wrote:
> All,
> 
> looks like the architecture of the mgr supporting independent modules
> was quite successful :-).
> 
> In recent times, I'm seeing an increasing amount of coped copied from
> other mgr modules. This has the obvious downside that a fix in one
> module leaves other modules unfixed. Like for example PR #25337.
> 
> Running `pylint --disable=all --enable=duplicate-code *` within
> pybind/mgr reveals, in my opinion, too many duplicates. One also have to
> count the places where code was semantically copied (or inspired by).
> 
> One obvious reason is that the mgr modules are prone to replicating
> code, as each module is build by many distinct teams for a specific and
> independent use case. Also, testing other affected modules can be quite
> challenging.
> 
> Therefor, I'd like to raise awareness. Maybe, we can reduce copies in
> the future.

My main question is what our strategy should be.  Where should shared code 
live?  Should we transplant it all into mgr_module.py, or into util.py or 
similar in the pybind/mgr directory?

Current example: I'm using format_bytes() from the status module from the 
pg_autoscaler module via remote(), which is probably not ideal!

s




[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux