-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NC | CLI | Updated the CLI response to have more info when account/bucket has been deleted #8723
base: master
Are you sure you want to change the base?
Conversation
552ba45
to
390d2b4
Compare
390d2b4
to
7a0f9e3
Compare
7a0f9e3
to
c3c75b6
Compare
@@ -131,16 +148,19 @@ ManageCLIResponse.LoggingExported = Object.freeze({ | |||
|
|||
ManageCLIResponse.UpgradeSuccessful = Object.freeze({ | |||
code: 'UpgradeSuccessful', | |||
message: 'Upgrade completed successfully', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add to all the Upgrade functions Config Directory Upgrade prefix? for example - Config Directory Upgrade completed successfully etc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
@@ -150,25 +170,30 @@ ManageCLIResponse.UpgradeHistory = Object.freeze({ | |||
|
|||
ManageCLIResponse.ConnectionCreated = Object.freeze({ | |||
code: 'ConnectionCreated', | |||
message: 'Connection has been successfully created', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that here as well maybe Notification Connection
@alphaprinz probably can help with this response details
@@ -94,25 +105,30 @@ ManageCLIResponse.AccountList = Object.freeze({ | |||
|
|||
ManageCLIResponse.BucketCreated = Object.freeze({ | |||
code: 'BucketCreated', | |||
message: 'Bucket has been successfully created', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would put the 'successfully' in the end of the sentance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I should do this for all the operations. Thanks
} | ||
|
||
to_string(detail) { | ||
const json = { | ||
response: { | ||
code: this.code, | ||
message: detail.name ? `${this.message}: ${detail.name}` : this.message, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does adding the detail after the message makes sense in all cases?
and also, do we always have detail and detail.name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whenever we want to print the name of the object in the operation then only we are adding detail at the end of message otherwise only the set message would be printed for every operation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the issue I see here is with accessing directly to detail.name while detail can be undefined
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to optional chain. Thanks
@@ -252,7 +252,7 @@ async function delete_bucket(data, force) { | |||
} | |||
await native_fs_utils.folder_delete(bucket_temp_dir_path, fs_context_fs_backend, true); | |||
await config_fs.delete_bucket_config_file(data.name); | |||
return { code: ManageCLIResponse.BucketDeleted, detail: '', event_arg: { bucket: data.name } }; | |||
return { code: ManageCLIResponse.BucketDeleted, detail: { name: data.name }, event_arg: { bucket: data.name } }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are there more cases where we want to add detail?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for now I have added this in delete_account() and delete_bucket() operation only. We can print the name of object in message by setting the name property in detail(for any operation) otherwise the set message would be printed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please fix all the cases in this PR or open another gap for the rest of the cases so we will handle it in the future
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I will open gap if there are more operations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@romayalon I just verified other then connection_management
there is no need add details explicitly. I have updated it. Thanks
For every operation we are printing the name of the object in the message(the code parsed the name automatically if detail.name
is defined).
c3c75b6
to
a0129e7
Compare
…en deleted Signed-off-by: Aayush Chouhan <[email protected]>
Signed-off-by: Aayush Chouhan <[email protected]>
Signed-off-by: Aayush Chouhan <[email protected]>
Signed-off-by: Aayush Chouhan <[email protected]>
a0129e7
to
4172231
Compare
Signed-off-by: Aayush Chouhan <[email protected]>
Explain the changes
Issues: Fixed #xxx / Gap #xxx
Testing Instructions: