-
Notifications
You must be signed in to change notification settings - Fork 3
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
Command to clear snaps in bulk (e.g. last x hours) #5
Comments
Can you share your thoughts? Maybe I can write this feature out.
Tags are used for grouping, so they can serve as a filtering option when batch cleaning snapshots, right? And the design of selecting snapshots to clean and the algorithm is intended to use time intervals, such as before or after a certain time, is that correct? For example: # Delete all snapshots with the "modify_conf" tag # Delete all snapshots with the "modify_conf" tag that belong to the "scheduled" category # Delete all snapshots between 2024-11-19 11:38 and 2024-11-21 23:59 # Delete snapshots after 2024-11-19 that have the "modify_conf" tag and are in the "scheduled" category # Delete snapshots in the "user" category before 2024-11-21 Before officially deleting these snapshots, a "preparation for deletion" list of snapshots (deletion range) will be provided for user review. Chinese version: 可以说说你的想法吗?也许我能把这个功能给写出来。
标签是用于分组,以便在批量清理快照时作为一个过滤选项,对吗?而挑选出想要清理的快照,挑选算法的设计是打算用时间的区间、XX时间前或XX时间后,是这样吗? 如: # 删除所有具有 "modify_conf" 标签的快照 # 删除所有具有 "modify_conf" 标签,且属于 “计划中” 分类的快照 # 删除 2024-11-19 11:38 至 2024-11-21 23:59 间的所有快照 # 删除 2024-11-19 之后,且具有 "modify_conf" 标签、“计划中” 分类的快照 # 删除 2024-11-21之前,具有 “用户” 分类的快照 在正式删除这些快照前,会提供 “准备删除” 的快照列表(删除范围),供用户审阅。 |
Yes, that should be useful! There is no more |
Thank you for your correction and addition. I will get to work on it right away. |
Thank you for the pull request, really nice! My main request is to move as much of the new functions to a new file as possible. Let's call it Other than that, I added some other comments, hope they are clear - if anything looks too much work let me know. I can do some of them after you merge as well. |
Move the code for the bulk delete function to a new file? Of course! I am still pondering whether to write the corresponding unit tests, because I placed part of the new functionality code in Actually, before submitting this Pull Request, I wrote a piece of code to separate some responsibilities of the |
Thank you! To be clear, your pull request can be merged without unittests - I am happy to do it with manual tests. In my humble opinion, unit tests help mostly in two things (1) to guard important functionality from breaking as it gets worked on or refactored, so it is critical to have it especially for a section of the code that is complicated, and will undergo further change; and (2) as a guarantee that the code does what we want; e.g. for test-driven development, or for fixing bugs (where a test may be written to prove that the code operates in the desired manner), or simply for documentation and easier understanding of code behavior. Having said that if you would like you are welcome to write them, now or as another PR to test critical functionalities. Of course it will only improve the code health, and we will merge that in as well. |
No problem, please give me some time to understand the relevant knowledge about unit testing and the unittest library. After that, I will submit the unit test code related to it, as well as the code that splits the new functionality into other files as mentioned above. |
There should be a command to clear snapshots in bulk.
It should have options to specify which tags, and what algorithm should be applied to the clean up.
The text was updated successfully, but these errors were encountered: