-
Notifications
You must be signed in to change notification settings - Fork 446
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
Clean root/env directory before saving config #967
Comments
Hi Brian! I understand that extra files lying around in the tutor environment may be causing errors. Yet, we cannot delete the environment on every I see two possible solutions:
Would any of these solutions work for you? |
Thanks for the response! I didn't think that was a supported use case, but I can see why it may be necessary for some advanced customization. Would you consider adding a Barring that, I think an action could work as long as they're explicitly pre-hooks called before the config is written. |
This would be wonderful. I often want to test things from a "clean slate," so having a user friendly way to "clean the slate" from within tutor would be amazing. |
In favor of
Against
Personally, I think the pros outweigh the cons. Thinking longer term, I do think we should discourage people from editing |
I'm also in favor of a
|
That sounds great, thanks! |
This would be neat, especially with themes as files do not get cleaned up as they are renamed / moved/ deleted etc.. Thanks! |
It's been a while since I've done anything on tutor. if no one is working on this, I'd like to add it. |
This will add a `-c` `--clean` flag to the save command and ensure that the env directory is deleted if it exists. Close overhangio#967
This will add a `-c` `--clean` flag to the save command and ensure that the env directory is deleted if it exists. Close overhangio#967
This will add a `-c` `--clean` flag to the save command and ensure that the env directory is deleted if it exists. Close overhangio#967
This will add a `-c` `--clean` flag to the save command and ensure that the env directory is deleted if it exists. Close overhangio#967
This will add a `-c` `--clean` flag to the save command and ensure that the env directory is deleted if it exists. Close overhangio#967
This will add a `-c` `--clean` flag to the save command and ensure that the env directory is deleted if it exists. Close overhangio#967
This will add a `-c` `--clean` flag to the save command and ensure that the env directory is deleted if it exists. Close overhangio#967
This will add a `-c` `--clean` flag to the save command and ensure that the env directory is deleted if it exists. Close overhangio#967
This will add a `-c` `--clean` flag to the save command and ensure that the env directory is deleted if it exists. Close overhangio#967
This will add a `-c` `--clean` flag to the save command and ensure that the env directory is deleted if it exists. Close overhangio#967
This will add a `-c` `--clean` flag to the save command and ensure that the env directory is deleted if it exists. Close overhangio#967
This will add a `-c` `--clean` flag to the save command and ensure that the env directory is deleted if it exists. Close overhangio#967
Bug description
Because the env dir is not cleaned when running
tutor config save
, any changes which delete previously rendered files can leave orphaned files in the env and result in undefined / unpredictable behavior. The bigger the upgrade, the more likely that orphaned files will exist and the more unpredictable the behavior is likely to be.I feel like we've discussed this before and it was counted as desired behavior, but I can't find the discussion or remember why it would be desirable.
How to reproduce
Example: when squashing migration files for Aspects between
v0.65.1
andv0.66.1
we deleted several Alembic migrations. Upon upgrade, each operator needs to delete their env directory (or at least certain subdirectories) and re-runtutor config save
otherwise Alembic will find the old migration files and throw an error.tutor-contrib-aspects==v0.65.1
plugin and enable ittutor config save
{tutor root}/env/plugins/aspects/apps/aspects/migrations/alembic/versions/
tutor-contrib-aspects==v0.66.1
tutor config save
{tutor root}/env/plugins/aspects/apps/aspects/migrations/alembic/versions/
and note that several files which have been deleted from the project still exist, additionally there maybe compiled python files and__pycache__
etc created there which may be out of date. Running a tutor init in this state will cause errors.{tutor root}/env/plugins/aspects/apps/aspects/migrations/alembic/versions/
(or just the entire env directory)tutor config save
{tutor root}/env/plugins/aspects/apps/aspects/migrations/alembic/versions/
and note that there are now the correct number of them.Environment
At least Mac OS and Ubuntu 22.04, Tutor 15/16/17 but probably impacts all environments and Tutor versions.
Additional context
This has come up as a consistent pain point with front-end development as well, @brian-smith-tcril may have more context about those issues.
The text was updated successfully, but these errors were encountered: