Skip to content

Chore: Show resources to be deleted and enhance warnings in destroy#4965

Merged
themisvaltinos merged 4 commits intomainfrom
themis/destroy_warning
Jul 15, 2025
Merged

Chore: Show resources to be deleted and enhance warnings in destroy#4965
themisvaltinos merged 4 commits intomainfrom
themis/destroy_warning

Conversation

@themisvaltinos
Copy link
Contributor

@themisvaltinos themisvaltinos commented Jul 14, 2025

This enhances the warning of the sqlmesh destroy command and lists the resources to be deleted before re-prompting the user to further confirm, fixes: #4960

Updated version:

destroy_v2

@tobymao
Copy link
Contributor

tobymao commented Jul 14, 2025

we don't need two prompts, just one is enough. oh was it already like this before?

(
"This will permanently delete all engine-managed objects, state tables and SQLMesh cache.\n"
"!!! EXTREME CAUTION: DESTRUCTIVE OPERATION !!!\n\n"
"The 'destroy' command will PERMANENTLY DELETE:\n"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not necessary permament if you have other mechanisms to recover, so i wouldn't say that

@themisvaltinos
Copy link
Contributor Author

we don't need two prompts, just one is enough. oh was it already like this before?

no it was originally just one, I added the second prompt for extra safety, but I’ve now revised it back to a single prompt shown after listing everything that will be deleted

@asingamaneni
Copy link

@themisvaltinos Thank you for putting this together and very helpful. It would be good to be able to show what objects will be deleted before the confirmation, so that the user can see the list before they confirm with "Y".

@asingamaneni
Copy link

@themisvaltinos Thank you for putting this together and very helpful. It would be good to be able to show what objects will be deleted before the confirmation, so that the user can see the list before they confirm with "Y".

Ah, I see in the screenshot you have posted. The user needs to confirm twice - please ignore my above comment!

@themisvaltinos themisvaltinos force-pushed the themis/destroy_warning branch from a776ed1 to 697ca85 Compare July 15, 2025 08:30
@themisvaltinos themisvaltinos requested a review from erindru July 15, 2025 08:32
'Deleted object "memory"."raw"."model1"',
'Deleted object "memory"."raw"."model2"',
'Deleted object "memory"."raw"."model2"',
'Deleted object "memory"."raw"."demographics"',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious why memory.raw.demographics no longer shows up

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point it still shows up this simply checks parts of the output but I added it back as well in the assertions

@themisvaltinos themisvaltinos force-pushed the themis/destroy_warning branch from cb196c7 to c25f611 Compare July 15, 2025 08:42
@themisvaltinos themisvaltinos merged commit 75d1615 into main Jul 15, 2025
27 checks passed
@themisvaltinos themisvaltinos deleted the themis/destroy_warning branch July 15, 2025 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sqlmesh destroy deletes external resources without warning - caused production data loss

4 participants