noobaa-core icon indicating copy to clipboard operation
noobaa-core copied to clipboard

NC | Maintenance and Short Refactoring Tasks

Open romayalon opened this issue 6 months ago • 0 comments

This is a place for gathering short NC refactoring ideas coming from code reviews but out of the scope of the reviewed PR -

  1. S3 Flow - remove "fs_root" from BucketSpaceFS & AccountSpaceFS - Fixed by #8268 ~~Notice that on BucketspaceFS we use on various places but its value is always '' so its usage needs to be removed as well. Reference - https://github.com/noobaa/noobaa-core/pull/8258#discussion_r1705096898~~

  2. manage_nsfs.js Remove _.isUndefined() calls - Fixed by https://github.com/noobaa/noobaa-core/pull/8267 ~~As mentioned in the attached comment - "in general, there is no longer a need in js to use any function to check for undefined (not _.isUndefined and not util.isUndefined), and the best check is the trivial check - data.name === undefined. the need for functions was an old remain from back when undefined was not "well defined" in javascript but those times are long gone." Reference - https://github.com/noobaa/noobaa-core/pull/8258#discussion_r1706077224~~

  3. optimization in noobaa-cli - list with a filter of name call the account/bucket status (instead of listing all entries). Fixed by #8272

  4. In mnage_nsfs: call write_stdout_response once in manage_nsfs and not from every function, for easier code maintenance. - Fixed by #8297

  5. In mnage_nsfs: refactor the functions fetch_bucket_data and fetch_account_data - separate to (1) a function with defaults, (2) smaller functions where we can (3) and remove the comments (in the override values part).

  6. In manage_nsfs: split the implementation of list config file to a function for accounts and a function for buckets.

  7. Consider moving CLI account, bucket and whitelist to seperated files.

  8. Rename data variable to more meaningful variable names.

romayalon avatar Aug 07 '24 04:08 romayalon