Add safe prompt confirmation for cleanup before deleting backups and logs
-
Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA. As a benefit of being a GitLab Community Contributor, you receive complimentary access to GitLab Duo.
What does this merge request do and why?
gdk pristine deletes generated backups and logs. This change prevents accidental data loss during troubleshooting by requiring explicit user confirmation before destructive cleanup.
Related Issues
Resolves #2626 (closed)
Summary
gitlab-development-kit/lib/gdk/command/pristine.rb: added a TTY-only confirmation in GDK::Command::Pristine#gdk_tmp_clean.
When run in an interactive terminal the command now prints: "This will delete GDK backups and logs. Continue? [y/N]".
If the user types y or yes the existing git clean -fX -- tmp/ runs; any other answer skips the clean and returns true.
If stdin is not a TTY (CI/non-interactive), behavior is unchanged — the clean runs without prompting.
How to set up and validate locally
-
After installing prerequisites, check out this branch.
-
Run
gdk pristine. -
You will see the confirmation message:
This will delete GDK backups and logs. Continue? [y/N] -
Press
yor to proceed ornto abort.
Screenshots ( running local )
Impacted categories
The following categories relate to this merge request:
-
gdk-reliability - e.g. When a GDK action fails to complete. -
gdk-usability - e.g. Improvements or suggestions around how the GDK functions. -
gdk-performance - e.g. When a GDK action is slow or times out.
