mintproject / mic

Model Insertion Checker
https://mic-cli.readthedocs.io/en/latest/
5 stars 3 forks source link

encapsulate step7 does not remove temporary files #124

Closed Cmheidelberg closed 4 years ago

Cmheidelberg commented 4 years ago

Describe the bug If the user runs step7 when the remote repo already exists, and they choose not to publish mic quits without removing temp files.

chris@chris-ubuntu20:/home/chris/Desktop/tests/test_model2  (master)$ mic encapsulate step7
This step publishes your code, DockerImage and ModelConfiguration
Deleting the executions
Creating the git repository
Compressing your code
Creating a new commit
Creating or using the GitHub repository
The repo test_model2 exists. Do you want to use it? [Y/n]: n
Please rename the directory
chris@chris-ubuntu20:/home/chris/Desktop/tests/test_model2  (master)$ ls
data  docker  executions  mic.yaml  mint_component.zip  src  test_model2_component

This prevents the command from being rerun when after the user changes the name of their file.

FileExistsError: [Errno 17] File exists: '/home/chris/Desktop/tests/test_model2/test_model2_component/src'
issue-label-bot[bot] commented 4 years ago

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.97. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

mosoriob commented 4 years ago

Proposal

If the user doesn't want to reuse the repository then MIC asks the user a new name

chris@chris-ubuntu20:/home/chris/Desktop/tests/test_model2  (master)$ mic encapsulate step7
This step publishes your code, DockerImage and ModelConfiguration
Deleting the executions
Creating the git repository
Compressing your code
Creating a new commit
Creating or using the GitHub repository
The repo test_model2 exists. Do you want to use it? [Y/n]: n
**Please enter a new name:** 

What do you think?

dgarijo commented 4 years ago

I like the proposal. Can the messages be slightly changed? See below:

This step publishes your code (GitHub), DockerImage (DockerHub) and ModelConfiguration (MINT)
Deleting executions
Creating git repository
Compressing component code
Creating a new commit
Creating or using GitHub repository
The repository test_model2 exists. Do you want to use it? [Y/n]: n
mosoriob commented 4 years ago

@Cmheidelberg Can you fix it?