Closed lwasser closed 4 years ago
Let's brainstorm some possible workflows that a user might want:
What other combinations of actions can you imagine?
@lwasser and I discussed this today, and want to support two basic workflows:
We can support both of these with the existing abc-assignment-template
script and available arguments, but to make these common workflows easier, we propose to replace with two helper scripts - new-assignment-template
and update-assignment-template
which would call the same functions but have different defaults.
new-assignment-template
- default is fail
mode (checks for existing dir, fails if not present) and does not by default push to github (allowing instructor to check things before pushing)update-assignment-template
- default is merge
mode (adds / updates existing files) and then does git add + commit + pushIn the midst of implementing this, and making note of one tricky scenario. If you go through the full workflow (create local repo, create remote repo, add remote to local, push to github) and then re-run with --mode delete
(which deletes the local repo and re-creates it) you end up in a scenario where your local repo has no common history with the remote repo. In this case git pull
exits with fatal: refusing to merge unrelated histories
.
What we probably want to do in this scenario (i.e. if mode == "delete" and remote_repo_exists
) is to delete the local directory, then clone from the existing remote, make the changes there, then push.
There is an --allow-unrelated-histories
option for git pull
, but this seems dangerous.
Just to complete the conversation here, the resolution for the --mode delete
issue above is to delete everything but the .git
directory (implemented by simply moving the .git
dir to a new temporary location, re-creating the template directory, and moving it back).
working through all of the steps it seems like we need to think more about the actual workflow associated with
in the most recently merged pr, #91 there was in an issue in my workflow where i started to see abc-classroom doing git things for me but then it stopped. the workflow was:
i ran quickstart
i ran nbgrader create assignment
i ran abc-assignment-template
i didn't expect step 3 to automatically push to github. this is not ideal because i'd like to cehck the repo before pushing it. For instance perhaps i want to update the readme or make other tweaks. i need a way to do that
when i saw issues in my repo and did want to update, i expected to be able to just run abc-assignment again. however this failed because now the repo exists and a new commit and push are needed but no repo needs to be created.
We need to think through what the correct workflow is for this. each command should be carefully scoped out
Could it be
create-assignment-repo assignment-name
: this would simply create the repo, and initialize it as a git repo.push-assignment-repo assignment name --commit-message
: this would commit and push changes to github checking to see if the repo already exists or not.the big question for me here is where to place the moving of files if for instance you release new nbgrader files. Maybe push assignment repo could optionally look in the release dir for new files? i'm not sure where to put this or where a user would expect it. @kcranston thoughts? @jlpalomino ?