-
Notifications
You must be signed in to change notification settings - Fork 86
Description
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 NC | NSFS | Remove
fs_root
Member inBucketSpaceFS
andAccountSpaceFS
#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 - NC | ConfigFS Refactoring #8258 (comment) -
2. manage_nsfs.js Remove _.isUndefined() calls - Fixed by NC | NSFS | Remove Condition Checks Using lodash
isUndefined
#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 - NC | ConfigFS Refactoring #8258 (comment) -
3. optimization in noobaa-cli - list with a filter of name call the account/bucket status (instead of listing all entries). Fixed by NC | NSFS | CLI | Improve Performance of List with Name Filter #8272
-
4. In mnage_nsfs: call
write_stdout_response
once in manage_nsfs and not from every function, for easier code maintenance. - Fixed by NC | ConfigFS | Create prepare for schema functions and some manage_nsfs refactoring #8297 -
5. 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). -
6. In manage_nsfs: split the implementation of list config file to a function for accounts and a function for buckets. - Fixed by NC | NSFS | CLI | Separate Bucket and Account List Functions #8747
-
7. Consider moving CLI account, bucket and whitelist to seperated files.
-
8. Rename
data
variable to more meaningful variable names. -
9. Remove bi-directional require between schema_utils and config.js.
-
10. Remove sudo from the CLI usage.