Use python to implement the cleanup directive#1625
Conversation
There was a problem hiding this comment.
Code Review
This pull request replaces the platform-dependent find command used in cleanup directives with a cross-platform Python-based cleaner utility script (_ramble_cleaner.py). The feedback highlights a potential runtime failure where the cleaner script is incorrectly guarded by the generate_file_editing_scripts configuration, meaning it won't be written if that config is disabled. Additionally, suggestions were made to simplify the cleaner script by using re.fullmatch and removing an unused is_dir flag in the file deletion loop.
Previously the `cleanup` directive was implemented using `find` with the `posix-extended` support. This makes it not very portable for various platforms. Piggybacking on the work done in GoogleCloudPlatform#1559, it now uses python to implement the cleanup. This assumes that `python3` is more widely available, for the platforms we aim to support.
a887309 to
a3432b1
Compare
Ramble Performance Test MetricsResults produced with commit: a3432b1
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1625 +/- ##
========================================
Coverage 93.02% 93.02%
========================================
Files 348 349 +1
Lines 33858 33862 +4
========================================
+ Hits 31497 31501 +4
Misses 2361 2361 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Previously the
cleanupdirective was implemented usingfindwith theposix-extendedsupport. This makes it not very portable for various platforms. Piggybacking on the work done in #1559, it now uses python to implement the cleanup.This assumes that
python3is more widely available, for the platforms we aim to support.