noobaa-core
noobaa-core copied to clipboard
NC | Maintenance and Short Refactoring Tasks
This is a place for gathering short NC refactoring ideas coming from code reviews but out of the scope of the reviewed PR -
-
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~~
-
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~~
-
optimization in noobaa-cli - list with a filter of name call the account/bucket status (instead of listing all entries). Fixed by #8272
-
In mnage_nsfs: call
write_stdout_response
once in manage_nsfs and not from every function, for easier code maintenance. - Fixed by #8297 -
In mnage_nsfs: refactor the functions
fetch_bucket_data
andfetch_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). -
In manage_nsfs: split the implementation of list config file to a function for accounts and a function for buckets.
-
Consider moving CLI account, bucket and whitelist to seperated files.
-
Rename
data
variable to more meaningful variable names.