aiidalab / aiidalab-launch

Tool to launch AiiDAlab on a local workstation.
MIT License
5 stars 3 forks source link

Call reset when remove profile #189

Open unkcpz opened 1 year ago

unkcpz commented 1 year ago

fixes #172

The aiidalab-launch reset can be used to purge the data mounted such as the home mount as a docker volume and conda volume mounted. Usually, when deleting the profile, users are supposed to reset the data as well, in this PR, I call reset before the profile remove.

codecov[bot] commented 1 year ago

Codecov Report

All modified lines are covered by tests :white_check_mark:

Comparison is base (33c7a26) 86.32% compared to head (afb325b) 86.38%.

:exclamation: Current head afb325b differs from pull request most recent head 79eb2db. Consider uploading reports for the commit 79eb2db to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #189 +/- ## ========================================== + Coverage 86.32% 86.38% +0.05% ========================================== Files 9 9 Lines 914 918 +4 ========================================== + Hits 789 793 +4 Misses 125 125 ``` | [Flag](https://app.codecov.io/gh/aiidalab/aiidalab-launch/pull/189/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidalab) | Coverage Δ | | |---|---|---| | [py-3.10](https://app.codecov.io/gh/aiidalab/aiidalab-launch/pull/189/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidalab) | `86.27% <100.00%> (+0.06%)` | :arrow_up: | | [py-3.11](https://app.codecov.io/gh/aiidalab/aiidalab-launch/pull/189/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidalab) | `86.27% <100.00%> (+0.06%)` | :arrow_up: | | [py-3.8](https://app.codecov.io/gh/aiidalab/aiidalab-launch/pull/189/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidalab) | `86.22% <100.00%> (+0.06%)` | :arrow_up: | | [py-3.9](https://app.codecov.io/gh/aiidalab/aiidalab-launch/pull/189/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidalab) | `86.33% <100.00%> (+0.05%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidalab#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/aiidalab/aiidalab-launch/pull/189?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidalab) | Coverage Δ | | |---|---|---| | [aiidalab\_launch/\_\_main\_\_.py](https://app.codecov.io/gh/aiidalab/aiidalab-launch/pull/189?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidalab#diff-YWlpZGFsYWJfbGF1bmNoL19fbWFpbl9fLnB5) | `79.87% <100.00%> (+0.25%)` | :arrow_up: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

unkcpz commented 1 year ago

Thanks @danielhollas The test is added.

I believe this code should be called at the very end right?

I was thinking about this as well, but still have not convinced myself although it makes more sense in logic. Because once the profile is removed there is no way to remove volume through the command line again. However, if the profile deletes is failed after cleaning the volume, the profile still can be deleted.

Also please add a specific WARNING and confirmation for this case.

This is taken care of by reset already, it asks the user to input the profile name to confirm.

Anyway, I moved the purge to the end after the profile was removed, if you think it is better to move it before, I'll change it.

unkcpz commented 1 year ago

Hi @danielhollas, I think this one is ready to have a second review.