-
Notifications
You must be signed in to change notification settings - Fork 8
Modify progress reset to redownload base files #38
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds functionality to re-download base files during progress reset operations to ensure that files like answers.txt are properly reset to their original state, addressing issue #240.
Changes:
- Added import for
Pathfrompathlibmodule - Implemented base files re-download logic within the progress reset flow
- Added directory creation and binary file type detection for downloaded base files
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| with ExercisesRepo() as repo: | ||
| formatted_exercise_name = exercise_config.formatted_exercise_name | ||
|
|
||
| if len(exercise_config.base_files) > 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even repo_type ignore may have base files we want to restore to original state
desmondwong1215
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
SAN-MUYUN
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your work! Tested and works, LGTM 👍
| is_binary, | ||
| ) | ||
|
|
||
| if exercise_config.exercise_repo.repo_type != "ignore": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Fixes git-mastery/exercises#240
Currently, we use
base-filesforanswers.txtfile, but we don't reset these base files inprogress reset. This missing behaviour leads to unexpected results, where students expectprogress resetto reset theiranswers.txtfile, but it is not reset, ie. it is not an entirely clean state as students would expect.This change adds an additional step in
progress resetto re-download base files as well to ensure comprehensiveness inprogress reset, to ensure that the exercise is reset fully.