-
Notifications
You must be signed in to change notification settings - Fork 38
Option to reset to tutorial state #271
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
Comments
I think there are a few ways reset could work: 1. Reset to last passing testIn most cases, this should help the user get back on track - but there is potential that tests may be passing while the user is still "off the rails". 2. Reset to a timeline based on the tutorial creators solutionsThis would be a kind of hard reset that destroys the users timeline but ensures that they have a working copy. |
May also want to trigger a reset script. Eg. in a SQL based tutorial. |
I think it may be best to present the user with the options and explain what is happening. The feature can be implemented in order with 3 parts. 1. Run Reset scriptIf provided in the tutorial config, run the reset script. For example, a DB seed script in a SQL tutorial. config:
reset:
command: './scripts/reset.sh'
If a reset script needs to change at later levels, it can be updated within the git timeline. 2. Reset to last passing testa. find the last successful test commit hash To capture the last commit_hash, we could store the last commit_hash in: Option c. strikes me as the simplest. 3. Reset to working timelinea. find the last successful test commit hash In this case, the entire solution branch would be loaded, then trimmed down with a reset. It may pose problems later if tutorials are made private. |
What type of options were you thinking of? I think it's best not to give them options if we can avoid it. It can create confusion and more they have to think about.
I would avoid the local storage solutions - like you said, that fails if there's a restart. Also, the "last passing test" wouldn't include the solution from that test (if there is one), would it? I'm trying to think of a case with subtasks, but it wouldn't work there since nothing likely would be committed. Wouldn't a
Something like this may be a more robust solution since it will rebuild everything. It may be a little slower, but probably the most reliable.
There's already problems if a repo is private I believe. Don't they need to be public to "build" and I think to run as well? I had one private at one point and nothing worked if I recall. |
I wrote this bash script for the reset:
Running the commands in the command line directly works 100%. Looks I can run these commands through node to avoid permissions issues but is a bit harder to test. |
Closed with #389 |
There is potential that users may go "off the rails" in a tutorial.
In this case, they should still be able to jump into a stable version of the current step. As the tutorials run on git, it's possible to load the stable state by running something like a
git reset --hard HEAD
that targets a specific commit.Some issues to consider:
The text was updated successfully, but these errors were encountered: